From 7ec035d09a09bd799aab3e22cd17ee6c332123cb Mon Sep 17 00:00:00 2001 From: David Grudl Date: Tue, 2 Mar 2021 14:53:14 +0100 Subject: [PATCH] Component: deprecated attached & detached are final --- src/ComponentModel/Component.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/ComponentModel/Component.php b/src/ComponentModel/Component.php index b3af3df..e4adb34 100644 --- a/src/ComponentModel/Component.php +++ b/src/ComponentModel/Component.php @@ -90,11 +90,6 @@ final public function lookupPath(?string $type = null, bool $throw = true): ?str */ final public function monitor(string $type, ?callable $attached = null, ?callable $detached = null): void { - if (func_num_args() === 1) { - $attached = [$this, 'attached']; - $detached = [$this, 'detached']; - } - if ( ($obj = $this->lookup($type, throw: false)) && $attached @@ -121,7 +116,7 @@ final public function unmonitor(string $type): void * becomes attached to a monitored object. Do not call this method yourself. * @deprecated use monitor($type, $attached) */ - protected function attached(IComponent $obj): void + final protected function attached(IComponent $obj): void { } @@ -131,7 +126,7 @@ protected function attached(IComponent $obj): void * becomes detached from a monitored object. Do not call this method yourself. * @deprecated use monitor($type, null, $detached) */ - protected function detached(IComponent $obj): void + final protected function detached(IComponent $obj): void { }