Convert given list of classes to objects.

@param string[] $classes

@return mixed[]
974453
private function getObjectsFromClasses($classes)
    {
        $objects = array_map(function ($class) {
            try {
                return new $class;
            } catch (\Throwable $ex) {
                print "Can not add command from class $class:\n";
                print $ex->getMessage() . "\n";
            }
        }, $classes);
        $objects = array_filter($objects, function($o){return !is_null($o);} );
        return $objects;
    }
715943
private function expandClasses(array $patterns, array $classes)
    {
        $expanded = [];

        // Explicit classes declared in the patterns are returned directly
        foreach ($patterns as $key => $pattern) {
            if ('\\' !== substr($pattern, -1) && false === strpos($pattern, '*')) {
                unset($patterns[$key]);
                $expanded[] = ltrim($pattern, '\\');
            }
        }

        // Match patterns with the classes list
        $regexps = $this->patternsToRegexps($patterns);

        foreach ($classes as $class) {
            $class = ltrim($class, '\\');

            if ($this->matchAnyRegexps($class, $regexps)) {
                $expanded[] = $class;
            }
        }

        return array_unique($expanded);
    }
1118012
static public function from($class)
        {
            if (is_object($class)) {
                $class = get_class($class);
            }

            if (empty(self::$prototypes[$class])) {
                self::$prototypes[$class] = new static($class);
            }

            return self::$prototypes[$class];
        }
1144979
protected function classes()
    {
        list($items, $pattern) = array(array(), '/\\.[^.\\s]{3,4}$/');

        $files = glob($this->commands . '/*.php');

        $path = strlen($this->commands . DIRECTORY_SEPARATOR);

        foreach ((array) $files as $file) {
            $substring = substr($file, $path);

            $class = preg_replace($pattern, '', $substring);

            $class = $this->namespace . '\\' . $class;

            $reflection = new \ReflectionClass($class);

            $reflection->isAbstract() || $items[] = $class;
        }

        return $items;
    }
781350
public static function getProperties($classes)
    {
        array_reverse($classes);
        $properties = array();
        foreach ($classes as $class) {
            foreach ($class->getProperties() as $property) {
                $properties[$property->getName()] = $property;
            }
        }

        return $properties;
    }
1053062
public function makeCollection(array $values, $class = null)
    {
        $collection = new Collection($values);
    
        if (!is_null($class) && class_exists($class)) {
            $model = new $class();
        
            if ($model instanceof Model) {
                foreach ($collection as $key => $item) {
                    $collection[$key] = $model->newInstance($item);
                }
            }
        }
    
        return $collection;
    }
235290
function &ordinaryClasses()
    {
        $classes = NULL;
        foreach ($this->_classes as $name => $class) {
            if ($class->isOrdinaryClass()) {
                $classes[$name] =& $this->_classes[$name];
            }
        }

        return $classes;
    }
879337
protected function normalizeAsArray($objects) : array
    {
        $key = $this->relation;

        if (!is_array($objects) && !$objects instanceof Collection) {
            throw new MappingException("column '$key' should be of type array or collection");
        }

        if ($objects instanceof Collection) {
            $objects = $objects->all();
        }

        $normalizedObjects = [];

        foreach ($objects as $object) {
            $wrapper = $this->factory->make($object);
            $normalizedObjects[] = $wrapper->getEntityAttributes();
        }

        if ($this->asJson) {
            $normalizedObjects = json_encode($normalizedObjects);
        }

        return [$key => $normalizedObjects];
    }
740492
protected function normalizeUsedClasses(array $usedClasses)
    {
        $normalized = array();
        foreach ($usedClasses as $tuple) {
            $tuple[0] = $tuple[0]->toAbsolute();

            if (array_key_exists(1, $tuple)) {
                if (!$tuple[1]->isShortName()) {
                    throw new Exception\InvalidUsedClassAliasException($tuple[1]);
                }

                $normalized[] = $tuple;
            } else {
                $normalized[] = array($tuple[0], $tuple[0]->shortName());
            }
        }

        return $normalized;
    }
551446
protected function createObjects($rows)
    {
        $models = [];

        foreach ($rows as $key => $row) {
            $models[$key] = $this->createObject($row);
        }

        return $models;
    }
574163
protected function getCommandClasses(array $modules)
    {
        $classes = [];
        foreach ($modules as $nameSpace => $path) {
            $classes = array_merge($classes, $this->getClasses($nameSpace, $path));
        }
        return $classes;
    }
1047353
private function loadInterfaces(array $hierarchy, array $classes)
    {
        $interfaces = [];

        foreach ($classes as $class) {
            foreach ($class->getInterfaces() as $interface) {
                if (isset($interfaces[$interface->name])) {
                    continue;
                }

                $interfaces[$interface->name] = true;
                $hierarchy[] = $interface;
            }

            $hierarchy[] = $class;
        }

        return $hierarchy;
    }
60291
public function body_class( $classes ) {

		global $pods;

		if ( defined( 'PODS_DISABLE_BODY_CLASSES' ) && PODS_DISABLE_BODY_CLASSES ) {
			return $classes;
		}

		$classes[] = 'pods';

		$uri = explode( '?', self::$exists['uri'] );
		$uri = explode( '#', $uri[0] );

		$class = str_replace( array( '*', '/' ), array( '_w_', '-' ), $uri[0] );
		$class = sanitize_title( $class );
		$class = str_replace( array( '_', '--', '--' ), '-', $class );
		$class = trim( $class, '-' );

		$classes[] = 'pod-page-' . $class;

		if ( is_object( $pods ) && ! is_wp_error( $pods ) ) {
			$class     = sanitize_title( $pods->pod );
			$class     = str_replace( array( '_', '--', '--' ), '-', $class );
			$class     = trim( $class, '-' );
			$classes[] = 'pod-' . $class;
		}

		if ( is_object( $pods ) && ! is_wp_error( $pods ) && isset( $pods->body_classes ) ) {
			$classes[] = $pods->body_classes;
		}

		return apply_filters( 'pods_body_class', $classes, $uri );
	}
808399
public function generateCommands(array $classes = [])
    {
        $classes  = $this->readApis($classes);
        $token    = $this->token->read();
        $commands = [];

        foreach ($classes as $class) {
            $api = new \ReflectionClass($class);

            foreach ($api->getMethods(\ReflectionMethod::IS_PUBLIC) as $method) {
                if (0 !== strpos($method->getName(), '__')) { //skip magics
                    $command                       = $this->generateCommand($api->getShortName(), $method, $token);
                    $commands[$command->getName()] = $command;
                }
            }
        }

        return $commands;
    }
917746
protected function getUnsequencedClasses(array $sequences, array $classes = null)
    {
        $unsequencedClasses = array();

        if (is_null($classes)) {
            $classes = array_keys($sequences);
        }

        foreach ($classes as $class) {
            // might not be set if depends on ordered fixture
            if (isset($sequences[$class]) && $sequences[$class] === -1) {
                $unsequencedClasses[] = $class;
            }
        }

        return $unsequencedClasses;
    }
895600
public function setClasses($classes)
    {
        if (!\is_array($classes)) {
            $classes = \explode(' ', $classes);
        }
        $this->classes = $classes;

        return $this;
    }
913378
protected function convertToObject($arrayElements)
	{
		$objects = array();
		
		foreach ($arrayElements as $key => $value) {
			$object = new \stdClass();
			$object->name = $key;
			$object->value = $value;
			$objects[] = $object;
		}

		return $objects;
	}