PHPStan\Reflection\Php\PhpClassReflectionExtension::createProperties PHP Method

createProperties() private method

private createProperties ( ClassReflection $classReflection ) : array
$classReflection PHPStan\Reflection\ClassReflection
return array
    private function createProperties(ClassReflection $classReflection) : array
    {
        $properties = [];
        foreach ($classReflection->getNativeReflection()->getProperties() as $propertyReflection) {
            $propertyName = $propertyReflection->getName();
            $declaringClassReflection = $this->broker->getClass($propertyReflection->getDeclaringClass()->getName());
            $typeString = $this->getPropertyAnnotationTypeString($propertyReflection);
            if ($typeString === null) {
                $type = new MixedType(false);
            } elseif (!$declaringClassReflection->getNativeReflection()->isAnonymous() && $declaringClassReflection->getNativeReflection()->getFileName() !== false) {
                $typeMap = $this->fileTypeMapper->getTypeMap($declaringClassReflection->getNativeReflection()->getFileName());
                if (isset($typeMap[$typeString])) {
                    $type = $typeMap[$typeString];
                } else {
                    $type = new MixedType(true);
                }
            } else {
                $type = new MixedType(true);
            }
            $properties[$propertyName] = new PhpPropertyReflection($declaringClassReflection, $type, $propertyReflection);
        }
        return $properties;
    }