/var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/bake/src/Command
NameSizeModeActions
AllCommand.php38990644editdlrm
BakeCommand.php77070644editdlrm
BehaviorCommand.php12380644editdlrm
CellCommand.php34180644editdlrm
CommandCommand.php12310644editdlrm
CommandHelperCommand.php12520644editdlrm
ComponentCommand.php12540644editdlrm
ControllerAllCommand.php27860644editdlrm
ControllerCommand.php94330644editdlrm
EntryCommand.php74160644editdlrm
FixtureAllCommand.php32580644editdlrm
FixtureCommand.php178000644editdlrm
FormCommand.php12070644editdlrm
HelperCommand.php12240644editdlrm
MailerCommand.php16910644editdlrm
MiddlewareCommand.php12490644editdlrm
ModelAllCommand.php27420644editdlrm
ModelCommand.php487300644editdlrm
PluginCommand.php147230644editdlrm
ShellHelperCommand.php12420644editdlrm
SimpleBakeCommand.php47930644editdlrm
TemplateAllCommand.php28420644editdlrm
TemplateCommand.php142920644editdlrm
TestCommand.php267160644editdlrm
Edit: /var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/bake/src/Command/SimpleBakeCommand.php (4793B)
*/ public function templateData(Arguments $arguments): array { $namespace = Configure::read('App.namespace'); if ($this->plugin) { $namespace = $this->_pluginNamespace($this->plugin); } return ['namespace' => $namespace]; } /** * Execute the command. * * @param \Cake\Console\Arguments $args The command arguments. * @param \Cake\Console\ConsoleIo $io The console io * @return int|null The exit code or null for success */ public function execute(Arguments $args, ConsoleIo $io): ?int { $this->extractCommonProperties($args); $name = $args->getArgumentAt(0); if (empty($name)) { $io->err('You must provide a name to bake a ' . $this->name()); $this->abort(); } $name = $this->_getName($name); $name = Inflector::camelize($name); $this->bake($name, $args, $io); $this->bakeTest($name, $args, $io); return static::CODE_SUCCESS; } /** * Generate a class stub * * @param string $name The class name * @param \Cake\Console\Arguments $args The console arguments * @param \Cake\Console\ConsoleIo $io The console io * @return void */ protected function bake(string $name, Arguments $args, ConsoleIo $io): void { $contents = $this->createTemplateRenderer() ->set('name', $name) ->set($this->templateData($args)) ->generate($this->template()); $filename = $this->getPath($args) . $this->fileName($name); $io->createFile($filename, $contents, $this->force); $emptyFile = $this->getPath($args) . '.gitkeep'; $this->deleteEmptyFile($emptyFile, $io); } /** * Generate a test case. * * @param string $className The class to bake a test for. * @param \Cake\Console\Arguments $args The console arguments * @param \Cake\Console\ConsoleIo $io The console io * @return void */ public function bakeTest(string $className, Arguments $args, ConsoleIo $io): void { if ($args->getOption('no-test')) { return; } $test = new TestCommand(); $test->plugin = $this->plugin; $test->bake($this->name(), $className, $args, $io); } /** * Gets the option parser instance and configures it. * * @param \Cake\Console\ConsoleOptionParser $parser Option parser to update. * @return \Cake\Console\ConsoleOptionParser */ public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser { $parser = $this->_setCommonOptions($parser); $name = $this->name(); $parser->setDescription( sprintf('Bake a %s class file.', $name) )->addArgument('name', [ 'help' => sprintf( 'Name of the %s to bake. Can use Plugin.name to bake %s files into plugins.', $name, $name ), ])->addOption('no-test', [ 'boolean' => true, 'help' => 'Do not generate a test skeleton.', ]); return $parser; } }