Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Nov 15, 2024
1 parent 726e315 commit e9dbf78
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,7 @@ parameters:
-
message: '#Cannot call method format\(\) on Carbon\\Carbon\|null#'
path: src/Controller/Stats/FindRuleStatsController.php

-
message: '#Call to an undefined method Rector\\Contract\\Rector\\RectorInterface\:\:getRuleDefinition\(\)#'
path: src/FileSystem/RectorFinder.php
5 changes: 5 additions & 0 deletions src/FileSystem/RectorFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ private function findInDirectoriesAndCreateRuleMetadatas(array $directories, arr

$rector = $rectorReflectionClass->newInstanceWithoutConstructor();

// only list rules with rule definition
if (! method_exists($rector, 'getRuleDefinition')) {
continue;
}

/** @var RectorInterface $rector */
$ruleDefinition = $rector->getRuleDefinition();
$ruleDefinition->setRuleClass($rectorClass);
Expand Down

0 comments on commit e9dbf78

Please sign in to comment.