BetterReflection\Reflector\ClassReflector::buildDefaultReflector PHP Method

buildDefaultReflector() public static method

public static buildDefaultReflector ( ) : self
return self
    public static function buildDefaultReflector()
    {
        return new self(new AggregateSourceLocator([new PhpInternalSourceLocator(), new EvaledCodeSourceLocator(), new AutoloadSourceLocator()]));
    }

Usage Example

コード例 #1
0
 /**
  * Pass an instance of an object to this method to reflect it
  *
  * @param object $object
  * @return ReflectionClass
  */
 public static function createFromInstance($object)
 {
     if (gettype($object) !== 'object') {
         throw new \InvalidArgumentException('Can only create from an instance of an object');
     }
     $reflector = ClassReflector::buildDefaultReflector();
     $reflectionClass = $reflector->reflect(get_class($object));
     return new self($reflector, $reflectionClass, $object);
 }
All Usage Examples Of BetterReflection\Reflector\ClassReflector::buildDefaultReflector