Working draft for Event subsystem - #1
Conversation
cc93935 to
da1afec
Compare
|
|
||
| public function is(Type $other): bool | ||
| { | ||
| return $other->asString() === $this->asString(); |
There was a problem hiding this comment.
This seems prone to collision with other types.
Maybe change to get_class($other) === get_class($this) && $other->asString() === $this->asString()?
Note that in PHP the object has access to the $name property of $other since it's in the same class, so this would also work:
return get_class($other) === get_class($this) && $other->name === $this->name;
There was a problem hiding this comment.
As this class will vanish (see below), this point is probably mute.
Regarding property access: Yes, we are aware of that but I consider it bad software design. The asString is part of the public API, the existence of the property name is a (private) implementation detail.
| { | ||
| public static function type(Type $type): self | ||
| { | ||
| return new self(\sprintf('Type "%s" not supported', $type->asString())); |
There was a problem hiding this comment.
I would add the class name of the subscriber here to create a bit of context: Event subscriber "Foo\Bar\BazSubscriber" does not support events of type "blah"
There was a problem hiding this comment.
Good idea.
Even though this should technically be almost impossible to ever trigger, given that the dispatcher uses the same method to find out what types of events to send to this subscriber.
|
Really awesome that you're implementing this 👍 🚀 |
bb76c8e to
0c15889
Compare
Codecov Report
@@ Coverage Diff @@
## master #1 +/- ##
============================================
+ Coverage 83.56% 84.18% +0.61%
- Complexity 4501 4733 +232
============================================
Files 218 260 +42
Lines 11030 11745 +715
============================================
+ Hits 9217 9887 +670
- Misses 1813 1858 +45
Continue to review full report at Codecov.
|
ecd9405 to
5d15372
Compare
9fd3d89 to
252d6f3
Compare
Co-authored-by: Andreas Möller <[email protected]> Co-authored-by: Arne Blankerts <[email protected]>
Co-authored-by: Andreas Möller <[email protected]> Co-authored-by: Arne Blankerts <[email protected]>
Fixes #68. Co-authored-by: Andreas Möller <[email protected]> Co-authored-by: Arne Blankerts <[email protected]>
Co-authored-by: Andreas Möller <[email protected]> Co-authored-by: Arne Blankerts <[email protected]>
Co-authored-by: Andreas Möller <[email protected]> Co-authored-by: Arne Blankerts <[email protected]>
Co-authored-by: Andreas Möller <[email protected]> Co-authored-by: Arne Blankerts <[email protected]>
Co-authored-by: Andreas Möller <[email protected]> Co-authored-by: Arne Blankerts <[email protected]>
Co-authored-by: Andreas Möller <[email protected]> Co-authored-by: Arne Blankerts <[email protected]>
Co-authored-by: Andreas Möller <[email protected]> Co-authored-by: Arne Blankerts <[email protected]>
Co-authored-by: Andreas Möller <[email protected]> Co-authored-by: Arne Blankerts <[email protected]>
Co-authored-by: Andreas Möller <[email protected]> Co-authored-by: Arne Blankerts <[email protected]>
Co-authored-by: Andreas Möller <[email protected]> Co-authored-by: Arne Blankerts <[email protected]>
Co-authored-by: Andreas Möller <[email protected]> Co-authored-by: Arne Blankerts <[email protected]>
Co-authored-by: Andreas Möller <[email protected]> Co-authored-by: Arne Blankerts <[email protected]>
Co-authored-by: Andreas Möller <[email protected]> Co-authored-by: Arne Blankerts <[email protected]>
Co-authored-by: Andreas Möller <[email protected]> Co-authored-by: Arne Blankerts <[email protected]>
Co-authored-by: Andreas Möller <[email protected]> Co-authored-by: Arne Blankerts <[email protected]>
Co-authored-by: Andreas Möller <[email protected]> Co-authored-by: Arne Blankerts <[email protected]>
Co-authored-by: Andreas Möller <[email protected]> Co-authored-by: Arne Blankerts <[email protected]>
Co-authored-by: Andreas Möller <[email protected]> Co-authored-by: Arne Blankerts <[email protected]>
Co-authored-by: Andreas Möller <[email protected]> Co-authored-by: Arne Blankerts <[email protected]>
Fixes #32. Co-authored-by: Andreas Möller <[email protected]> Co-authored-by: Arne Blankerts <[email protected]>
Co-authored-by: Andreas Möller <[email protected]> Co-authored-by: Arne Blankerts <[email protected]>
Co-authored-by: Andreas Möller <[email protected]> Co-authored-by: Arne Blankerts <[email protected]>
Co-authored-by: Andreas Möller <[email protected]> Co-authored-by: Arne Blankerts <[email protected]>
Remove redundant formatter Co-authored-by: Andreas Möller <[email protected]> Co-authored-by: Arne Blankerts <[email protected]>
Co-authored-by: Andreas Möller <[email protected]> Co-authored-by: Arne Blankerts <[email protected]>
Co-authored-by: Andreas Möller <[email protected]> Co-authored-by: Arne Blankerts <[email protected]>
Co-authored-by: Andreas Möller <[email protected]> Co-authored-by: Arne Blankerts <[email protected]>
|
This PR is closed as it was merged by other means. |
This PR
phpunitBuild Status