getMethodTagsValues() 공개 메소드

Returns all tags and their values the specified method is tagged with
public getMethodTagsValues ( string $className, string $methodName ) : array
$className string Name of the class containing the method
$methodName string Name of the method to return the tags and values of
리턴 array An array of tags and their values or an empty array of no tags were found
 /**
  * Builds the method documentation block for the specified method keeping the vital annotations
  *
  * @param string $className Name of the class the method is declared in
  * @param string $methodName Name of the method to create the parameters code for
  * @return string $methodDocumentation DocComment for the given method
  */
 protected function buildMethodDocumentation($className, $methodName)
 {
     $methodDocumentation = "    /**\n     * Autogenerated Proxy Method\n";
     if ($this->reflectionService->hasMethod($className, $methodName)) {
         $methodTags = $this->reflectionService->getMethodTagsValues($className, $methodName);
         $allowedTags = ['param', 'return', 'throws'];
         foreach ($methodTags as $tag => $values) {
             if (in_array($tag, $allowedTags)) {
                 if (count($values) === 0) {
                     $methodDocumentation .= '     * @' . $tag . "\n";
                 } else {
                     foreach ($values as $value) {
                         $methodDocumentation .= '     * @' . $tag . ' ' . $value . "\n";
                     }
                 }
             }
         }
         $methodAnnotations = $this->reflectionService->getMethodAnnotations($className, $methodName);
         foreach ($methodAnnotations as $annotation) {
             $methodDocumentation .= '     * ' . Compiler::renderAnnotation($annotation) . "\n";
         }
     }
     $methodDocumentation .= "     */\n";
     return $methodDocumentation;
 }
 /**
  * @test
  */
 public function theReflectionServiceCorrectlyBuildsMethodTagsValues()
 {
     $actual = $this->reflectionService->getMethodTagsValues(Reflection\Fixtures\ClassSchemaFixture::class, 'setName');
     $expected = ['param' => ['string $name'], 'return' => ['void'], 'validate' => ['$name", type="foo1', '$name", type="foo2'], 'skipcsrfprotection' => []];
     $this->assertSame($expected, $actual);
 }