{$method}(); } else if (method_exists($this, $name)) { return $this->{$name}; } else { throw new Exception('Unable getting property ' . get_called_class() . '::' . $name); } } /** * @param string $name * @param $value * @return void * @throws */ public function __set(string $name, $value): void { $method = 'set' . ucfirst($name); if (method_exists($this, $method)) { $this->{$method}($value); } else if (method_exists($this, $name)) { $this->{$name} = $value; } else { throw new Exception('Unable setting property ' . get_called_class() . '::' . $name); } } /** * @return EventDispatch */ public function getDispatch(): EventDispatch { return Kiri::getDi()->get(EventDispatch::class); } /** * @return EventProvider */ public function getProvider(): EventProvider { return Kiri::getDi()->get(EventProvider::class); } /** * @return ContainerInterface */ public function getContainer(): ContainerInterface { return Kiri::getDi(); } }