-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[FrameworkBundle] fix yaml:lint when yaml is not installed along side framework-bundle #20066
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
50c6de0 to
8fe497c
Compare
| parent::configure(); | ||
| $this->setName('lint:yaml'); | ||
|
|
||
| if (!$this->isEnabled() && null !== $this->command) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this? configure() should never be called if the command is not enabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is needed as configure() is called by the constructor.
| private $directoryIteratorProvider; | ||
| private $isReadableProvider; | ||
|
|
||
| public function __construct($name = null, $directoryIteratorProvider = null, $isReadableProvider = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't $directoryIteratorProvider and $isReadableProvider be type-hinted as callable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They could
| } | ||
|
|
||
| return parent::getDirectoryIterator($directory); | ||
| return class_exists('Symfony\Component\Yaml\Command\LintCommand') && parent::isEnabled(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be class_exists(BaseLintCommand::class)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
8fe497c to
6d3e5d0
Compare
…de framwork-bundle
6d3e5d0 to
b1c5a68
Compare
… along side framework-bundle (fabpot) This PR was merged into the 3.2-dev branch. Discussion ---------- [FrameworkBundle] fix yaml:lint when yaml is not installed along side framework-bundle | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a YAML is not an explicit dependency of FrameworkBundle. If it is not installed, the console is broken as the yaml:lint commands tries to extends the one in the YAML component. This bug only exists in master as this refactoring happened in 3.2 Commits ------- b1c5a68 [FrameworkBundle] fixed yaml:lint when yaml is not installed along side framwork-bundle
YAML is not an explicit dependency of FrameworkBundle. If it is not installed, the console is broken as the yaml:lint commands tries to extends the one in the YAML component. This bug only exists in master as this refactoring happened in 3.2