コード例 #1
0
 /**
  * Pull the public methods out of a class
  *
  * Optionally, don't get the inherited methods (default), and mask out the magic methods (default)
  *
  * @param string $fqcn
  *
  * @return array
  */
 private function extractPublicMethods($fqcn)
 {
     $class = $this->reflector->reflect($fqcn);
     $methods = $class->getMethods(ReflectionMethod::IS_PUBLIC);
     $class = $class->getShortName();
     // Filter out inherited methods && magic methods
     $methods = array_filter($methods, function ($method) use($fqcn) {
         return $method->class === $fqcn && substr($method->name, 0, 2) != '__';
     });
     $signature_methods = [];
     foreach ($methods as $method) {
         $signature_methods[lcfirst($class) . ucfirst($method->name)] = ['class' => $class, 'method' => $method->name, 'doc' => $this->decipher->process($method->getDocComment())];
     }
     return $signature_methods;
 }
コード例 #2
0
 /**
  * @test
  */
 public function it_returns_null_for_short_and_long_and_tags_if_none_are_provided()
 {
     $this->assertEquals($this->processor->process($this->buildDoc(false, false, false)), $this->buildResponse(false, false, false));
 }