/**
* 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);
}