-
Notifications
You must be signed in to change notification settings - Fork 3
IBX-9727: Added missing strict types #188
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
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.
The following symbols are missing type hints:
\Ibexa\Rest\Input\FieldTypeParser::parseValidatorConfiguration- \Ibexa\Rest\Input\Handler\Xml::$fieldTypeHashElements
- \Ibexa\Rest\Server\Service\RootResourceBuilderInterface::buildRootResource
- \Ibexa\Rest\Server\Output\ValueObjectVisitor\Section::visitSectionAttributes
- \Ibexa\Rest\Server\Output\ValueObjectVisitor\UserSession::visitUserSessionAttributes
- \Ibexa\Bundle\Rest\DependencyInjection\Compiler\InputHandlerPass::INPUT_HANDLER_SERVICE_TAG
|
Resolved in cfe0d72 |
|
|
||
| /** @var mixed|null */ | ||
| private $valueObject = null; | ||
| private mixed $valueObject = 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.
Q: Is it really mixed, not object?
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.
| * @param \Ibexa\Rest\Server\Values\CreatedPolicy $data | ||
| */ | ||
| public function visit(Visitor $visitor, Generator $generator, $data): void | ||
| public function visit(Visitor $visitor, Generator $generator, mixed $data): void |
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.
So after my suggestion for src/lib/Server/Output/ValueObjectVisitor/Policy.php this one pops up for PHPStan, but I think strict types help us here uncover composition bug. CreatedPolicy extends ValueObject and has inner Policy object as a composition. Therefore CreatedPolicy extends Policy is incorrect - Policy visitor should also be a composition.
See also that in src/bundle/Resources/config/value_object_visitors.yml:431 parent for CreatePolicy is set to ValueObjectVisitor, not Policy - which IMO is correct, the implementation needs not to extend Policy.
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.
Indeed, should be better now: 213a5f9
|


Description:
For QA:
Documentation: