update CreateRectorCommand with fixture approach

This commit is contained in:
Tomas Votruba 2018-12-09 22:20:09 +01:00
parent 5c7b3cdb7a
commit eabfadc2bb
4 changed files with 11 additions and 6 deletions

View File

@ -131,7 +131,7 @@ final class CreateRectorCommand extends Command
private function resolveDestination(SmartFileInfo $smartFileInfo, array $templateVariables): string
{
$destination = $smartFileInfo->getRelativeFilePathFromDirectory(self::TEMPLATES_DIRECTORY);
if (! Strings::match($destination, '#(wrong|correct)[\d+]*\.php\.inc#')) {
if (! Strings::match($destination, '#fixture[\d+]*\.php\.inc#')) {
$destination = rtrim($destination, '.inc');
}

View File

@ -40,8 +40,8 @@ final class ConfigurationFactory
$category,
$this->resolveFullyQualifiedNodeTypes($config['node_types']),
$config['description'],
$config['code_before'],
$config['code_after'],
trim(ltrim($config['code_before'], '<?php')),
trim(ltrim($config['code_after'], '<?php')),
array_filter((array) $config['source']),
$this->resolveLevelConfig($config['level'])
);

View File

@ -1,3 +1,11 @@
<?php
_CodeBefore_
?>
-----
<?php
_CodeAfter_
?>