Пример #1
0
 /**
  * @param string $className
  * @param string $methodName
  * @param Factory $factory <-
  */
 public function __construct($className, $methodName, Factory $factory)
 {
     parent::__construct(self::asClass($className, $methodName), $factory);
     $this->method = new \ReflectionMethod($className, $methodName);
     $this->createClassDefinition();
     $this->setName(ucfirst(preg_replace('/([a-z])([A-Z])/', '$1 $2', $this->method->getShortName())));
 }
Пример #2
0
 /**
  * @param string $class
  * @param callable|object|string $handler
  * @param null|callable $predicate
  * @param null|callable $arguments
  * @return GenericActionRepresenter
  */
 public function addAction($class, $handler, $predicate = null, $arguments = null)
 {
     $representer = new GenericActionRepresenter($class, $this->factory);
     $representer->setHandler($handler);
     return $this->add($representer, $predicate, $arguments);
 }
 private function whenIGetTheFieldsOf($actionClass)
 {
     $representer = new GenericActionRepresenter($actionClass, $this->factory);
     $this->fields = $representer->getFields($representer->create());
 }