-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[Workflow] make $registry->get(Entity::class) consistent with the doctrine way (by using class name) #37883
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
[Workflow] make $registry->get(Entity::class) consistent with the doctrine way (by using class name) #37883
Changes from all commits
6966279
552e4e3
84a6d08
9c1947e
91ba63b
9e9292b
d87ba38
9c00e22
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
use Symfony\Component\Workflow\WorkflowInterface; | ||
|
||
/** | ||
* @author Carlos Pereira De Amorim <carlos@shauri.fr> | ||
* @author Andreas Kleemann <akleemann@inviqa.com> | ||
* @author Amrouche Hamza <hamza.simperfit@gmail.com> | ||
*/ | ||
|
@@ -31,6 +32,10 @@ public function __construct(string $className) | |
*/ | ||
public function supports(WorkflowInterface $workflow, object $subject): bool | ||
{ | ||
if ($subject instanceof \stdClass && property_exists($subject, 'class')) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it really worth it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. consistency is part of a good programming. Unfortunately, it is not PHP's strong suit. I'm not a big fan of this. Might not be worth it, indeed. |
||
return $subject->class === $this->className; | ||
} | ||
|
||
return $subject instanceof $this->className; | ||
} | ||
|
||
|
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 is a BC break as the class is not
final
.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.
Still a BC break.
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.
oups, I deleted my comment unintentionally.
Anyway, I'm new to this. I don't understand what kind of path you want me to take.
Should I, for example :
And that case, how can I have the consistency I am looking for (which only goes through this BC Breaks) ?