Exemplo n.º 1
0
 /**
  *
  */
 function test_plugin()
 {
     $this->setExpectedException(\RuntimeException::class, 'Unresolvable plugin: foo');
     Unresolvable::plugin('foo');
 }
Exemplo n.º 2
0
 /**
  * @param $config
  * @param array $args
  * @param callable $callback
  * @param int $c
  * @return array|callable|Plugin|null|object|Resolvable|string
  */
 protected function resolvable($config, array $args = [], callable $callback = null, $c = 0)
 {
     return !$config instanceof Resolvable ? $config : ($c > Arg::MAX_RECURSION ? Unresolvable::plugin($config) : $this->resolvable($this->solve($config, $args, $callback), $args, $callback, ++$c));
 }
Exemplo n.º 3
0
 /**
  * @param string $name
  * @return array|\Traversable|null
  */
 protected function listeners($name)
 {
     return isset($this->events[$name]) ? $this->events[$name] : Unresolvable::plugin($name);
 }
Exemplo n.º 4
0
 /**
  * @param string $name
  * @return array|\Traversable|null
  */
 protected function listeners($name)
 {
     return $this->events[$name] ?? Unresolvable::plugin($name);
 }