Exemplo n.º 1
0
 /**
  * @return Parameter[]
  * @throws \Exception
  */
 public function parameters()
 {
     $parameters = [];
     foreach ($this->reader->readInterface() as $property) {
         if ($property->canSet()) {
             $parameters[] = (new Parameter($property->name(), $property->type(), $property->isRequired()))->setDescription($this->parser->parse($property->comment()));
         }
     }
     return $parameters;
 }
Exemplo n.º 2
0
 /**
  * @return Parameter[]
  */
 public function parameters()
 {
     $analyzer = new MethodAnalyzer($this->method);
     $parameters = [];
     foreach ($this->method->getParameters() as $parameter) {
         $type = $analyzer->getType($parameter, $this->types);
         $parameters[] = (new Parameter($parameter->name, $type, !$parameter->isDefaultValueAvailable()))->setDescription($this->parser->parse($analyzer->getComment($parameter)));
     }
     return $parameters;
 }
Exemplo n.º 3
0
 public function parse($comment)
 {
     if (class_exists(\Parsedown::class)) {
         return (new \Parsedown())->text($comment);
     }
     return nl2br(parent::parse($comment));
 }