Skip to content
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

Avoid hasChildren deprecation #1090

Merged
merged 1 commit into from
Jul 28, 2022
Merged

Avoid hasChildren deprecation #1090

merged 1 commit into from
Jul 28, 2022

Conversation

jordisala1991
Copy link
Member

@jordisala1991 jordisala1991 commented Jul 26, 2022

Subject

I am targeting this branch, because this is BC.

Changelog

### Fixed
- Avoid deprecation for the `hasChildren` method.

VincentLanglet
VincentLanglet previously approved these changes Jul 26, 2022
@VincentLanglet
Copy link
Member

VincentLanglet commented Jul 26, 2022

Since we're rely on the fact we're iterating on Blocks, I removed the @phpstan-template T on 5.x
see https://github.com/sonata-project/SonataBlockBundle/blob/5.x/src/Util/RecursiveBlockIterator.php#L22

@jordisala1991
Copy link
Member Author

sad I will need to open the code to fix this... tomorrow then.

VincentLanglet
VincentLanglet previously approved these changes Jul 27, 2022
@@ -199,7 +199,7 @@ public function addChildren(BlockInterface $children): void
$children->setParent($this);
}

public function getChildren(): iterable
public function getChildren()
Copy link
Member Author

Choose a reason for hiding this comment

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

Had to change this to fix phpstan

*/
public function getChildren(): iterable;
public function getChildren();
Copy link
Member Author

Choose a reason for hiding this comment

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

And this.

Copy link
Member

Choose a reason for hiding this comment

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

I think you can keep the return type.

public function getChildren(): iterable;

Copy link
Member Author

Choose a reason for hiding this comment

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

It breaks phpstan.

*/
public function getChildren(): iterable;
public function getChildren();
Copy link
Member

Choose a reason for hiding this comment

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

I think you can keep the return type.

public function getChildren(): iterable;

@VincentLanglet VincentLanglet merged commit 1da30bd into 4.x Jul 28, 2022
@VincentLanglet VincentLanglet deleted the jordisala1991-patch-1 branch July 28, 2022 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants