-
Notifications
You must be signed in to change notification settings - Fork 1
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
[CI] Added phpstan #60
Conversation
7ec0987
to
0653c34
Compare
@@ -272,6 +272,9 @@ private static function getStability(ComposerSystemInfo $composerInfo): string | |||
return Stability::STABILITIES[$stabilityFlag]; | |||
} | |||
|
|||
/** | |||
* @param list<string> $packageNames |
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.
Why not array?
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.
Beacuse I do not know if it is int or string indexed, and it dosent matter for this function. List is just less hustle.
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.
Actually...
list<X>
is basically equal to array<int, X>
, with added assumption that keys will be always incrementing by 1. So it is in fact more narrow than array
.
But yes, it should not matter in this context.
@@ -146,7 +146,7 @@ class IbexaSystemInfoCollector implements SystemInfoCollector | |||
private $kernelProjectDir; | |||
|
|||
/** | |||
* @param \Ibexa\Bundle\SystemInfo\SystemInfo\Collector\JsonComposerLockSystemInfoCollector|\Ibexa\Bundle\SystemInfo\SystemInfo\Collector\SystemInfoCollector $composerCollector | |||
* @param \Ibexa\Bundle\SystemInfo\SystemInfo\Collector\JsonComposerLockSystemInfoCollector|SystemInfoCollector $composerCollector |
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.
FQCN was removed by accident.
* @param \Ibexa\Bundle\SystemInfo\SystemInfo\Collector\JsonComposerLockSystemInfoCollector|SystemInfoCollector $composerCollector | |
* @param \Ibexa\Bundle\SystemInfo\SystemInfo\Collector\JsonComposerLockSystemInfoCollector|\Ibexa\Bundle\SystemInfo\SystemInfo\Collector\SystemInfoCollector $composerCollector |
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.
I wonder if that even make much sense to have \Ibexa\Bundle\SystemInfo\SystemInfo\Collector\JsonComposerLockSystemInfoCollector
here, as it is implementation of \Ibexa\Bundle\SystemInfo\SystemInfo\Collector\SystemInfoCollector
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.
If one is an interface that the other implements, then implementation can be removed from declaration.
use PHPUnit\Framework\TestCase; | ||
|
||
class SystemInfoViewBuilderTest extends TestCase | ||
{ | ||
private $configuratorMock; | ||
private Configurator $configuratorMock; |
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.
This should be more specific to what actually is inside, and fix on of the still reported PHPStan issues:
private Configurator $configuratorMock; | |
/** @var \PHPUnit\Framework\MockObject\MockObject&\Ibexa\Core\MVC\Symfony\View\Configurator */ | |
private Configurator $configuratorMock; |
Similar thing can be done for registry and collector mocks.
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.
yeah, I wanted to do proper union type in main. I can add this atm as well tho.
Quality Gate passedIssues Measures |
Description:
For QA:
Documentation: