/var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/bake/src/Command
Edit: /var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/bake/src/Command/CellCommand.php (3418B)
*/
public function templateData(Arguments $arguments): array
{
$prefix = $this->getPrefix($arguments);
if ($prefix) {
$prefix = '\\' . str_replace('/', '\\', $prefix);
}
$namespace = Configure::read('App.namespace');
if ($this->plugin) {
$namespace = $this->_pluginNamespace($this->plugin);
}
return compact('namespace', 'prefix');
}
/**
* Bake the Cell class and template file.
*
* @param string $name The name of the cell to make.
* @param \Cake\Console\Arguments $args The console arguments
* @param \Cake\Console\ConsoleIo $io The console io
* @return void
*/
public function bake(string $name, Arguments $args, ConsoleIo $io): void
{
$this->bakeTemplate($name, $args, $io);
parent::bake($name, $args, $io);
}
/**
* Bake an empty file for a cell.
*
* @param string $name The name of the cell a template is needed for.
* @param \Cake\Console\Arguments $args The console arguments
* @param \Cake\Console\ConsoleIo $io The console io
* @return void
*/
protected function bakeTemplate(string $name, Arguments $args, ConsoleIo $io): void
{
$path = $this->getTemplatePath($args, 'cell');
$path .= implode(DS, [$name, 'display.php']);
$io->createFile($path, '', $this->force);
}
/**
* Gets the option parser instance and configures it.
*
* @param \Cake\Console\ConsoleOptionParser $parser Parser instance
* @return \Cake\Console\ConsoleOptionParser
*/
public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser
{
$parser = parent::buildOptionParser($parser);
$parser->addOption('prefix', [
'help' => 'The namespace prefix to use.',
]);
return $parser;
}
}