getLocatedSource() public method

public getLocatedSource ( ) : BetterReflection\SourceLocator\Located\LocatedSource
return BetterReflection\SourceLocator\Located\LocatedSource
 /**
  * @param Reflector $reflector
  * @param MethodNode $node
  * @param ReflectionClass $declaringClass
  * @return ReflectionMethod
  */
 public static function createFromNode(Reflector $reflector, MethodNode $node, ReflectionClass $declaringClass)
 {
     $method = new self();
     $method->declaringClass = $declaringClass;
     // Compat with core reflection means we should NOT pass namespace info
     // for ReflectionMethod
     $method->populateFunctionAbstract($reflector, $node, $declaringClass->getLocatedSource(), null);
     return $method;
 }
 /**
  * @param MethodNode $node
  * @param ReflectionClass $declaringClass
  * @return ReflectionMethod
  */
 public static function createFromNode(MethodNode $node, ReflectionClass $declaringClass)
 {
     $method = new self($node);
     $method->declaringClass = $declaringClass;
     // Compat with core reflection means we should NOT pass namespace info
     // for ReflectionMethod
     $method->populateFunctionAbstract($node, $declaringClass->getLocatedSource(), null);
     $method->flags |= $node->isAbstract() ? self::IS_ABSTRACT : 0;
     $method->flags |= $node->isFinal() ? self::IS_FINAL : 0;
     $method->flags |= $node->isPrivate() ? self::IS_PRIVATE : 0;
     $method->flags |= $node->isProtected() ? self::IS_PROTECTED : 0;
     $method->flags |= $node->isPublic() ? self::IS_PUBLIC : 0;
     $method->flags |= $node->isStatic() ? self::IS_STATIC : 0;
     return $method;
 }
Example #3
0
 public function formatClass(ReflectionClass $class)
 {
     $ml = Multiline::create($class->getLocatedSource()->getSource());
     return trim($ml[$class->getStartLine() - 1]);
 }
 /**
  * {@inheritdoc}
  */
 public function getLocatedSource()
 {
     return $this->reflectionClass->getLocatedSource();
 }