Inspired from https://github.com/Kdyby/Events/pull/112 Adapted for 3.1.0 diff -ru events-f63b92eaf75df33d0a449af80de8e9f1d85dd6f6/src/Events/Diagnostics/Panel.php events-ok/src/Events/Diagnostics/Panel.php --- events-f63b92eaf75df33d0a449af80de8e9f1d85dd6f6/src/Events/Diagnostics/Panel.php 2017-05-15 09:03:49.000000000 +0200 +++ events-ok/src/Events/Diagnostics/Panel.php 2017-11-09 09:34:58.352160330 +0100 @@ -26,8 +26,9 @@ /** * @author Filip Procházka */ -class Panel extends Nette\Object implements Tracy\IBarPanel +class Panel implements Tracy\IBarPanel { + use \Nette\SmartObject; /** * @var EventManager diff -ru events-f63b92eaf75df33d0a449af80de8e9f1d85dd6f6/src/Events/LifeCycleEvent.php events-ok/src/Events/LifeCycleEvent.php --- events-f63b92eaf75df33d0a449af80de8e9f1d85dd6f6/src/Events/LifeCycleEvent.php 2017-05-15 09:03:49.000000000 +0200 +++ events-ok/src/Events/LifeCycleEvent.php 2017-11-09 09:34:44.207084241 +0100 @@ -15,8 +15,9 @@ /** * @author Filip Procházka */ -final class LifeCycleEvent extends Nette\Object +final class LifeCycleEvent { + use \Nette\SmartObject; /** * Occurs before the application loads presenter diff -ru events-f63b92eaf75df33d0a449af80de8e9f1d85dd6f6/src/Events/SymfonyDispatcher.php events-ok/src/Events/SymfonyDispatcher.php --- events-f63b92eaf75df33d0a449af80de8e9f1d85dd6f6/src/Events/SymfonyDispatcher.php 2017-05-15 09:03:49.000000000 +0200 +++ events-ok/src/Events/SymfonyDispatcher.php 2017-11-09 09:34:31.340015026 +0100 @@ -26,8 +26,9 @@ /** * @author Filip Procházka */ -class SymfonyDispatcher extends Nette\Object implements EventDispatcherInterface +class SymfonyDispatcher implements EventDispatcherInterface { + use \Nette\SmartObject; /** * @var EventManager diff -ru events-f63b92eaf75df33d0a449af80de8e9f1d85dd6f6/tests/KdybyTests/Events/mocks.php events-ok/tests/KdybyTests/Events/mocks.php --- events-f63b92eaf75df33d0a449af80de8e9f1d85dd6f6/tests/KdybyTests/Events/mocks.php 2017-05-15 09:03:49.000000000 +0200 +++ events-ok/tests/KdybyTests/Events/mocks.php 2017-11-09 09:32:48.112459742 +0100 @@ -24,8 +24,9 @@ * @method onMagic(FooMock $foo, $int) * @method onStartup(FooMock $foo, $int) */ -class FooMock extends Nette\Object +class FooMock { + use \Nette\SmartObject; /** * @var array|callable[]|Event @@ -71,8 +72,9 @@ /** * @author Filip Procházka */ -class LoremListener extends Nette\Object implements Kdyby\Events\Subscriber +class LoremListener implements Kdyby\Events\Subscriber { + use \Nette\SmartObject; public $calls = []; @@ -165,8 +167,9 @@ /** * @author Filip Procházka */ -class EventListenerMock extends Nette\Object implements Kdyby\Events\Subscriber +class EventListenerMock implements Kdyby\Events\Subscriber { + use \Nette\SmartObject; public $calls = []; @@ -204,8 +207,9 @@ /** * @author Filip Procházka */ -class EventListenerMock2 extends Nette\Object implements Kdyby\Events\Subscriber +class EventListenerMock2 implements Kdyby\Events\Subscriber { + use \Nette\SmartObject; /** * @return array @@ -235,8 +239,9 @@ /** * @author Pavol Sivý */ -class EventListenerConstructorMock extends Nette\Object implements Kdyby\Events\Subscriber +class EventListenerConstructorMock implements Kdyby\Events\Subscriber { + use \Nette\SmartObject; public function __construct(RouterFactory $routerFactory) { @@ -268,8 +273,9 @@ /** * @author Pavol Sivý */ -class EventListenerConstructorMock2 extends Nette\Object implements Kdyby\Events\Subscriber +class EventListenerConstructorMock2 implements Kdyby\Events\Subscriber { + use \Nette\SmartObject; public function __construct(RouterFactory $routerFactory) { @@ -299,8 +305,9 @@ /** * @author Filip Procházka */ -class MagicEventListenerMock extends Nette\Object implements Kdyby\Events\CallableSubscriber +class MagicEventListenerMock implements Kdyby\Events\CallableSubscriber { + use \Nette\SmartObject; public $calls = []; @@ -329,8 +336,9 @@ /** * @author Filip Procházka */ -class NamespacedEventListenerMock extends Nette\Object implements Kdyby\Events\Subscriber +class NamespacedEventListenerMock implements Kdyby\Events\Subscriber { + use \Nette\SmartObject; public $calls = []; @@ -359,8 +367,9 @@ /** * @author Filip Procházka */ -class MethodAliasListenerMock extends Nette\Object implements Kdyby\Events\Subscriber +class MethodAliasListenerMock implements Kdyby\Events\Subscriber { + use \Nette\SmartObject; public $calls = []; @@ -389,8 +398,9 @@ /** * @author Filip Procházka */ -class PriorityMethodAliasListenerMock extends Nette\Object implements Kdyby\Events\Subscriber +class PriorityMethodAliasListenerMock implements Kdyby\Events\Subscriber { + use \Nette\SmartObject; public $calls = []; @@ -419,8 +429,9 @@ /** * @author Filip Procházka */ -class HigherPriorityMethodAliasListenerMock extends Nette\Object implements Kdyby\Events\Subscriber +class HigherPriorityMethodAliasListenerMock implements Kdyby\Events\Subscriber { + use \Nette\SmartObject; public $calls = []; @@ -449,8 +460,9 @@ /** * @author Filip Procházka */ -class MultipleEventMethodsListenerMock extends Nette\Object implements Kdyby\Events\Subscriber +class MultipleEventMethodsListenerMock implements Kdyby\Events\Subscriber { + use \Nette\SmartObject; public $calls = []; @@ -490,8 +502,9 @@ /** * @author Filip Procházka */ -class CustomNamespacedEventListenerMock extends Nette\Object implements Kdyby\Events\Subscriber +class CustomNamespacedEventListenerMock implements Kdyby\Events\Subscriber { + use \Nette\SmartObject; public $calls = []; @@ -520,8 +533,9 @@ /** * @author Filip Procházka */ -class FirstInvalidListenerMock extends Nette\Object implements Kdyby\Events\Subscriber +class FirstInvalidListenerMock implements Kdyby\Events\Subscriber { + use \Nette\SmartObject; /** * @return array @@ -540,8 +554,9 @@ /** * @author Filip Procházka */ -class SecondInvalidListenerMock extends Nette\Object implements Kdyby\Events\Subscriber +class SecondInvalidListenerMock implements Kdyby\Events\Subscriber { + use \Nette\SmartObject; /** * @return array @@ -557,8 +572,9 @@ -class ListenerWithoutInterface extends Nette\Object +class ListenerWithoutInterface { + use \Nette\SmartObject; public $calls = []; @@ -571,8 +587,9 @@ -class RouterFactory extends Nette\Object +class RouterFactory { + use \Nette\SmartObject; /** * @return \KdybyTests\Events\SampleRouter @@ -610,8 +627,10 @@ -class ParentClass extends Nette\Object +class ParentClass { + use \Nette\SmartObject; + public $onCreate = []; public function create($arg = NULL) { @@ -764,8 +783,9 @@ -class DispatchOrderMock extends Nette\Object +class DispatchOrderMock { + use \Nette\SmartObject; /** * @globalDispatchFirst