generated from Potter/Template
init
This commit is contained in:
@@ -13,4 +13,6 @@ interface DispatcherAwareInterface extends BaseDispatcherAwareInterface, AwareIn
|
|||||||
public function eventDispatcher(): BaseDispatcher;
|
public function eventDispatcher(): BaseDispatcher;
|
||||||
public function hasEventDispatcher(): bool;
|
public function hasEventDispatcher(): bool;
|
||||||
public function useEventDispatcher(BaseDispatcher $dispatcher): void;
|
public function useEventDispatcher(BaseDispatcher $dispatcher): void;
|
||||||
|
public function withEventDispatcher(BaseDispatcher $dispatcher): static;
|
||||||
|
public function withoutEventDispatcher(): static;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,16 @@ trait DispatcherAwareTrait
|
|||||||
return $this->has(self::DISPATCHER);
|
return $this->has(self::DISPATCHER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final public function withEventDispatcher(BaseDispatcher $dispatcher): static
|
||||||
|
{
|
||||||
|
return $this->with(self::DISPATCHER, $dispatcher);
|
||||||
|
}
|
||||||
|
|
||||||
|
final public function withoutEventDispatcher(): static
|
||||||
|
{
|
||||||
|
return $this->without(self::DISPATCHER);
|
||||||
|
}
|
||||||
|
|
||||||
abstract public function get(string $key): mixed;
|
abstract public function get(string $key): mixed;
|
||||||
abstract public function has(string $key): mixed;
|
abstract public function has(string $key): mixed;
|
||||||
abstract protected function set(string $key, mixed $value): mixed;
|
abstract protected function set(string $key, mixed $value): mixed;
|
||||||
|
|||||||
Reference in New Issue
Block a user