From 4d19975daea67d6c6e84cd7ed9b270654ce253de Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Tue, 19 Jul 2022 23:57:25 +0200 Subject: [PATCH 1/4] extend dead-code set --- utils/Command/MissingInSetCommand.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/utils/Command/MissingInSetCommand.php b/utils/Command/MissingInSetCommand.php index bcc27f44967..7958e3c605c 100644 --- a/utils/Command/MissingInSetCommand.php +++ b/utils/Command/MissingInSetCommand.php @@ -55,8 +55,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int continue; } +<<<<<<< HEAD $setRealpath = (string) realpath($setFile); $relativeFilePath = Strings::after($setRealpath, getcwd() . '/'); +======= + $setRealpath = realpath($setFile); + $relativeFilePath= Strings::after($setRealpath, getcwd() . '/'); +>>>>>>> extend dead-code set $title = sprintf('In "%s" config we could not find', $relativeFilePath); $this->symfonyStyle->title($title); From 552d885b6515afe426439257028496e50f511efd Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Wed, 20 Jul 2022 00:03:33 +0200 Subject: [PATCH 2/4] extend coding style set --- utils/Command/MissingInSetCommand.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/utils/Command/MissingInSetCommand.php b/utils/Command/MissingInSetCommand.php index 7958e3c605c..f84144f1b61 100644 --- a/utils/Command/MissingInSetCommand.php +++ b/utils/Command/MissingInSetCommand.php @@ -55,6 +55,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int continue; } +<<<<<<< HEAD <<<<<<< HEAD $setRealpath = (string) realpath($setFile); $relativeFilePath = Strings::after($setRealpath, getcwd() . '/'); @@ -62,6 +63,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int $setRealpath = realpath($setFile); $relativeFilePath= Strings::after($setRealpath, getcwd() . '/'); >>>>>>> extend dead-code set +======= + $setRealpath = (string) realpath($setFile); + $relativeFilePath = Strings::after($setRealpath, getcwd() . '/'); +>>>>>>> extend coding style set $title = sprintf('In "%s" config we could not find', $relativeFilePath); $this->symfonyStyle->title($title); From f1b72f2ba83211f949062daa876c43df5320280a Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Wed, 20 Jul 2022 00:19:27 +0200 Subject: [PATCH 3/4] Remove UnwrapFutureCompatibleIfFunctionExistsRector --- config/set/dead-code.php | 2 - config/set/unwrap-compat.php | 10 -- .../Fixture/fixture.php.inc | 41 ------ ...reCompatibleIfFunctionExistsRectorTest.php | 33 ----- .../config/configured_rule.php | 10 -- .../FunctionSupportResolver.php | 51 -------- ...FutureCompatibleIfFunctionExistsRector.php | 123 ------------------ 7 files changed, 270 deletions(-) delete mode 100644 config/set/unwrap-compat.php delete mode 100644 rules-tests/DeadCode/Rector/If_/UnwrapFutureCompatibleIfFunctionExistsRector/Fixture/fixture.php.inc delete mode 100644 rules-tests/DeadCode/Rector/If_/UnwrapFutureCompatibleIfFunctionExistsRector/UnwrapFutureCompatibleIfFunctionExistsRectorTest.php delete mode 100644 rules-tests/DeadCode/Rector/If_/UnwrapFutureCompatibleIfFunctionExistsRector/config/configured_rule.php delete mode 100644 rules/DeadCode/FeatureSupport/FunctionSupportResolver.php delete mode 100644 rules/DeadCode/Rector/If_/UnwrapFutureCompatibleIfFunctionExistsRector.php diff --git a/config/set/dead-code.php b/config/set/dead-code.php index 7e08dca3b6c..a2ac6c655fe 100644 --- a/config/set/dead-code.php +++ b/config/set/dead-code.php @@ -35,7 +35,6 @@ use Rector\DeadCode\Rector\If_\RemoveDeadInstanceOfRector; use Rector\DeadCode\Rector\If_\RemoveUnusedNonEmptyArrayBeforeForeachRector; use Rector\DeadCode\Rector\If_\SimplifyIfElseWithSameContentRector; -use Rector\DeadCode\Rector\If_\UnwrapFutureCompatibleIfFunctionExistsRector; use Rector\DeadCode\Rector\If_\UnwrapFutureCompatibleIfPhpVersionRector; use Rector\DeadCode\Rector\MethodCall\RemoveEmptyMethodCallRector; use Rector\DeadCode\Rector\Node\RemoveNonExistingVarAnnotationRector; @@ -55,7 +54,6 @@ return static function (RectorConfig $rectorConfig): void { $rectorConfig->rules([ - UnwrapFutureCompatibleIfFunctionExistsRector::class, UnwrapFutureCompatibleIfPhpVersionRector::class, RecastingRemovalRector::class, RemoveDeadStmtRector::class, diff --git a/config/set/unwrap-compat.php b/config/set/unwrap-compat.php deleted file mode 100644 index 8530bc77f62..00000000000 --- a/config/set/unwrap-compat.php +++ /dev/null @@ -1,10 +0,0 @@ -rule(UnwrapFutureCompatibleIfFunctionExistsRector::class); -}; diff --git a/rules-tests/DeadCode/Rector/If_/UnwrapFutureCompatibleIfFunctionExistsRector/Fixture/fixture.php.inc b/rules-tests/DeadCode/Rector/If_/UnwrapFutureCompatibleIfFunctionExistsRector/Fixture/fixture.php.inc deleted file mode 100644 index bb06e0ca770..00000000000 --- a/rules-tests/DeadCode/Rector/If_/UnwrapFutureCompatibleIfFunctionExistsRector/Fixture/fixture.php.inc +++ /dev/null @@ -1,41 +0,0 @@ - ------ - diff --git a/rules-tests/DeadCode/Rector/If_/UnwrapFutureCompatibleIfFunctionExistsRector/UnwrapFutureCompatibleIfFunctionExistsRectorTest.php b/rules-tests/DeadCode/Rector/If_/UnwrapFutureCompatibleIfFunctionExistsRector/UnwrapFutureCompatibleIfFunctionExistsRectorTest.php deleted file mode 100644 index 8a30e7bb37c..00000000000 --- a/rules-tests/DeadCode/Rector/If_/UnwrapFutureCompatibleIfFunctionExistsRector/UnwrapFutureCompatibleIfFunctionExistsRectorTest.php +++ /dev/null @@ -1,33 +0,0 @@ -doTestFileInfo($fileInfo); - } - - /** - * @return Iterator - */ - public function provideData(): Iterator - { - return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture'); - } - - public function provideConfigFilePath(): string - { - return __DIR__ . '/config/configured_rule.php'; - } -} diff --git a/rules-tests/DeadCode/Rector/If_/UnwrapFutureCompatibleIfFunctionExistsRector/config/configured_rule.php b/rules-tests/DeadCode/Rector/If_/UnwrapFutureCompatibleIfFunctionExistsRector/config/configured_rule.php deleted file mode 100644 index 8530bc77f62..00000000000 --- a/rules-tests/DeadCode/Rector/If_/UnwrapFutureCompatibleIfFunctionExistsRector/config/configured_rule.php +++ /dev/null @@ -1,10 +0,0 @@ -rule(UnwrapFutureCompatibleIfFunctionExistsRector::class); -}; diff --git a/rules/DeadCode/FeatureSupport/FunctionSupportResolver.php b/rules/DeadCode/FeatureSupport/FunctionSupportResolver.php deleted file mode 100644 index c6b3bb07b53..00000000000 --- a/rules/DeadCode/FeatureSupport/FunctionSupportResolver.php +++ /dev/null @@ -1,51 +0,0 @@ - - */ - private const FUNCTIONS_BY_VERSION = [ - PhpVersion::PHP_56 => ['session_abort', 'hash_equals', 'ldap_escape'], - PhpVersion::PHP_70 => [ - 'random_int', - 'random_bytes', - 'intdiv', - 'preg_replace_callback_array', - 'error_clear_last', - ], - PhpVersion::PHP_71 => ['is_iterable'], - PhpVersion::PHP_72 => ['spl_object_id', 'stream_isatty'], - PhpVersion::PHP_73 => ['array_key_first', 'array_key_last', 'hrtime', 'is_countable'], - PhpVersion::PHP_74 => ['get_mangled_object_vars', 'mb_str_split', 'password_algos'], - ]; - - public function __construct( - private readonly PhpVersionProvider $phpVersionProvider - ) { - } - - public function isFunctionSupported(string $desiredFunction): bool - { - foreach (self::FUNCTIONS_BY_VERSION as $version => $functions) { - if (! in_array($desiredFunction, $functions, true)) { - continue; - } - - if (! $this->phpVersionProvider->isAtLeastPhpVersion($version)) { - continue; - } - - return true; - } - - return false; - } -} diff --git a/rules/DeadCode/Rector/If_/UnwrapFutureCompatibleIfFunctionExistsRector.php b/rules/DeadCode/Rector/If_/UnwrapFutureCompatibleIfFunctionExistsRector.php deleted file mode 100644 index 632c3772649..00000000000 --- a/rules/DeadCode/Rector/If_/UnwrapFutureCompatibleIfFunctionExistsRector.php +++ /dev/null @@ -1,123 +0,0 @@ -> - */ - public function getNodeTypes(): array - { - return [If_::class]; - } - - /** - * @param If_ $node - * @return null|Stmt[] - */ - public function refactor(Node $node): ?array - { - if ($this->shouldSkip($node)) { - return null; - } - - $match = $this->ifManipulator->isIfOrIfElseWithFunctionCondition($node, 'function_exists'); - if (! $match) { - return null; - } - - /** @var FuncCall $funcCall */ - $funcCall = $node->cond; - - if (! isset($funcCall->args[0])) { - return null; - } - - if (! $funcCall->args[0] instanceof Arg) { - return null; - } - - $functionToExistName = $this->valueResolver->getValue($funcCall->args[0]->value); - if (! is_string($functionToExistName)) { - return null; - } - - if (! $this->functionSupportResolver->isFunctionSupported($functionToExistName)) { - return null; - } - - return $node->stmts; - } - - private function shouldSkip(If_ $if): bool - { - $classLike = $this->betterNodeFinder->findParentType($if, ClassLike::class); - if (! $classLike instanceof ClassLike) { - return false; - } - - // skip rector rules, as they decided if function exists in that particular projects - return $this->isObjectType($classLike, new ObjectType('Rector\Core\Contract\Rector\RectorInterface')); - } -} From f2a2d6794b518348de5484d1832d856332841e5a Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Wed, 20 Jul 2022 00:25:23 +0200 Subject: [PATCH 4/4] Remove FormerNullableArgumentToScalarTypedRector, as never used --- packages/Set/ValueObject/SetList.php | 5 - .../Fixture/aliased_class.php.inc | 33 ----- .../Fixture/fixture.php.inc | 31 ---- .../Fixture/former_bool.php.inc | 31 ---- .../Fixture/on_static_call.php.inc | 31 ---- .../skip_nette_form_class_call.php.inc | 20 --- .../Fixture/with_parent_method.php.inc | 31 ---- ...ullableArgumentToScalarTypedRectorTest.php | 33 ----- .../Source/NowBool.php | 12 -- .../Source/NowString.php | 12 -- .../Source/ParentMethodFormerInteger.php | 9 -- .../Source/StaticNowInteger.php | 12 -- .../config/configured_rule.php | 10 -- .../NodeTypeAnalyzer/CallTypeAnalyzer.php | 49 ------- ...merNullableArgumentToScalarTypedRector.php | 136 ------------------ utils/Command/MissingInSetCommand.php | 11 +- 16 files changed, 1 insertion(+), 465 deletions(-) delete mode 100644 rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/Fixture/aliased_class.php.inc delete mode 100644 rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/Fixture/fixture.php.inc delete mode 100644 rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/Fixture/former_bool.php.inc delete mode 100644 rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/Fixture/on_static_call.php.inc delete mode 100644 rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/Fixture/skip_nette_form_class_call.php.inc delete mode 100644 rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/Fixture/with_parent_method.php.inc delete mode 100644 rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/FormerNullableArgumentToScalarTypedRectorTest.php delete mode 100644 rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/Source/NowBool.php delete mode 100644 rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/Source/NowString.php delete mode 100644 rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/Source/ParentMethodFormerInteger.php delete mode 100644 rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/Source/StaticNowInteger.php delete mode 100644 rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/config/configured_rule.php delete mode 100644 rules/TypeDeclaration/NodeTypeAnalyzer/CallTypeAnalyzer.php delete mode 100644 rules/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector.php diff --git a/packages/Set/ValueObject/SetList.php b/packages/Set/ValueObject/SetList.php index b571c3a89af..22a643eecde 100644 --- a/packages/Set/ValueObject/SetList.php +++ b/packages/Set/ValueObject/SetList.php @@ -136,11 +136,6 @@ final class SetList implements SetListInterface */ public const TYPE_DECLARATION_STRICT = __DIR__ . '/../../../config/set/type-declaration-strict.php'; - /** - * @var string - */ - public const UNWRAP_COMPAT = __DIR__ . '/../../../config/set/unwrap-compat.php'; - /** * @var string */ diff --git a/rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/Fixture/aliased_class.php.inc b/rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/Fixture/aliased_class.php.inc deleted file mode 100644 index cf968d6ace5..00000000000 --- a/rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/Fixture/aliased_class.php.inc +++ /dev/null @@ -1,33 +0,0 @@ -setValue(null); - $nowString::setValue(null); - } -} - -?> ------ -setValue(''); - $nowString::setValue(''); - } -} - -?> diff --git a/rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/Fixture/fixture.php.inc b/rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/Fixture/fixture.php.inc deleted file mode 100644 index 9f2cd3c7a4e..00000000000 --- a/rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/Fixture/fixture.php.inc +++ /dev/null @@ -1,31 +0,0 @@ -setValue(null); - } -} - -?> ------ -setValue(''); - } -} - -?> diff --git a/rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/Fixture/former_bool.php.inc b/rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/Fixture/former_bool.php.inc deleted file mode 100644 index 906640bd830..00000000000 --- a/rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/Fixture/former_bool.php.inc +++ /dev/null @@ -1,31 +0,0 @@ -setValue(null); - } -} - -?> ------ -setValue(false); - } -} - -?> diff --git a/rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/Fixture/on_static_call.php.inc b/rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/Fixture/on_static_call.php.inc deleted file mode 100644 index 1d013914205..00000000000 --- a/rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/Fixture/on_static_call.php.inc +++ /dev/null @@ -1,31 +0,0 @@ - ------ - diff --git a/rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/Fixture/skip_nette_form_class_call.php.inc b/rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/Fixture/skip_nette_form_class_call.php.inc deleted file mode 100644 index 996c0e258bf..00000000000 --- a/rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/Fixture/skip_nette_form_class_call.php.inc +++ /dev/null @@ -1,20 +0,0 @@ -addText('reading', 'Reading') - ->setRequired('...') - ->getControlPrototype() - ->nonExistingMagic('rating'); - - return $form; - } -} diff --git a/rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/Fixture/with_parent_method.php.inc b/rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/Fixture/with_parent_method.php.inc deleted file mode 100644 index 22c760480bd..00000000000 --- a/rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/Fixture/with_parent_method.php.inc +++ /dev/null @@ -1,31 +0,0 @@ -setValue(null); - } -} - -?> ------ -setValue(0); - } -} - -?> diff --git a/rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/FormerNullableArgumentToScalarTypedRectorTest.php b/rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/FormerNullableArgumentToScalarTypedRectorTest.php deleted file mode 100644 index a8571fb3ea1..00000000000 --- a/rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/FormerNullableArgumentToScalarTypedRectorTest.php +++ /dev/null @@ -1,33 +0,0 @@ -doTestFileInfo($fileInfo); - } - - /** - * @return Iterator - */ - public function provideData(): Iterator - { - return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture'); - } - - public function provideConfigFilePath(): string - { - return __DIR__ . '/config/configured_rule.php'; - } -} diff --git a/rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/Source/NowBool.php b/rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/Source/NowBool.php deleted file mode 100644 index 8de23b712a9..00000000000 --- a/rules-tests/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector/Source/NowBool.php +++ /dev/null @@ -1,12 +0,0 @@ -rule(FormerNullableArgumentToScalarTypedRector::class); -}; diff --git a/rules/TypeDeclaration/NodeTypeAnalyzer/CallTypeAnalyzer.php b/rules/TypeDeclaration/NodeTypeAnalyzer/CallTypeAnalyzer.php deleted file mode 100644 index a45395866fb..00000000000 --- a/rules/TypeDeclaration/NodeTypeAnalyzer/CallTypeAnalyzer.php +++ /dev/null @@ -1,49 +0,0 @@ -reflectionResolver->resolveFunctionLikeReflectionFromCall($call); - if ($methodReflection === null) { - return []; - } - - $scope = $call->getAttribute(AttributeKey::SCOPE); - if (! $scope instanceof Scope) { - return []; - } - - $parametersAcceptor = ParametersAcceptorSelectorVariantsWrapper::select($methodReflection, $call, $scope); - - $parameterTypes = []; - - /** @var ParameterReflection $parameterReflection */ - foreach ($parametersAcceptor->getParameters() as $parameterReflection) { - $parameterTypes[] = $parameterReflection->getType(); - } - - return $parameterTypes; - } -} diff --git a/rules/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector.php b/rules/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector.php deleted file mode 100644 index ac1d2f41cc2..00000000000 --- a/rules/TypeDeclaration/Rector/MethodCall/FormerNullableArgumentToScalarTypedRector.php +++ /dev/null @@ -1,136 +0,0 @@ -setValue(null); - } - - public function setValue(string $value) - { - } -} -CODE_SAMPLE - , - <<<'CODE_SAMPLE' -final class SomeClass -{ - public function run() - { - $this->setValue(''); - } - - public function setValue(string $value) - { - } -} -CODE_SAMPLE - ), - ] - ); - } - - /** - * @return array> - */ - public function getNodeTypes(): array - { - return [MethodCall::class, StaticCall::class]; - } - - /** - * @param MethodCall|StaticCall $node - */ - public function refactor(Node $node): ?Node - { - if ($node->args === []) { - return null; - } - - $methodParameterTypes = $this->callTypeAnalyzer->resolveMethodParameterTypes($node); - if ($methodParameterTypes === []) { - return null; - } - - foreach ($node->args as $key => $arg) { - if (! $arg instanceof Arg) { - continue; - } - - if (! $this->valueResolver->isNull($arg->value)) { - continue; - } - - /** @var int $key */ - $this->refactorArg($arg, $methodParameterTypes, $key); - } - - return $node; - } - - /** - * @param Type[] $methodParameterTypes - */ - private function refactorArg(Arg $arg, array $methodParameterTypes, int $key): void - { - if (! isset($methodParameterTypes[$key])) { - return; - } - - $parameterType = $methodParameterTypes[$key]; - if ($parameterType instanceof StringType) { - $arg->value = new String_(''); - } - - if ($parameterType instanceof IntegerType) { - $arg->value = new LNumber(0); - } - - if ($parameterType instanceof FloatType) { - $arg->value = new DNumber(0); - } - - if ($parameterType instanceof BooleanType) { - $arg->value = $this->nodeFactory->createFalse(); - } - } -} diff --git a/utils/Command/MissingInSetCommand.php b/utils/Command/MissingInSetCommand.php index f84144f1b61..9de45d76726 100644 --- a/utils/Command/MissingInSetCommand.php +++ b/utils/Command/MissingInSetCommand.php @@ -23,6 +23,7 @@ final class MissingInSetCommand extends Command __DIR__ . '/../../config/set/dead-code.php' => __DIR__ . '/../../rules/DeadCode/Rector', __DIR__ . '/../../config/set/early-return.php' => __DIR__ . '/../../rules/EarlyReturn/Rector', __DIR__ . '/../../config/set/naming.php' => __DIR__ . '/../../rules/Naming/Rector', + __DIR__ . '/../../config/set/type-declaration.php' => __DIR__ . '/../../rules/TypeDeclaration/Rector', ]; /** @@ -55,18 +56,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int continue; } -<<<<<<< HEAD -<<<<<<< HEAD $setRealpath = (string) realpath($setFile); $relativeFilePath = Strings::after($setRealpath, getcwd() . '/'); -======= - $setRealpath = realpath($setFile); - $relativeFilePath= Strings::after($setRealpath, getcwd() . '/'); ->>>>>>> extend dead-code set -======= - $setRealpath = (string) realpath($setFile); - $relativeFilePath = Strings::after($setRealpath, getcwd() . '/'); ->>>>>>> extend coding style set $title = sprintf('In "%s" config we could not find', $relativeFilePath); $this->symfonyStyle->title($title);