ApiGen\Parser\Reflection\TokenReflection\ReflectionFactory::createMethodMagic PHP Method

createMethodMagic() public method

public createMethodMagic ( array $settings )
$settings array
    public function createMethodMagic(array $settings)
    {
        $reflection = new ReflectionMethodMagic($settings);
        return $this->setDependencies($reflection);
    }

Usage Example

 /**
  * @param string $annotation
  * @return ReflectionMethodMagic[]|array
  */
 private function processMagicMethodAnnotation($annotation)
 {
     if (!preg_match(self::PATTERN_METHOD, $annotation, $matches)) {
         return [];
     }
     list(, $static, $returnTypeHint, $returnsReference, $name, $args, $shortDescription) = $matches;
     $startLine = $this->getStartLine($annotation);
     $endLine = $startLine + substr_count($annotation, "\n");
     $methods = [];
     $methods[$name] = $method = $this->reflectionFactory->createMethodMagic(['name' => $name, 'shortDescription' => str_replace("\n", ' ', $shortDescription), 'startLine' => $startLine, 'endLine' => $endLine, 'returnsReference' => $returnsReference === '&', 'declaringClass' => $this->reflectionClass, 'annotations' => ['return' => [0 => $returnTypeHint]], 'static' => $static === 'static']);
     $this->attachMethodParameters($method, $args);
     return $methods;
 }