Skip to content

Commit

Permalink
warn only about deprecated constants
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Dec 10, 2021
1 parent b3f13b5 commit fae3f77
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ private function addConfigureCallValues(string $rectorClass, array $configureVal
$constantNamesToValues = $classReflection->getConstants(ReflectionClassConstant::IS_PUBLIC);
foreach ($constantNamesToValues as $constantName => $constantValue) {
if ($constantValue === $firstKey) {
$reflectionConstant = $classReflection->getReflectionConstant($constantName);
if (! str_contains($reflectionConstant->getDocComment(), '@deprecated')) {
continue;
}

$warningMessage = sprintf(
'The constant for "%s::%s" is deprecated.%sUse "->configure()" directly instead.',
$rectorClass,
Expand Down

0 comments on commit fae3f77

Please sign in to comment.