on('exit', function () use ($object) { $this->detach($object); }); parent::attach($object, $info); $this->emit(self::ON_ATTACHED, [$object]); } #[\ReturnTypeWillChange] public function detach($object) { parent::detach($object); $this->emit(self::ON_DETACHED, [$object]); } }