mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-20 01:52:22 +00:00
improve create command
This commit is contained in:
parent
ecaf48501c
commit
d4a32b4e1b
|
@ -31,3 +31,5 @@ services:
|
|||
Rector\DeadCode\Rector\If_\SimplifyIfElseWithSameContentRector: null
|
||||
Rector\DeadCode\Rector\Ternary\TernaryToBooleanOrFalseToBooleanAndRector: null
|
||||
Rector\PHPUnit\Rector\ClassMethod\RemoveEmptyTestMethodRector: null
|
||||
Rector\DeadCode\Rector\TryCatch\RemoveDeadTryCatchRector: null
|
||||
Rector\dead-code\Rector\TryCatch\RemoveDeadTryCatchRector: null
|
||||
|
|
|
@ -57,8 +57,10 @@ final class ConfigurationFactory
|
|||
$rectorRecipe['description'],
|
||||
$this->normalizeCode($rectorRecipe['code_before']),
|
||||
$this->normalizeCode($rectorRecipe['code_after']),
|
||||
$this->normalizeCode($rectorRecipe['extra_file_content'] ?? ''),
|
||||
$rectorRecipe['extra_file_name'],
|
||||
isset($rectorRecipe['extra_file_content']) ? $this->normalizeCode(
|
||||
$rectorRecipe['extra_file_content']
|
||||
) : null,
|
||||
$rectorRecipe['extra_file_name'] ?? null,
|
||||
array_filter((array) $rectorRecipe['source']),
|
||||
$this->configResolver->resolveSetConfig($rectorRecipe['set']),
|
||||
$this->detectPhpSnippet($rectorRecipe['code_before'])
|
||||
|
|
|
@ -10,6 +10,7 @@ use PhpParser\Node\Expr\ArrayItem;
|
|||
use PhpParser\Node\Expr\ClassConstFetch;
|
||||
use PhpParser\Node\Name\FullyQualified;
|
||||
use Rector\Core\PhpParser\Printer\BetterStandardPrinter;
|
||||
use Rector\Core\Util\RectorStrings;
|
||||
use Rector\RectorGenerator\ValueObject\Configuration;
|
||||
|
||||
final class TemplateVariablesFactory
|
||||
|
@ -31,7 +32,7 @@ final class TemplateVariablesFactory
|
|||
{
|
||||
$data = [
|
||||
'_Package_' => $configuration->getPackage(),
|
||||
'_package_' => strtolower($configuration->getPackage()),
|
||||
'_package_' => RectorStrings::camelCaseToDashes($configuration->getPackage()),
|
||||
'_Category_' => $configuration->getCategory(),
|
||||
'_Description_' => $configuration->getDescription(),
|
||||
'_Name_' => $configuration->getName(),
|
||||
|
|
Loading…
Reference in New Issue
Block a user