Skip to content

Conversation

crbanman
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tickets fixes #3982
License MIT
Doc PR n/a
  • fix the issue with the maxDepth parameter of the ApiSubresource not working

@crbanman
Copy link
Contributor Author

fixing...

@crbanman crbanman requested a review from soyuka January 26, 2021 22:26
@crbanman crbanman changed the title fix #3982 maxDepth property of the ApiSubresource annotation not working Fix #3982 maxDepth property of the ApiSubresource annotation not working Jan 27, 2021
*/
public function __construct($maxDepth = null)
{
if (!\is_array($maxDepth)) { // @phpstan-ignore-line
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we modify the PHPDoc?

Copy link
Member

@soyuka soyuka Jan 31, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really as we want to keep the auto documentation as we did in https://github.com/api-platform/core/blob/main/src/Annotation/ApiResource.php this happens only when using this class as a php 8 attribute

@soyuka soyuka merged commit 5c94c82 into api-platform:2.6 Jan 31, 2021
@soyuka
Copy link
Member

soyuka commented Jan 31, 2021

thanks @crbanman !

@crbanman crbanman deleted the fix/3982 branch February 5, 2021 22:32
cacahouwete pushed a commit to cacahouwete/core that referenced this pull request Feb 8, 2021
…ion not working (api-platform#3986)

* fix api-platform#3982 maxDepth property of the ApiSubresource annotation not working

* always pass array to hydrateAttributes()

* add test for ApiSubresource and further align with other annotations with same trait

* remove AttributesHydratorTrait

* handle null case

* remove array type from $maxDepth parameter and changed constructor structure to appease phpstan

* have phpstan ignore a test line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants