Create an array of AssetInterface objects for a group.

@param $name
@throws \InvalidArgumentException for undefined assets
@return array
333658
protected function createAssetArray($name)
    {
        $config = $this->getConfig($name, 'assets', array());
        $assets = array();
        foreach ($config as $asset) {
            // existing asset definition
            if ($this->assets->has($asset)) {
                $assets[] = $this->assets->get($asset);
            }
            // looks like a file
            elseif (str_contains($asset, array('/', '.', '-'))) {
                $assets[] = $this->parseAssetDefinition($asset);
            }
            // unknown asset
            else {
                throw new \InvalidArgumentException("No asset '$asset' defined");
            }
        }

        return $assets;
    }
778622
private function loadAssets()
    {
        if ($this->loadedAssets) {
            return;
        }

        foreach ((array) $this->registerAssets() as $asset) {
            if (!$asset instanceof AssetInterface) {
                throw new \InvalidArgumentException(sprintf(
                    '%s::registerAssets() should return a list of Bolt\Asset\AssetInterface objects. Got: %s',
                    static::class,
                    is_object($asset) ? get_class($asset) : gettype($asset)
                ));
            }

            $this->addAsset($asset);
        }

        $this->loadedAssets = true;
    }
941043
function Field($name)
    {
        if (!array_key_exists($name, $this->fields))
            throw new \InvalidArgumentException($name . ' is not a valid field for '. $this->name);
        
        return $this->fields[$name];
    }
364550
public function newAsset($name, $group = null, $content = '')
    {
        $group = $this->detectGroup($name, $group);

        return (new Asset())
                ->setName($name)
                ->setGroup($group)
                ->setContent($content)
                ->setMimeType($this->namer->guessMimeType($name, $group))
                ->lazyLoadBy($this);
    }
395430
public function parseTable($name): array
    {
        if ($name instanceof Model) {
            return [$name->alias(), $name->name()];
        }

        if (is_array($name)) {
            return [key($name), current($name)];
        }

        if (is_scalar($name)) {
            return static::parseName($name);
        }

        return [null, $name];
    }
1168652
public static function getArgumentsForCall($name, $arguments): array
    {
        // uppercase the method name
        $name = strtoupper($name);

        if ($name === 'ANY') {
            // allowed any of the methods
            $name = self::ALLOWED_METHODS;
        } else if (! in_array($name, self::ALLOWED_METHODS)) {
            throw new InvalidArgumentException('Route::method must be one of: ' . implode(', ', self::ALLOWED_METHODS));
        }

        // add the name to the arguments
        array_unshift($arguments, $name);

        // return the arguments
        return $arguments;
    }
1305539
public function getByName($name)
    {
        $group = new Group(
            $this->getContext(),
            new ResourcePathServiceOperation($this->getContext(), $this->getResourcePath(), "getbyname", array($name))
        );
        return $group;
    }
192829
public function factory($name)
    {
        if (isset($this->factories[$name])) {
            return $this->factories[$name];
        }

        if (class_exists($class = $this->inflect($name))) {
            return $this->factories[$name] = new $class();
        }

        throw new InvalidArgumentException("Unsupported factory [$name].");
    }
1000099
public static function lookupByName($name)
    {
        if (empty($name)) {
            throw new \InvalidArgumentException('Argument "name" cannot be empty');
        }

        if (!isset(self::$methods_config[$name])) {
            throw new \InvalidArgumentException('Method "' . $name . '" doesn\'t exist');
        }

        return self::$methods_config[$name];
    }
205892
protected function extractComponentBuilder($name) {
		$componentBuilder = $this->components[$name];

		if (!$componentBuilder) {
			return [$name, false];
		}

		return [$componentBuilder['builder'], $componentBuilder['singleton']];
	}
215684
public function getTabFromGroup(string $name, string $group): TabInterface
    {
        if (!isset($this->tabGroups[$group])) {
            throw new \InvalidArgumentException(sprintf('Requested group named "%s" is not found. Did you forget to tag the service?', $group));
        }

        foreach ($this->tabGroups[$group]->getTabs() as $tab) {
            if ($tab->getName() === $name) {
                return $tab;
            }
        }

        throw new \InvalidArgumentException(sprintf('Requested tab "%s" from group "%s" is not found. Did you forget to tag the service?', $name, $group));
    }
570699
public function dataProvider(string $name): DataProviderInterface
    {
        if (isset($this->dataProviders[$name])) {
            return $this->dataProviders[$name];
        }
        throw new \InvalidArgumentException(sprintf(
            "Requested data provider '%s' could not be found; does the content type exist, or provider not specified?",
            $name
        ));
    }
212707
public function getArguments($name)
    {
        if (null === $this->data) {
            $this->initializeProfile();
        }

        if (!isset($this->data['arguments'][$name])) {
            return array();
        }

        $arguments = array();
        foreach ($this->data['arguments'][$name] as $argument => $cost) {
            $arguments[$argument] = new Cost($cost);
        }

        return $arguments;
    }
456591
public function create($name)
    {
        $class = $this->class;
        /** @var Group $group */
        $group = new $class($name, $this->dispatcher);
        $this->groups[$group->getName()] = $group;

        return $group;
    }
1169298
protected function _loadCollection($name)
    {
        if ($name === self::DEFAULT_COLLECTION) {
            $class = $this->_collectionClass;
        } else {
            $class = Inflector::camelize(str_replace('-', '_', $name));
        }

        $className = App::className($class, 'Model/Filter', 'Collection');
        if (!$className) {
            throw new InvalidArgumentException(sprintf(
                'The collection class "%sCollection" does not exist',
                $class
            ));
        }

        $instance = new $className($this);
        if (!$instance instanceof FilterCollectionInterface) {
            throw new InvalidArgumentException(sprintf(
                'The collection must be instance of FilterCollectionInterface. ' .
                'Got instance of "%s" instead',
                get_class($instance)
            ));
        }

        return $instance;
    }
136828
public function get(string $name): RelationshipInterface
    {
        if (!$this->has($name)) {
            throw new \InvalidArgumentException('Relationship ' . $name . ' not available');
        }

        return $this->collection[$name];
    }
146618
protected function getAsset($name) {
		$path  = $this->assetsPath . DIRECTORY_SEPARATOR . $name;
		$asset = file_get_contents($path);
		
		if ($asset === false) {
			throw new InvalidPath('Unable to get asset "' . $name . '" by path "' . $path . '"');
		}
		
		return $asset;
	}