-
Notifications
You must be signed in to change notification settings - Fork 203
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
EZP-31103: Introduced strict types for ContentTypeService #2856
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.
CI is failing here
eZ/Publish/Core/MVC/Symfony/Templating/Tests/Twig/Extension/ContentExtensionTest.php
Show resolved
Hide resolved
eZ/Publish/Core/MVC/Symfony/Templating/Tests/Twig/Extension/ContentExtensionTest.php
Outdated
Show resolved
Hide resolved
eZ/Publish/Core/Persistence/Legacy/Content/Type/Gateway/DoctrineDatabase.php
Show resolved
Hide resolved
eZ/Publish/SPI/Repository/Tests/Decorator/ContentTypeServiceDecoratorTest.php
Outdated
Show resolved
Hide resolved
eZ/Publish/SPI/Repository/Tests/Decorator/ContentTypeServiceDecoratorTest.php
Outdated
Show resolved
Hide resolved
72ed141
to
15bd08e
Compare
PR rebased and updated according to @mikadamczyk code review suggestions. |
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.
As there is no way to mark this up in PR.
we have
/**
* Bulk-load Content Type objects by ids.
* @param mixed[] $contentTypeIds
*/
public function loadContentTypeList(array $contentTypeIds, array $prioritizedLanguages = []): iterable;
maybe we should also improve typehints in docs, so in that case made it * @param int[] $contentTypeIds
PR updated according to @mikadamczyk @ViniTou code review suggestions. |
eZ/Publish/Core/Persistence/Legacy/Content/Type/Gateway/DoctrineDatabase.php
Show resolved
Hide resolved
@@ -353,7 +353,7 @@ public function insertType(Type $type, $typeId = null) | |||
$q->prepare()->execute(); | |||
|
|||
if (empty($typeId)) { | |||
$typeId = $this->dbHandler->lastInsertId( | |||
$typeId = (int)$this->dbHandler->lastInsertId( |
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 one also for 7.5
@@ -130,7 +130,7 @@ public function __construct(DatabaseHandler $db, Connection $connection, MaskGen | |||
* | |||
* @param \eZ\Publish\SPI\Persistence\Content\Type\Group $group | |||
* | |||
* @return mixed Group ID | |||
* @return int Group ID | |||
*/ | |||
public function insertGroup(Group $group) |
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.
Anything stopping us now from adding return type?
public function insertGroup(Group $group) | |
public function insertGroup(Group $group): int |
Testing discovered: https://jira.ez.no/browse/EZP-31131 |
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.
Editing a Content Type form the right side menu causes exception:
Argument 1 passed to eZ\Publish\SPI\Repository\Decorator\ContentTypeServiceDecorator::loadContentTypeGroup() must be of the type int, string given, called in /Users/michalszoltysek/Projects/workspace/ez4.lh/vendor/ezsystems/ezplatform-admin-ui/src/lib/Form/DataTransformer/ContentTypeGroupTransformer.php on line 40
(editing with the "orange pencil" works fine)
FYI: The issue mentioned above has been fixed in ezsystems/ezplatform-admin-ui#1133 |
Testing discovered: https://jira.ez.no/browse/EZEE-2930 |
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.
Regression suite OK.
Sanities OK.
Above issue is fixed.
e0081b0
to
c6b76e2
Compare
master
This PR introduces strict types for the
\eZ\Publish\API\Repository\ContentTypeService
TODO:
$ composer fix-cs
).