예제 #1
0
 /**
  *
  */
 function test_plugin()
 {
     $this->setExpectedException(\RuntimeException::class, 'Unresolvable plugin: foo');
     Unresolvable::plugin('foo');
 }
예제 #2
0
파일: Resolver.php 프로젝트: mvc5/framework
 /**
  * @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));
 }
예제 #3
0
 /**
  * @param string $name
  * @return array|\Traversable|null
  */
 protected function listeners($name)
 {
     return isset($this->events[$name]) ? $this->events[$name] : Unresolvable::plugin($name);
 }
예제 #4
0
파일: Generator.php 프로젝트: mvc5/mvc5
 /**
  * @param string $name
  * @return array|\Traversable|null
  */
 protected function listeners($name)
 {
     return $this->events[$name] ?? Unresolvable::plugin($name);
 }