-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
RoleHierarchyInterface doesn't contain any methods. #31814
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
Comments
Adding the method as PHP code will be done in Symfony 5. But you can already find its signature in the docblock:
|
So for now old method removed instead of to be marked as deprecated. I've got the next error in PHPUnit tests. And, as I understand, there is no other methods that could be used and exists in this interface. |
Why this method has been already removed? |
#30388 (comment) contains some more information |
Removing a method from an interface is a BC break. It causes exceptions such as:
|
That's only an issue for mocks, not for real code. No bug here to me. |
For what it worth, I stop mocking |
Mocking is just one of the ways that the problem would manifest itself. Consider this, it was a real method defined on the interface before, as far as PHP is concerned. In other words, causing the return value of |
Adding a new method that only exists in PHPDoc |
According to https://symfony.com/doc/current/contributing/code/bc.html#changing-interfaces @teohhanhui is right. |
I think we can close this as it's solved in 5.0 and people shouldn't need to mock the interface as explained in #31814 (comment) |
Symfony version(s) affected: 4.3
Description
RoleHierarchyInterface doesn't contain any methods.
Comment said "The getReachableRoles(Role[] $roles) method that returns an array of all reachable Role objects is deprecated
since Symfony 4.3."
And we should use method "getReachableRoleNames" or something else.
BUT RoleHierarchyInterface is empty.
I couldn't make a mock from it.
The text was updated successfully, but these errors were encountered: