Changing the RelativePathHelper using CLI parameter #4437
-
I found out that the checkstyle error formatter uses the simpleRelativePathHelper:
class: PHPStan\File\RelativePathHelper
factory: PHPStan\File\SimpleRelativePathHelper
arguments:
currentWorkingDirectory: %currentWorkingDirectory%
autowired: false errorFormatter.checkstyle:
class: PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter
arguments:
relativePathHelper: @simpleRelativePathHelper I am executing phpstan for a subdirectory and encountered paths starting from the parent directory. Unfortunately that is not what my codestyle report needs to look like. Changing the RelativePathHelper to the FuzzyRelativePathHelper solves the problem. relativePathHelper:
class: PHPStan\File\RelativePathHelper
factory: PHPStan\File\FuzzyRelativePathHelper
arguments:
currentWorkingDirectory: %currentWorkingDirectory%
analysedPaths: %analysedPaths%
fallbackRelativePathHelper: @parentDirectoryRelativePathHelper Can I change the RelativePathHelper using any CLI command. I do not want/I can not create an additional configuration file for this case. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Changing the configuration file is the only option. You can also compose multiple configuration files using |
Beta Was this translation helpful? Give feedback.
Changing the configuration file is the only option. You can also compose multiple configuration files using
includes
: https://phpstan.org/config-reference#multiple-files