Skip to content

Commit

Permalink
Twig template locator (#4)
Browse files Browse the repository at this point in the history
* change location for twig view

* fix message console

* remove conf file
  • Loading branch information
gilles-g authored May 3, 2019
1 parent 9ddc40b commit f23a8eb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
14 changes: 7 additions & 7 deletions Command/GenerateCronCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ public function __construct(DumpFileFactory $dumpFileFactory, $name = null)

protected function configure()
{
$description = <<<EOPHP
Generate cron file
> Crons are required for execute the command.
EOPHP;

$this
->setName(static::$defaultName)
->setDescription($description)
->setDescription('Generate a cron file')
->setHelp(<<<'EOPHP'
The <info>%command.name%</info> generate cron file
Crons are required for execute the command.
EOPHP
)
->addOption('dry-run', null, InputOption::VALUE_NONE, 'Execute the dump file as a dry run.')
->addArgument('env-mode', InputArgument::REQUIRED, 'Env config')
;
Expand Down
4 changes: 1 addition & 3 deletions Cron/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ private function createCrons()

private function checkConfiguration()
{
$valuesToCheck = ['user', 'absolute_path'];

foreach ($valuesToCheck as $value) {
foreach (['user', 'absolute_path'] as $value) {
$this->checkEnvConfiguration($this->cronConfig, $value);
}

Expand Down
2 changes: 1 addition & 1 deletion Cron/DumpFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function init($env)

private function render()
{
return $this->twigEngine->render('template.txt.twig', [
return $this->twigEngine->render('@LexikCronFileGenerator/template.txt.twig', [
'crons' => $this->configuration->getCrons(),
'user' => $this->configuration->getUser(),
'absolute_path' => $this->configuration->getAbsolutePath(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

class LexikCronFileGeneratorExtensionTest extends TestCase
{
public function testLoadEmptyConfiguration()
public function testLoadConfiguration()
{
$container = $this->createContainer([
'framework' => [
Expand Down

0 comments on commit f23a8eb

Please sign in to comment.