mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-24 03:35:01 +01:00
update CreateRectorCommand with fixture approach
This commit is contained in:
parent
5c7b3cdb7a
commit
eabfadc2bb
@ -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');
|
||||
}
|
||||
|
||||
|
@ -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'])
|
||||
);
|
||||
|
@ -1,3 +0,0 @@
|
||||
<?php
|
||||
|
||||
_CodeAfter_
|
@ -1,3 +1,11 @@
|
||||
<?php
|
||||
|
||||
_CodeBefore_
|
||||
|
||||
?>
|
||||
-----
|
||||
<?php
|
||||
|
||||
_CodeAfter_
|
||||
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user