generate ships

exmample:
run shipyard::ship <name>
run shipyard::ship <name> <namespace>
run shipyard::ship <name> --no-namespace

@param array 		$params
@return void
968108
public function action_ship( $params ) 
	{	
		$options = \CCDataObject::assign( $params );
		
		$name = $options->get( 0, null );
		$namespace = $options->get( 1, null );
		
		// get name if we dont have one
		while( !$name ) 
		{
			$name = CCCli::read( 'Please enter the ship name: ' );
		}
		
		// set namespace 
		if ( !$namespace ) 
		{
			$namespace = $name;
		}
		
		// no namespace?
		if ( $params['no-namespace'] ) 
		{
			$namespace = false;
		}
		
		// custom target
		$target = $options->get( 'target', ORBITPATH );
		
		if ( substr( $target, 0, 1 ) !== '/' )
		{
			$target = CCFPATH.$target;
		}
		if ( substr( $target, -1 ) !== '/' )
		{
			$target .= '/';
		}
		
		$target .= $name.'/';
		
		// check if the module is in our orbit path
		if ( is_dir( $target ) ) 
		{
			if ( !CCCli::confirm( "there is already a ship with this name. do you want to overwrite?", true ) ) 
			{
				return;
			}
		}
		
		// create the blueprint
		$defaults = \CCConfig::create( 'shipyard' );
		
		$blueprint = array(
			'name'			=> $name,
			'version'		=> $defaults->get( 'defaults.version' ),
			'description'	=> $defaults->get( 'defaults.description' ),
			'homepage'		=> $defaults->get( 'defaults.homepage' ),
			'keywords'		=> $defaults->get( 'defaults.keywords' ),
			'license'		=> $defaults->get( 'defaults.license' ),
			
			'authors'		=> $defaults->get( 'defaults.authors' ),
						
			'namespace'		=> $namespace,
		);
		
		// create file
		\CCJson::write( $target.'blueprint.json', $blueprint, true );
		
		
		$ship = \CCOrbit_Ship::blueprint( $blueprint, $target );
		
		// create event files
		if ( $namespace ) 
		{
			// create forge instance
			$forge = new \CCForge_Php( $namespace );
			
			// add header
			$forge->comment( $this->make_comment_header( $ship->name.' ship', array(
				'package'	=> $ship->name,
				'authors'	=> $ship->authors,
				'version'	=> $ship->version,
				'copyright'	=> \CCConfig::create( 'shipyard' )->get( 'defaults.copyright' ),
			)));
			
			// add class
			$forge->closure( 'class Ship extends \CCOrbit_Ship', function() {
				
				$forge = new \CCForge_Php;
				
				// add init function
				echo $forge->closure( 'public function wake()', '// Do stuff', 
					"initialize the ship\n\n".
					"@return void"
				);
				
				echo $forge->line(2);
				
				// add init function
				echo $forge->closure( 'public function install()', '// Do stuff', 
					"install the ship\n\n".
					"@return void"
				);
				
				echo $forge->line(2);
				
				// add init function
				echo $forge->closure( 'public function unsintall()', '// Do stuff', 
					"uninstall the ship\n\n".
					"@return void"
				);
			});
			
			\CCFile::write( $target.CCDIR_CLASS.'Ship'.EXT, $forge );
			
		} else {
			
			// create forge instance
			$forge = new \CCForge_Php();
			
			// add header
			$forge->comment( $this->make_comment_header( $ship->name, array(
				'package'	=> $ship->name,
				'authors'	=> $ship->authors,
				'version'	=> $ship->version,
				'copyright'	=> \CCConfig::create( 'shipyard' )->get( 'defaults.copyright' ),
			)));
			
			\CCFile::write( $target.'shipyard/wake'.EXT, $forge );
			\CCFile::write( $target.'shipyard/install'.EXT, $forge );
			\CCFile::write( $target.'shipyard/uninstall'.EXT, $forge );
		}
		
		// sucess
		CCCli::line( "'".$name."' succesfully created under: ".$target, 'green' );
	}
323421
public function run($route, $params = [])
    {
        $this->scanner->stdout('Detect PhpFunction - BEGIN', Console::FG_CYAN);
        foreach (self::$files[static::EXTENSION] as $file) {
            if ($this->containsTranslator($this->module->phpTranslators, $file)) {
                $this->extractMessages($file, [
                    'translator' => (array) $this->module->phpTranslators,
                    'begin' => '(',
                    'end' => ')',
                ]);
            }
        }

        $this->scanner->stdout('Detect PhpFunction - END', Console::FG_CYAN);
    }
501800
protected function _checkParams( stdClass $params, array $names )
	{
		foreach( $names as $name )
		{
			if( !property_exists( $params, $name ) ) {
				throw new Controller_ExtJS_Exception( sprintf( 'Missing parameter "%1$s"', $name ), -1 );
			}
		}
	}
1229430
public function execute (array $params)
    {
        try {
            $this->_validateParameters($params);
            
            // モデル用ディレクトリの初期化
            $this->_initModelDirectory();

            // モデルクラスファイルを生成する
            $this->_generateModelClassFile();

            // ModelFactoryクラスを更新する
            $this->_updateModelFactory();

            $this->log('generated '.$this->model_name.'Model!', 'success');
        
        } catch (\Exception $e) {
            $this->errorLog($e->getMessage());
        }
    }
1193958
public function build(array $params = null) 
    {
        if(null !== $params) {
            $this->setParams($params);
        }
        
        $this->adapter = $this->getDoctrinePaginatorAdapter();
		$this->setCurrentPageNumber($this->getParam('page', 1));
		$this->setDefaultItemCountPerPage($this->getParam('limit', 30));
    }
1171697
public function run() {

        
        
        // Create a new project
        if (Console::getArg('--create')) {
            $this->createProject(Console::getArg('--create'));
            return;
        // Initialize the current workspace    
        } elseif (Console::getArg('--init')) {
            $this->initProject();
            return;
        // Run a command from an application    
        } elseif (Console::getArg('--run')) {
            $this->runAction(Console::getArg('--run'), json_decode(Console::getArg('--data', '[]'), true));
            return;
        } else {        
            $this->help();
        }
    }
467777
public function run(array $args)
    {
        Index::info('Help Menu');
        Index::info('- `eve generate <schema*> <namespace>`    Generates files based on schema');
        Index::info('- `eve database <schema*>`                Generates database table/s schema');
        Index::info('- `eve install`                           Generates default framework files');
        Index::info('- `eve job <name*> <data*>`               Executes a job');
		Index::info('- `eve queue <name*> <data*>`             Queues a job');

        die(0);
    }
617352
public function setUp(array $params)
    {
        if (empty($params['endpoint'])) {
            throw new \RuntimeException('Parameter "endpoint" cannot be empty.');
        }

        if (empty($params['ssl_pem_path'])) {
            throw new \RuntimeException('Parameter "ssl_pem_path" cannot be empty.');
        }

        if (!is_readable($params['ssl_pem_path'])) {
            throw new \RuntimeException('"ssl_pem_path" file does not exist or is not readable.');
        }

        $this->params = $params;
    }
1252544
public function run($path)
    {

        $this->createMigrationRepository();
        $repository = $this->migrator->getRepository();
        $migrations = $this->migrator->getMigrationFiles($path);
        $ran        = $repository->getRan();
        if (!empty($migrations)) {
            $files = array_keys($migrations);
            foreach ($files as $name) {
                if (!in_array($name, $ran)) {
                    continue;
                }
                $migration            = new stdClass();
                $migration->migration = $name;
                $repository->delete($migration);
            }
        }


        $this->migrator->run($path);
    }
506336
public function runApplication()
    {
        $application = $this->createNew(SymfonyApplication::class, $this->getName());
        foreach ($this->commands as $commandClass) {
            $command = $this->createNew($commandClass);
            $application->add($command);
            if ($command instanceof Command && $command->isDefaultCommand()) {            
                $application->setDefaultCommand($command->getName());
            }
        }        
        $application->run();
    }
1294370
public function save(array $params)
    {
        foreach ($params as $method => $param) {
            if (is_array($param) && isset($param[0])) {
                call_user_func_array([$this, $method], $param);
            } else {
                $this->{$method}($param);
            }
        }
    }
387625
protected function generateBody(array $params, array $columns): void
  {
    $uniqueColumns = $this->checkUniqueKeys($columns);
    $limit         = ($uniqueColumns==null);

    $this->codeStore->append(sprintf('delete from %s', $this->tableName));
    $this->codeStore->append('where');

    $first = true;
    foreach ($params as $column)
    {
      if ($first)
      {
        $format = sprintf("%%%ds %%s = p_%%s", 1);
        $this->codeStore->appendToLastLine(sprintf($format, '', $column['column_name'], $column['column_name']));
      }
      else
      {
        $format = sprintf("and%%%ds %%s = p_%%s", 3);
        $this->codeStore->append(sprintf($format, '', $column['column_name'], $column['column_name']));
      }

      $first = false;
    }

    if ($limit)
    {
      $this->codeStore->append('limit 0,1');
    }

    $this->codeStore->append(';');
  }
450317
public function setParams($params)
    {
        // $param should be a single key => value pair
        if (is_array($params)) {
            foreach ($params as $key => $param) {
                $this->params[$key] = $param;
            }
        }
    }
242960
public function run()
    {
        $tag = ArrayHelper::remove($this->containerOptions, 'tag', 'div');
        echo Html::endTag($tag);
        if ($this->renderInnerContainer) {
            echo Html::endTag('div');
        }
        $tag = ArrayHelper::remove($this->options, 'tag', 'nav');
        echo Html::endTag($tag, $this->options);
    }
1211220
public function run()
    {
        $config = Config::get('global.config', 'aliases');
        $alias = new Manager($config['classes']);
        $alias->register();
        $this->container->set('alias', $alias);
    }
1018668
protected function call($command, $params = [])
    {
        $parameters['command'] = $command;

        foreach($params as $key => $value) {
            $parameters[$key] = $value;
        }

        $command = $this->getApplication()->find($command);

        return $command->run(new ArrayInput($parameters), $this->output);
    }
1375001
public function containerItemsProcFunc(array &$params)
    {
        $this->init($params['row']['pid']);
        $possibleContainers = [];
        $this->removeItemsFromListOfSelectableContainers($params, $possibleContainers);

        if (!empty($possibleContainers)) {
            $params['items'] = array_merge($params['items'], $possibleContainers);
        }
        $itemUidList = '';
        if (count($params['items']) > 1) {
            foreach ($params['items'] as $container) {
                if ($container[1] > 0) {
                    $itemUidList .= $itemUidList ? ',' . $container[1] : $container[1];
                }
            }
        }

        if ($itemUidList) {
            $this->deleteDisallowedContainers($params, $itemUidList);
        }
    }