-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Subscribers can have same argument defined explicitly
- Loading branch information
1 parent
616b598
commit a85bd6f
Showing
4 changed files
with
92 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
tests/KdybyTests/Events/config/subscribersWithSameArgument.neon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
events: | ||
optimize: no | ||
validate: no | ||
autowire: no | ||
subscribers: | ||
- KdybyTests\Events\EventListenerConstructorMock(@routerFactory) | ||
- KdybyTests\Events\EventListenerConstructorMock2(@routerFactory) | ||
|
||
services: | ||
routerFactory: KdybyTests\Events\RouterFactory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -232,6 +232,72 @@ public function onBar() | |
|
||
|
||
|
||
/** | ||
* @author Pavol Sivý <[email protected]> | ||
*/ | ||
class EventListenerConstructorMock extends Nette\Object implements Kdyby\Events\Subscriber | ||
{ | ||
|
||
public function __construct(RouterFactory $routerFactory) | ||
{ | ||
} | ||
|
||
|
||
|
||
/** | ||
* @return array | ||
*/ | ||
public function getSubscribedEvents() | ||
{ | ||
return [ | ||
'onFoo', | ||
]; | ||
} | ||
|
||
|
||
|
||
public function onFoo(EventArgsMock $args) | ||
{ | ||
// pass | ||
} | ||
|
||
} | ||
|
||
|
||
|
||
/** | ||
* @author Pavol Sivý <[email protected]> | ||
*/ | ||
class EventListenerConstructorMock2 extends Nette\Object implements Kdyby\Events\Subscriber | ||
{ | ||
|
||
public function __construct(RouterFactory $routerFactory) | ||
{ | ||
} | ||
|
||
|
||
|
||
/** | ||
* @return array | ||
*/ | ||
public function getSubscribedEvents() | ||
{ | ||
return [ | ||
'onFoo', | ||
]; | ||
} | ||
|
||
|
||
|
||
public function onFoo(EventArgsMock $args) | ||
{ | ||
// pass | ||
} | ||
|
||
} | ||
|
||
|
||
|
||
/** | ||
* @author Filip Procházka <[email protected]> | ||
*/ | ||
|