Make multiple objects using the container.

@param string [] $classes

@return object[]
191017
protected function make(array $classes)
    {
        foreach ($classes as $index => $class) {
            try {
                $classes[$index] = $this->container->make($class);
            } catch (Throwable $e) {
                unset($classes[$index]);
                $this->report($e instanceof Exception ? $e : new FatalThrowableError($e));
            }
        }

        return array_values($classes);
    }
11120
public function getSubAdminClasses(array $classes)
    {
        $classCollection = [];

        foreach ($classes as $key => $class) {
            if ($this->usableClass($key)) {
                $classCollection[] = [$key => $this->getSubAdminClasses($class)];
                continue;
            }

            if ($this->usableClass($class)) {
                $classCollection[] = $class;
                continue;
            }
        }

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

        return $this;
    }
883401
protected function bootstrap(array $classes): array
    {
        foreach ($classes as $index => $class) {
            $classes[$index] = $this->app->make($class)->bootstrap();
        }

        return $classes;
    }
879218
public static function merge(array $containers)
    {
        $attributeBags = array();

        $weight = 0;
        foreach($containers as $container)
        {
            $weight = max($weight, $container->getWeight());
            $attributeBags[] = $container->getAttributeBag();
        }

        $container = new static();
        $container->attributeBag = AttributeBag::merge($attributeBags);
        $container->weight = $weight;
        
        return $container;
    }
1089078
private static function cleanClasses(array $classes): array
  {
    $ret = [];

    foreach ($classes as $class)
    {
      $tmp = Cast::toManString($class, '');
      if ($tmp!=='') $ret[] = $tmp;
    }

    return array_unique($ret);
  }
1043330
protected function createInstance($classes, $properties) {
        $first = array_shift($classes);
        $instance = $first->createInstanceWithProperties($properties);
        foreach ($classes as $class) {
            $instance = $this->getResource('');
            $instance->setType($class);
        }
        return $instance;
    }
589917
public function make(array $attributes = [])
    {
        if ($this->amount === null) {
            return tap($this->makeInstance($attributes), function ($instance) {
                $this->callAfterMaking(collect([$instance]));
            });
        }

        if ($this->amount < 1) {
            return (new $this->class)->newCollection();
        }

        $instances = (new $this->class)->newCollection(array_map(function () use ($attributes) {
            return $this->makeInstance($attributes);
        }, range(1, $this->amount)));

        $this->callAfterMaking($instances);

        return $instances;
    }
1152071
public function make(array $attributes = [])
    {
        if ($this->amount === null) {
            return $this->makeInstance($attributes);
        }

        if ($this->amount < 1) {
            return (new $this->class)->newCollection();
        }

        return (new $this->class)->newCollection(array_map(function () use ($attributes) {
            return $this->makeInstance($attributes);
        }, range(1, $this->amount)));
    }
1251918
public function toggleClasses( array $classes, $toggle = null ) {
		if ( $toggle === null ) {
			$this->classes = array_diff(
				array_merge( $this->classes, $classes ),
				array_intersect( $this->classes, $classes )
			);
		} elseif ( $toggle ) {
			$this->classes = array_merge( $this->classes, $classes );
		} else {
			$this->classes = array_diff( $this->classes, $classes );
		}
		return $this;
	}
522375
public function setClasses( $classes )
	{
		$this->attributes['class']	= array();
		if( is_string( $classes ) )
			$classes	= explode( " ", $classes );
		if( !is_array( $classes ) && !( $classes instanceof ArrayIterator ) )
			throw new InvalidArgumentException( 'Class attribute must be string, array or iterator' );
		foreach( $classes as $class )
			$this->addClass( $class );
	}
653332
public final function toClass(string $class): ?array
    {
        $data = null;
        if (!empty($this->data)) {
            $data = $this->data;
            foreach ($data as &$dat) {
                $datClass = new $class();
                foreach ((array) $dat as $key => $value) {
                    $datClass->{$key} = $value;
                }
                $dat = $datClass;
            }
        }

        return $data;
    }
635581
public function import(array $classes)
    {
        foreach ($classes as $class => $alias) {
            if (is_integer($class)) {
                $class = $alias;
                $alias = ClassHelper::getSimpleName($class);
            }
            if (isset($this->imports[$alias])) {
                throw new \RuntimeException("Alias $alias for $class exists, previous is "
                                            . $this->imports[$alias]);
            }
            $this->imports[$alias] = $class;
        }
        return $this;
    }
1297832
public function make(array $attributes = [])
    {
        if ($this->amount === null) {
            return $this->makeInstance($attributes);
        } else {
            $results = [];

            for ($i = 0; $i < $this->amount; $i++) {
                $results[] = $this->makeInstance($attributes);
            }
            
            return new Collection($results);
        }
    }
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;
    }
146641
public function setClassAttr($classes)
    {
        if (is_array($classes)) {
            $classes = implode(' ', $classes);
        }

        $this->classAttr = $classes;

        return $this;
    }
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;
    }