BetterReflection\Reflection\ReflectionObject::createFromNode PHP Method

createFromNode() public static method

Cannot instantiate this way, use ReflectionObject::createFromInstance
public static createFromNode ( BetterReflection\Reflector\Reflector $reflector, ClassLike $node, BetterReflection\SourceLocator\Located\LocatedSource $locatedSource, Namespace_ $namespace = null )
$reflector BetterReflection\Reflector\Reflector
$node PhpParser\Node\Stmt\ClassLike
$locatedSource BetterReflection\SourceLocator\Located\LocatedSource
$namespace PhpParser\Node\Stmt\Namespace_
    public static function createFromNode(Reflector $reflector, ClassLikeNode $node, LocatedSource $locatedSource, NamespaceNode $namespace = null)
    {
        throw new \LogicException('Cannot create a ReflectionObject from node - use ReflectionObject::createFromInstance');
    }

Usage Example

 public function testCreateFromNodeThrowsException()
 {
     /** @var Reflector|\PHPUnit_Framework_MockObject_MockObject $mReflector */
     $mReflector = $this->createMock(Reflector::class);
     /** @var ClassLike|\PHPUnit_Framework_MockObject_MockObject $mClassNode */
     $mClassNode = $this->createMock(ClassLike::class);
     /** @var LocatedSource|\PHPUnit_Framework_MockObject_MockObject $mLocatedSource */
     $mLocatedSource = $this->createMock(LocatedSource::class);
     $this->expectException(\LogicException::class);
     ReflectionObject::createFromNode($mReflector, $mClassNode, $mLocatedSource);
 }
All Usage Examples Of BetterReflection\Reflection\ReflectionObject::createFromNode