@param string $class
@param string $property

@return string
3680
public static function reflectClassProperty($class, $property, $output = true)
    {
        $data = '';

        $reflectionClass    = new \ReflectionClass($class);
        $reflectionProperty = new \ReflectionProperty($class, $property);

        $defaultPropertyValues = $reflectionClass->getDefaultProperties();

        $comment = $reflectionProperty->getDocComment();
        if (!empty($comment)) {
            $data .= "\n";
            $data .= "\t";
            $data .= $comment;
        }

        $data .= "\n";
        $data .= "\t";
        $data .= ($reflectionProperty->isPublic() ? 'public ' : '');
        $data .= ($reflectionProperty->isPrivate() ? 'private ' : '');
        $data .= ($reflectionProperty->isProtected() ? 'protected ' : '');
        $data .= ($reflectionProperty->isStatic() ? 'static ' : '');
        $data .= '$' . $reflectionProperty->name;
        if (isset($defaultPropertyValues[$property])) {
            $data .= ' = ' . self::getDebugInformation($defaultPropertyValues[$property]);
        }
        $data .= ';';

        if ($output) {
            self::output($data);
        }

        return $data;
    }
564836
private static function &getProperty($object, string $property)
  {
    $value = &\Closure::bind(function & () use ($property) {
      return $this->$property;
    }, $object, $object)->__invoke();

    return $value;
  }
477880
public static function get_property_definition($property) {

        self::fill_properties_cache();

        if (!array_key_exists($property, self::$propertiescache)) {
            throw new coding_exception('Invalid property requested.');
        }

        return self::$propertiescache[$property];
    }
1218363
private function readPrivateProperty($object, string $property)
    {
        $reflectionClass = new \ReflectionClass($object);
        $reflectionProperty = null;
        do {
            if ($reflectionClass->hasProperty($property)) {
                $reflectionProperty = $reflectionClass->getProperty($property);
            }
            $reflectionClass = $reflectionClass->getParentClass();
        } while ($reflectionClass);

        if ($reflectionProperty === null) {
            throw new \InvalidArgumentException("Unable to find property '".$property.'" in object of class '.get_class($object).". Please check your @URL annotation.");
        }

        $reflectionProperty->setAccessible(true);
        return $reflectionProperty->getValue($object);
    }
1155974
protected function buildProperty(ClassProperty $property, $indent)
    {
        $visibility = 'public';

        if (false === $property->isPublic()) {
            $visibility = $property->isProtected() ? 'protected' : 'private';
        }

        if ($property->isStatic()) {
            $visibility = 'static '.$visibility;
        }

        $source = $visibility.' $'.$property->getName();
        $original = $property->getOriginal();

        if (isset($original['default'])) {
            $source .= ' = '.$this->wrapPHPValue([
                'default' => $original['default'],
            ]);
        }

        $docBlock = new DocBlock($property->getDocBlock(), $indent);

        return $docBlock."\n".$indent.$source.';';
    }
1072864
protected function handlePropertyFeature($class)
    {
        if (!$this->isSubclassOf($class, 'yii\base\BaseObject')) {
            return;
        }
        foreach ($class->getPublicMethods() as $name => $method) {
            if ($method->isStatic) {
                continue;
            }
            if (!strncmp($name, 'get', 3) && strlen($name) > 3 && $this->hasNonOptionalParams($method)) {
                $propertyName = '$' . lcfirst(substr($method->name, 3));
                if (isset($class->properties[$propertyName])) {
                    $property = $class->properties[$propertyName];
                    if ($property->getter === null && $property->setter === null) {
                        $this->errors[] = [
                            'line' => $property->startLine,
                            'file' => $class->sourceFile,
                            'message' => "Property $propertyName conflicts with a defined getter {$method->name} in {$class->name}.",
                        ];
                    }
                    $property->getter = $method;
                } else {
                    $class->properties[$propertyName] = new PropertyDoc(null, $this, [
                        'name' => $propertyName,
                        'definedBy' => $method->definedBy,
                        'sourceFile' => $class->sourceFile,
                        'visibility' => 'public',
                        'isStatic' => false,
                        'type' => $method->returnType,
                        'types' => $method->returnTypes,
                        'shortDescription' => BaseDoc::extractFirstSentence($method->return),
                        'description' => $method->return,
                        'getter' => $method
                        // TODO set default value
                    ]);
                }
            }
            if (!strncmp($name, 'set', 3) && strlen($name) > 3 && $this->hasNonOptionalParams($method, 1)) {
                $propertyName = '$' . lcfirst(substr($method->name, 3));
                if (isset($class->properties[$propertyName])) {
                    $property = $class->properties[$propertyName];
                    if ($property->getter === null && $property->setter === null) {
                        $this->errors[] = [
                            'line' => $property->startLine,
                            'file' => $class->sourceFile,
                            'message' => "Property $propertyName conflicts with a defined setter {$method->name} in {$class->name}.",
                        ];
                    }
                    $property->setter = $method;
                } else {
                    $param = $this->getFirstNotOptionalParameter($method);
                    $class->properties[$propertyName] = new PropertyDoc(null, $this, [
                        'name' => $propertyName,
                        'definedBy' => $method->definedBy,
                        'sourceFile' => $class->sourceFile,
                        'visibility' => 'public',
                        'isStatic' => false,
                        'type' => $param->type,
                        'types' => $param->types,
                        'shortDescription' => BaseDoc::extractFirstSentence($param->description),
                        'description' => $param->description,
                        'setter' => $method
                    ]);
                }
            }
        }
    }
480445
protected function getPropertyValue($property)
    {
        $getter = sprintf('get%s', $property);
        if (!method_exists($this->object, $getter)) {
            throw new NostoException(
                sprintf(
                    'Class %s does not have getter for property %s',
                    get_class($this->object),
                    $property
                )
            );
        }

        return $this->object->$getter();
    }
1116768
private function parseProperties($class)
    {
        $ret = [];

        $defaults = $class->getDefaultProperties();

        foreach ($class->getProperties() as $property) {
            $tags = self::parseDocCommentTags($property->getDocComment());
            list($type, $description) = $this->tokenize($tags[self::T_VAR], 2);

            $p = [];
            if (strpos($type, '[]') > 0) {
                $type = str_replace('[]', '', $type);
                $p['type'] = 'array';
                $p['xml'] = ['name' => preg_replace('!s$!', '', $property->name), 'wrapped' => true];
                if ($this->isDefinedType($type)) {
                    $p['items'] = ['$ref' => $this->getDefinition($type)];
                } else {
                    $p['items'] = ['type' => $type];
                }
            } elseif ($this->isDefinedType($type)) {
                $p['$ref'] = $this->getDefinition($type);
            } else {
                $p['type'] = $type;
                $enums = isset($tags[self::T_ENUM]) ? $this->mixedToArray($tags[self::T_ENUM]) : [];
                foreach ($enums as $enum) {
                    $p['enum'] = $this->tokenize($enum);
                }
            }

            if (isset($tags[self::T_FORMAT])) {
                $p['format'] = $tags[self::T_FORMAT];
            }

            if (isset($tags[self::T_EXAMPLE])) {
                $p['example'] = $tags[self::T_EXAMPLE];
            }

            if (isset($tags[self::T_REQUIRED])) {
                $p['required'] = true;
            }

            if (!empty($description)) {
                $p['description'] = $description;
            }

            if (!is_null($defaults[$property->name])) {
                $p['default'] = $defaults[$property->name];
            }

            $ret[$property->name] = $p;
        }
        return $ret;
    }
431228
public static function propertyAnnotations($class, $propertyName)
    {
        $class = is_object($class) ? get_class($class) : $class;
        if (!class_exists('ReflectionProperty')) {
            throw new \RuntimeException("Property type of " . $class . "::{$propertyName} cannot be resolved");
        }

        if ($annotations =& self::$propertiesType[$class][$propertyName]) {
            return $annotations;
        }

        if (!($refl =& self::$propertiesRefl[$class][$propertyName])) {
            $getter = self::getter($class, $propertyName);
            $refl = new \ReflectionMethod($class, $getter);
            self::$propertiesRefl[$class][$propertyName] = $refl;
        }

        // todo: smarter regexp
        if (!preg_match_all(
            '~\@([^\s@\(]+)[\t ]*(?:\(?([^\n@]+)\)?)?~i',
            $refl->getDocComment(),
            $annots,
            PREG_PATTERN_ORDER)
        ) {
            return null;
        }
        foreach ($annots[1] as $i => $annot) {
            $annotations[strtolower($annot)] = empty($annots[2][$i]) ? TRUE : rtrim($annots[2][$i], " \t\n\r)");
        }

        return $annotations;
    }
33095
public static function fromProperty(
        string $class,
        string $property
    ): array
    {
        try {

            $property = new \ReflectionProperty($class, $property);
        }
        catch (\ReflectionException $e) {

            throw new Exception(
                "Property '{$class}::{$property}' not found.",
                Exception::PROPERTY_NOT_FOUND
            );
        }

        $docComment = $property->getDocComment();

        unset($property);

        if ($docComment === false) {

            return [];
        }

        return Parser::parseDocComment($docComment);
    }
1352222
public function enum(string $property): EnumPropertyColumnDefiner
    {
        $this->verifyProperty(__METHOD__, $property);
        $type       = $this->class->getPropertyType($property);
        $isNullable = $type->isNullable();
        $enumType   = $type->nonNullable();

        if (!($enumType instanceof ObjectType)) {
            throw InvalidArgumentException::format(
                'Invalid enum property \'%s\': must map to an object type, %s given',
                $property, $type->asTypeString()
            );
        }

        $class = $enumType->getClass();

        return $this->relation($property)->asEmbedded()->enum($class, $isNullable);
    }
559876
public function getTableNameFromClass($class, $property = 'tableName', $default = null)
    {
        if (!class_exists($class) || !property_exists($class, $property)) {
            return $default;
        }

        $properties = get_class_vars($class);

        return $properties[$property];
    }
179723
private function getClassProperties($class)
    {
        $properties = $this->getCache()->get('_PHX.serialze_properties.'. $class);
        if (!isset($properties)) {
            $classResolver = $this->getClassResolver();
            $properties = $this->getReflectionProperties($class);
            foreach ($this->getAnnotations()->get($class) as $annotation) {
                if ($annotation instanceof IsA) {
                    $properties[$this->getAnnotationProperty($annotation)]['type']
                        = $classResolver->resolve($annotation->class, $annotation->getDeclaringClass());
                } elseif ($annotation instanceof IsArray && is_scalar($annotation->element)) {
                    $name = $this->getAnnotationProperty($annotation);
                    $properties[$name]['type'] = 'array';
                    $properties[$name]['element']
                        = $classResolver->resolve($annotation->element, $annotation->getDeclaringClass());
                } elseif ($annotation instanceof SerializeName) {
                    $properties[$this->getAnnotationProperty($annotation)]['serializeName']
                        = $annotation->value;
                }
            }
            $this->getCache()->save('_PHX.serialze_properties.'.$class, $properties);
        }
        return $properties;
    }
1178206
public function getPropertyValue($class, $name)
    {
        $property = $this->findProperty($class, $name);
        $property->setAccessible(true);

        return $property->getValue(is_object($class) ? $class : null);
    }
121709
protected function getProperty($resource, $property)
    {
        if($property == '_self') {
            return $resource;
        }

        $propertyPath = explode('.', $property);

        if(count($propertyPath) > 1) {
            $property = array_shift($propertyPath);
            $newResource = $this->getProperty($resource, $property);
            if($newResource !== null) {
                $propertyPath = implode('.', $propertyPath);
                return $this->getProperty($newResource, $propertyPath);
            } else {
                return null;
            }
        } else {
            $method = sprintf('is%s', ucfirst($property));
            if(method_exists($resource, $method)) {
                return call_user_func(array($resource, $method));
            }

            $method = sprintf('get%s', ucfirst($property));
            if(method_exists($resource, $method)) {
                return call_user_func(array($resource, $method));
            }
        }

        throw new PropertyNotExistsException(sprintf(
            'Trying to call "get%s" or "is%s" on class "%s", but method does not exists. Maybe you spelled it wrong or you didn\'t add the getter for property "%s"',
            ucfirst($property),
            ucfirst($property),
            get_class($resource),
            $property
        ));
    }
35278
public static function getPropertyAnnotations($class, $property)
    {
        $annotationBag = Bridge\Loader::getInstance()->getPropertyAnnotations($class, str_replace('$', '', $property));
        $annotationBag = self::explodeNamespaces($annotationBag);

        return new ConfigObject($annotationBag);
    }
745904
private function accessProperty(ReflectionClass $reflection, $property)
    {
        $propertyReflection = $reflection->getProperty($property);
        $propertyReflection->setAccessible(true);

        return $propertyReflection;
    }