extract informations about properties

@param   \ReflectionClass  $objectClass
@return  array
558260
private function extractProperties(\ReflectionClass $objectClass): array
    {
        return propertiesOf($objectClass, \ReflectionProperty::IS_PUBLIC)
                ->filter(function(\ReflectionProperty $property)
                        {
                            return !$property->isStatic()
                                && !annotationsOf($property)->contain('XmlIgnore');
                        }
                )->map(function(\ReflectionProperty $property)
                        {
                            return $this->createSerializerDelegate(
                                    annotationsOf($property),
                                    $property->getName()
                            );
                        }
                )->data();
    }
813565
public static function getProperties(Reader $reader, ReflectionClass $class)
    {
        $props  = $class->getProperties();
        $result = [];

        foreach ($props as $property) {
            // skip statics
            if ($property->isStatic()) {
                continue;
            }

            // check whether we have an exclude annotation
            $exclude = $reader->getPropertyAnnotation($property, Annotation\Exclude::class);
            if ($exclude !== null) {
                continue;
            }

            // get the property name
            $key  = $reader->getPropertyAnnotation($property, Annotation\Key::class);
            $name = null;

            if ($key !== null) {
                $name = $key->getKey();
            }

            if (empty($name)) {
                $name = $property->getName();
            }

            $result[$name] = $property;
        }

        return $result;
    }
700098
protected function getClassMeta(ReflectionClass $reflection): array
    {
        $doc = $reflection->getDocComment();
        $notations = $this->parser->parse($doc);

        return $notations;
    }
308617
protected function getClassProviders(\ReflectionClass $class) {
		$annotations = Omocha::getAnnotations($class);
		
		//get class providers
		$providers = $annotations->find('Provider', Filter::TYPE_STRING);
		
		if (!empty($providers)) {
			$classes = [];
			
			foreach ($providers as $provider) {
				$classes[] = $provider->getValue();
			}
			
			return $classes;
		}
		
		//if no providers are specified try getting them from parent class
		if ($annotations->has('ExtendInject')) {
			$extend = $annotations->get('ExtendInject')->getValue();
			
			if ($extend) {
				$parent = $class->getParentClass();
				return $parent instanceof \ReflectionClass ? $this->getClassProviders($parent) : [];
			}
		}
		
		return [];
	}
820883
public function getEntityRepositories($class)
    {
        $identifiers = $this->getEntityIdentifiers($class);

        foreach ($identifiers as $i => $identifier) {
            $identifiers[$i] = AnDomain::getRepository($identifier);
        }

        return $identifiers;
    }
446114
private function extractFromConstructor(string $class, string $property): ?array
    {
        try {
            $reflectionClass = new \ReflectionClass($class);
        } catch (\ReflectionException $e) {
            return null;
        }

        $constructor = $reflectionClass->getConstructor();

        if (!$constructor) {
            return null;
        }

        foreach ($constructor->getParameters() as $parameter) {
            if ($property !== $parameter->name) {
                continue;
            }
            $reflectionType = $parameter->getType();

            return $reflectionType ? [$this->extractFromReflectionType($reflectionType, $constructor)] : null;
        }

        if ($parentClass = $reflectionClass->getParentClass()) {
            return $this->extractFromConstructor($parentClass->getName(), $property);
        }

        return null;
    }
110863
public static function getExtends($objectOrClass): array
    {
        if (is_object($objectOrClass)) {
            $objectOrClass = get_class($objectOrClass);
        }
        return array_values(class_parents($objectOrClass));
    }
1091463
public function parse(RefClass $class)
    {
        $result = [];

        $annotations = $this->parseComment($class->docComment);
        foreach ($annotations as $annotation) {
            $annotation->originClass = $class->name;
            $result[]                = $annotation;
        }

        foreach ($class->constants as $constant) {
            foreach ($this->parseComment($constant->docComment) as $annotation) {
                $annotation->originClass    = $class->name;
                $annotation->originConstant = $constant->name;
                $result[]                   = $annotation;
            }
        }

        foreach ($class->properties as $property) {
            foreach ($this->parseComment($property->docComment) as $annotation) {
                $annotation->originClass    = $class->name;
                $annotation->originProperty = $property->name;
                $result[]                   = $annotation;
            }
        }

        foreach ($class->methods as $method) {
            foreach ($this->parseComment($method->docComment) as $annotation) {
                $annotation->originClass  = $class->name;
                $annotation->originMethod = $method->name;
                $result[]                 = $annotation;
            }
        }

        return $result;
    }
481550
public function fetchAllObj(string $class = null): array
    {
        if (!$this->wasExecuted()) {
            $this->exec();
        }

        if ($class === null) {
            return $this->getAdapter()->getStatement()->fetchAll(\PDO::FETCH_OBJ);
        } else {
            $objectInstances = [];

            foreach ($this->fetchAll() as $r) {
                $objectInstances[] = new $class($r);
            }

            return $objectInstances;
        }
    }
514267
public function getIdentifiers($class)
    {
        $schema = $this->getSchema($class);

        if (isset($schema->claroline)) {
            return $schema->claroline->ids;
        }

        return [];
    }
434589
private function getAnnotations($class)
    {
        $parsed = $this->getParser()->parse($class);
        if (!is_array($parsed)) {
            return [];
        }
        $context = [
            'class' => $class,
            'declaringClass' => $class,
            'type' => Context::TYPE_CLASS,
            'name' => $class
        ];
        $annotations = [];
        if (!empty($parsed['class'])) {
            foreach ($parsed['class'] as $value) {
                $anno = $this->create($value, $context);
                if ($anno) {
                    $annotations[] = $anno;
                }
            }
        }
        $map = [
            'methods' => Context::TYPE_METHOD,
            'properties' => Context::TYPE_PROPERTY
        ];
        $reflection = new \ReflectionClass($class);
        foreach ($map as $type_name => $type) {
            if (!empty($parsed[$type_name])) {
                foreach ($parsed[$type_name] as $name => $values) {
                    $reflType = $type == 'method' ? $reflection->getMethod($name)
                               : $reflection->getProperty($name);
                    $context['type'] = $type;
                    $context['name'] = $name;
                    $context['declaringClass'] = $reflType->getDeclaringClass()->getName();
                    foreach ($values as $value) {
                        $anno = $this->create($value, $context);
                        if ($anno) {
                            $annotations[] = $anno;
                        }
                    }
                }
            }
        }
        return $annotations;
    }
325417
public function extract($object, array $map = null): array
    {
        $result = [];

        $className = \get_class($object);
        $reflection = $this->getReflection($className);

        if (!\is_array($map) || !$map) {
            $propertyList = $this->getReflectionPropertyList($className);
            $map = \array_combine($propertyList, $propertyList);
        }
        foreach ($map as $fieldName => $propertyName) {
            if ($reflection->hasProperty($propertyName)) {
                $property = $this->getProperty($reflection, $propertyName);
                $result[$fieldName] = $property->getValue($object);
            }
        }

        return $result;
    }
718647
private static function objectProperties($object): array
    {
        if ($object instanceof Serializable) {
            return ['$' => $object->serialize()];
        }

        $class = get_class($object);
        $properties = [];

        do {
            try {
                $properties += Closure::bind(function () use ($object) {
                    return get_object_vars($object);
                }, null, $class)->__invoke();
            } catch (Throwable $e) {
                return get_object_vars($object);
            }
        } while ($class = get_parent_class($class));

        return method_exists($object, '__sleep')
            ? array_intersect_key($properties, array_flip($object->__sleep()))
            : $properties;
    }
847299
public static function getProperties(
        ?object $object,
        ?string $classOverride = null,
        ?int $propertyType = null
    ): array {
        $reflectionClass = self::getReflectionClass($object, $classOverride);
        $properties = [];
        $reflectionProperties = $reflectionClass->getProperties($propertyType);
        foreach ($reflectionProperties as $property) {
            $property->setAccessible(true);
            $properties[$property->getName()] = $property->getValue($object);
        }
        return $properties;
    }
856562
public static function getClassProperties($class)
    {
        $properties = [];
        Logger::log('Extracting annotations properties from class ' . $class);
        $selfReflector = new \ReflectionClass($class);
        if (false !== $selfReflector->getParentClass()) {
            $properties = self::getClassProperties($selfReflector->getParentClass()->getName());
        }
        $properties = array_merge($properties, self::extractProperties($selfReflector));
        return $properties;
    }
648928
public function getColumns(\ReflectionClass $reflectionClass)
    {
        if ($this->isProduction()) {
            $this->grid->getColumn()->getFields();
        }

        $properties = $reflectionClass->getProperties(\ReflectionProperty::IS_PRIVATE | \ReflectionProperty::IS_PROTECTED);
        foreach ($properties as $property) {
            $propertyAnnotations = $this->extractorFactory->extract($property, Extractor::PROPERTY_ANNOTATION);
            foreach ($propertyAnnotations as $annotation) {
                if ($annotation instanceof Column) {
                    $fields[] = $property->getName();
                }
            }
        }

        return !empty($fields) ? $fields : $this->grid->getColumn()->getFields();
    }
795657
private function loadTranslatableMetadata(\ReflectionClass $class) {
        $classMetadata = new TranslatableMetadata($class->name);

        foreach ($class->getProperties() as $property) {
            if ($property->class !== $class->name) {
                continue;
            }

            $propertyMetadata = new PropertyMetadata($class->name, $property->getName());

            if ($this->reader->getPropertyAnnotation($property, 'Prezent\\Doctrine\\Translatable\\Annotation\\CurrentLocale')) {
                $classMetadata->currentLocale = $propertyMetadata;
                $classMetadata->addPropertyMetadata($propertyMetadata);
            }
            
            if ($this->reader->getPropertyAnnotation($property, 'Prezent\\Doctrine\\Translatable\\Annotation\\FallbackLocale')) {
                $classMetadata->fallbackLocale = $propertyMetadata;
                $classMetadata->addPropertyMetadata($propertyMetadata);
            }
            
            if ($annot = $this->reader->getPropertyAnnotation($property, 'Prezent\\Doctrine\\Translatable\\Annotation\\Translations')) {
                $classMetadata->targetEntity = $annot->targetEntity;
                $classMetadata->translations = $propertyMetadata;
                $classMetadata->addPropertyMetadata($propertyMetadata);
            }
        }

        return $classMetadata;
    }