Extract all the properties from Dto class

@param string $class

@return array
435094
protected function extractDtoProperties($class)
    {
        $properties = [];
        $reflector = new \ReflectionClass($class);
        if ($reflector->isSubclassOf(self::DTO_INTERFACE)) {
            $properties = array_merge($properties, InjectorHelper::extractVariables($reflector));
        }

        return $properties;
    }
1355811
public function extract( $object )
    {
        $data = $this->getMapper()
                     ->extract( $object );

        if ( isset( $data['properties'] ) &&
             is_array( $data['properties'] ) )
        {
            foreach ( $data['properties'] as $key => $value )
            {
                $newKey = String::camelize( $key );

                if ( is_array( $value ) &&
                     array_key_exists( 'value', $value ) )
                {
                    $data['properties'][$key] = $value['value'];
                }

                if ( $newKey != $key )
                {
                    $data['properties'][$newKey] = $data['properties'][$key];
                    unset( $data['properties'][$key] );
                }
            }
        }

        return $data;
    }
946776
protected function _getClassIndices($class)
    {
        $indices = array ();
        if ($class == self::CLASS_LETTER) {
            $indices = array_merge(
                $this->_getClassIndices(self::CLASS_LOWER),
                $this->_getClassIndices(self::CLASS_UPPER)
            );
            sort($indices);
        } else {
            if (isset ($this->_tokenIndices[$class])) {
                $indices = $this->_tokenIndices[$class];
            }
        }

        return $indices;
    }
1107428
protected function extractObjectProperties($object): array
    {
        $properties = [];

        $reflection = new \ReflectionObject($object);

        // obtain public, protected and private properties of the class itself:

        foreach ($reflection->getProperties() as $property) {
            if ($property->isStatic()) {
                continue; // omit static properties
            }

            $property->setAccessible(true);

            $properties["\${$property->name}"] = $property->getValue($object);
        }

        // obtain any inherited private properties from parent classes:

        while ($reflection = $reflection->getParentClass()) {
            foreach ($reflection->getProperties(\ReflectionProperty::IS_PRIVATE) as $property) {
                $property->setAccessible(true);

                $properties["{$reflection->name}::\${$property->name}"] = $property->getValue($object);
            }
        }

        return $properties;
    }
422888
public function getDescendantsOf($class)
    {
        if (is_object($class)) {
            $class = get_class($class);
        }

        $lClass = strtolower($class);
        if (array_key_exists($lClass, $this->descendants)) {
            return $this->descendants[$lClass];
        }

        return [];
    }
222252
private function getParentProperties(\ReflectionClass $reflectionClass)
    {
        $parent = $reflectionClass->getParentClass();
        if ($parent != null) {
            return array_merge($reflectionClass->getProperties(), $this->getParentProperties($parent));
        }

        return $reflectionClass->getProperties();
    }
908168
public function extract($object)
    {
        return [
            'name' => $object->getFileName(),
            'type' => $object->getType(),
            'size' => $object->getSize(),
            'tmp_name' => $object->getTempName(),
            'error' => $object->getError(),
            'size' => [
                0 => $object->getWidth(),
                1 => $object->getHeight(),
                2 => $object->getMimeType(),
            ],
        ];
    }
536027
public function getObjects($class = null)
    {
        if ($class === null) {
            return $this->objects;
        }

        $objects = [];

        foreach ($this->objects as $object) {
            if ($object instanceof $class) {
                $objects[] = $object;
            }
        }

        return $objects;
    }
1020445
protected function getModelColumns($class)
    {
        $attributes = [];

        $classNamespace = $this->getModelNamespace($class);

        if ($class) {
            if (class_exists($classNamespace)) {
                $model = new \ReflectionClass($classNamespace);

                if ($model->isSubclassOf('Illuminate\Database\Eloquent\Model')) {
                    $mdl = $this->app->make($classNamespace);
                    $table = $mdl->getTable();

                    if (is_array($table)) {
                        $table = array_first($table);
                    }

                    $table = $mdl->getConnection()->getTablePrefix().$table;
                    $schema = $mdl->getConnection()->getDoctrineSchemaManager($table);

                    $database = null;
                    if (strpos($table, '.')) {
                        list($database, $table) = explode('.', $table);
                    }

                    $columns = Arr::except($schema->listTableColumns($table, $database), $mdl->getHidden());

                    foreach ($columns as $column) {
                        if ($column->getType() instanceof \Doctrine\DBAL\Types\JsonArrayType) {
                            continue;
                        }

                        $castTo = $this->getCasting($column->getType());

                        $attributes[] = ['column' => $column->getName(), 'casts' => $castTo];
                    }

                    return $attributes;
                }
            } else {
                $this->error("Your model {$class} was not found in {$this->config->get('fractal.model_namespace')}\\ \r\nIf this is the first time you get this message, try to update /config/fractal.php to make changes to model_namespace accordingly.");
                exit();
            }
        }

        // use as a default attribute
        return [
            ['column' => 'id', 'casts' => null],
        ];
    }
495264
public function forClass(string $class): array
    {
        if (!class_exists($class)) {
            throw new InvalidArgumentException("Cannot get meta for non-exist class '$class'");
        }

        $reflection = $this->factory->reflectClass($class);

        $meta = $this->getClassMeta($reflection);
        $meta['@properties'] = $this->getPropertiesMeta($reflection);

        return $meta;
    }
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 [];
	}
1086119
private function getOptions(string $class) : Options
    {
        $ref = new \ReflectionClass($class);
        $allows = $this->getAllows($ref->getMethods());
        $params = [];
        foreach ($allows as $method) {
            $params[] = $this->getParams($class, $method);
        }

        return new Options($allows, $params);
    }
677317
public static function getClassAndAlias($class)
    {
        if (false !== strpos($class, ' ')) {
            list($class, $alias) = explode(' ', $class);
        } else {
            $alias = null;
        }
        if (0 === strpos($class, '\\')) {
            $class = substr($class, 1);
        }

        return [$class, $alias];
    }
916214
private function getEntityTypeInfo($class)
    {
        $entityType = $this->getEntityType($class);

        if (!$entityType) {
            return [null, null];
        }

        $info = entity_get_info($entityType);

        if (!$info) {
            return [null, null];
        }

        return [$entityType, $info];
    }
750565
public function extract($object)
    {
        $data = [
            'group_class_id' => $object->getClass()->getId(),
            'name' => $object->getName(),
            'parent_id' => $object->hasParent() ? $object->getParent()->getId() : null,
        ];
        if ($object->getId()) {
            $data['id'] = $object->getId();
        }
        return $data;
    }
185569
private function extractMethods(\ReflectionClass $objectClass): array
    {
        return methodsOf($objectClass, \ReflectionMethod::IS_PUBLIC)
                ->filter(function(\ReflectionMethod $method)
                        {
                            if ($method->getNumberOfParameters() != 0
                                    || $method->isStatic()
                                    || $method->isConstructor()
                                    || $method->isDestructor()
                                    || 0 == strncmp($method->getName(), '__', 2)) {
                                return false;
                            }

                            return !annotationsOf($method)->contain('XmlIgnore');
                        }
                )->map(function(\ReflectionMethod $method)
                        {
                            return $this->createSerializerDelegate(
                                    annotationsOf($method),
                                    $method->getName()
                            );
                        }

                )->data();
    }
714650
protected function getDependencies($class)
    {
        if (isset($this->_reflections[$class])) {
            return [$this->_reflections[$class], $this->_dependencies[$class]];
        }

        $dependencies = [];
        $reflection = new ReflectionClass($class);

        $constructor = $reflection->getConstructor();
        if ($constructor !== null) {
            foreach ($constructor->getParameters() as $param) {
                if ($param->isDefaultValueAvailable()) {
                    $dependencies[] = $param->getDefaultValue();
                } else {
                    $c = $param->getClass();
                    $dependencies[] = Instance::of($c === null ? null : $c->getName());
                }
            }
        }

        $this->_reflections[$class] = $reflection;
        $this->_dependencies[$class] = $dependencies;

        return [$reflection, $dependencies];
    }