Constructs the property accessibility from the supplied reflection.

@param \ReflectionProperty $reflection

@return PropertyAccessibility
519295
public static function from(\ReflectionProperty $reflection) : PropertyAccessibility
    {
        if ($reflection->isPublic()) {
            $accessibility = self::ACCESS_PUBLIC;
        } elseif ($reflection->isProtected()) {
            $accessibility = self::ACCESS_PROTECTED;
        } else {
            $accessibility = self::ACCESS_PRIVATE;
        }

        return new self($accessibility, $reflection->getDeclaringClass()->getName());
    }
728769
protected function gatherAppMiddleware(ReflectionClass $reflection)
    {
        $property = $reflection->getProperty('middleware');
        $property->setAccessible(true);

        $middleware = $property->getValue($this->app);

        return $middleware;
    }
805459
protected function resolveSetter(\ReflectionClass $reflection, string $name)
    {
        $setter = 'set' . ucfirst($name);

        if ($reflection->hasMethod($setter) && $reflection->getMethod($setter)->isPublic()) {
            return $setter;
        }
    }
778314
private function getDocumentPropertiesReflection(\ReflectionClass $reflectionClass)
    {
        if (in_array($reflectionClass->getName(), $this->properties)) {
            return $this->properties[$reflectionClass->getName()];
        }

        $properties = [];

        foreach ($reflectionClass->getProperties() as $property) {
            if (!in_array($property->getName(), $properties)) {
                $properties[$property->getName()] = $property;
            }
        }

        $parentReflection = $reflectionClass->getParentClass();
        if ($parentReflection !== false) {
            $properties = array_merge(
                $properties,
                array_diff_key($this->getDocumentPropertiesReflection($parentReflection), $properties)
            );
        }

        $this->properties[$reflectionClass->getName()] = $properties;

        return $properties;
    }
343399
protected function findProperties(\ReflectionClass $reflection): void
    {
        if (false !== $reflection->getParentClass()) {
            $this->findProperties($reflection->getParentClass());
        }

        $this->properties = array_unique(array_merge($this->properties, array_keys($reflection->getDefaultProperties())));
    }
433285
public function parseTableName(\ReflectionClass $reflection)
    {
        $hd = $this->parser->parse($reflection->getDocComment());

        if (!empty($hd[0])) {
            return $hd[1];
        }

        $table = substr($reflection->getName(), strlen($reflection->getNamespaceName()));

        return strtolower(str_replace('\\', '', $table));
    }
1096028
public static function getPrivateProperty(\ReflectionClass $reflectionClass, $property)
    {
        if (!$reflectionClass->hasProperty($property) && $reflectionClass->getParentClass()) {
            return static::getPrivateProperty($reflectionClass->getParentClass(), $property);
        }

        return $reflectionClass->getProperty($property);
    }
443777
private function getAccessibleProperty(ReflectionProperty $property)
    {
        return $this->reflectionService->getAccessibleProperty(
            $property->getDeclaringClass()->getName(),
            $property->getName()
        );
    }
72817
public static function readPrivateProperty($object, $property, $class = null)
    {
        if (is_null($class)) {
            $class = $object;
        }

        $property = new \ReflectionProperty($class, $property);
        $property->setAccessible(true);

        return $property->getValue($object);
    }
107603
protected function getPropertiesMeta(ReflectionClass $reflection): array
    {
        $meta = [];
        $properties = $reflection->getProperties(ReflectionProperty::IS_PUBLIC);

        foreach ($properties as $item) {
            $doc = $item->getDocComment();
            $notations = $this->parser->parse($doc);

            if (count($notations) > 0) {
                $meta[$item->getName()] = $notations;
            }
        }

        return $meta;
    }
300998
private function getReflectionProperty($className, $property)
    {
        if (!isset(self::$properties[$className])) {
            self::$properties[$className] = array();
        }

        if (!isset(self::$properties[$className][$property])) {
            try {
                $rflProperty = new ReflectionProperty($className, $property);
                $rflProperty->setAccessible(true);
            } catch (ReflectionException $e) {
                if (($parentClass = get_parent_class($className)) !== false) {
                    $rflProperty = $this->getReflectionProperty($parentClass, $property);
                } else {
                    throw $e;
                }
            }

            self::$properties[$className][$property] = $rflProperty;
        }

        return self::$properties[$className][$property];
    }
990000
public function isAccessibleFrom(string $property, $class) : bool
    {
        return isset($this->propertyAccessibilityMap[$property])
                ? $this->propertyAccessibilityMap[$property]->isAccessibleFrom($class)
                : false;
    }
1070873
public static function getProperty($object, string $propertyName)
    {
        $reflection = new \ReflectionObject($object);
        $property = $reflection->getProperty($propertyName);
        $property->setAccessible(true);

        return $property->getValue($object);
    }
887427
final protected function _getPropertyKey(\ReflectionProperty $property)
	{
		$static = $property->isStatic() ? ' static' : '';
		if ($property->isPublic()) {
			return 'public' . $static . ' ' . $property->getName();
		}
		if ($property->isProtected()) {
			return 'protected' . $static . ' ' . $property->getName();
		}
		if ($property->isPrivate()) {
			return 'private' . $static . ' ' . $property->getName();
		}
	}
262115
public static function fromReflection(\ReflectionFunctionAbstract $reflection)
    {
        $returnsReference     = $reflection->returnsReference();
        $name                 = $reflection->getShortName();
        $parameterExpressions = self::getParameterExpressionsFromReflection($reflection);

        if ($reflection->isClosure()) {
            return self::closure(
                    $returnsReference,
                    $parameterExpressions,
                    array_keys($reflection->getStaticVariables())
            );
        } elseif ($reflection instanceof \ReflectionMethod) {
            if ($reflection->isPublic()) {
                $accessModifier = self::ACCESS_PUBLIC;
            } elseif ($reflection->isProtected()) {
                $accessModifier = self::ACCESS_PROTECTED;
            } else {
                $accessModifier = self::ACCESS_PRIVATE;
            }

            if ($reflection->isAbstract()) {
                $polymorphModifier = self::POLYMORPH_ABSTRACT;
            } elseif ($reflection->isFinal()) {
                $polymorphModifier = self::POLYMORPH_FINAL;
            } else {
                $polymorphModifier = null;
            }

            return self::method(
                    $returnsReference,
                    $accessModifier,
                    $polymorphModifier,
                    $reflection->isStatic(),
                    $name,
                    $parameterExpressions
            );
        } else {
            return self::func(
                    $returnsReference,
                    $name,
                    $parameterExpressions
            );
        }
    }
6293
protected function setPropertyValue($reflection, $classInstance, $classProperty, $object)
    {
        /*
         | We will make property accessible and set the value into it
         */
        $reflection->makePropertyAccessible($classProperty);
        $reflectionProperty = $reflection->getReflectionProperty();
        $reflectionProperty->setValue($classInstance, $object);
    }
1237870
private function getRiakPropertiesMapping(ReflectionClass $reflection)
    {
        $properties = $reflection->getProperties();
        $metadata   = [];

        foreach ($properties as $property) {
            $metadata = array_merge($this->getPropertyMapping($property), $metadata);
        }

        return $metadata;
    }