public function getPackage($name = null)
    {
        if (null === $name) {
            if (null === $this->defaultPackage) {
                throw new LogicException('There is no default asset package, configure one first.');
            }

            return $this->defaultPackage;
        }

        if (!isset($this->packages[$name])) {
            throw new InvalidArgumentException(sprintf('There is no "%s" asset package.', $name));
        }

        return $this->packages[$name];
    }
public function getPackage($name = null)
    {
        if (null === $name) {
            if (null === $this->defaultPackage) {
                throw new LogicException('There is no default asset package, configure one first.');
            }

            return $this->defaultPackage;
        }

        if (!isset($this->packages[$name])) {
            throw new InvalidArgumentException(sprintf('There is no "%s" asset package.', $name));
        }

        return $this->packages[$name];
    }
public function getPackage ( $ name = null ) { if ( null === $ name ) { if ( null === $ this -> defaultPackage ) { throw new LogicException ( 'There is no default asset package, configure one first.' ) ; } return $ this -> defaultPackage ; } if ( ! isset ( $ this -> packages [ $ name ] ) ) { throw new InvalidArgumentException ( sprintf ( 'There is no "%s" asset package.' , $ name ) ) ; } return $ this -> packages [ $ name ] ; }
Returns an asset package.

@param string $name The name of the package or null for the default package

@return PackageInterface An asset package

@throws InvalidArgumentException If there is no package by that name
@throws LogicException           If no default package is defined
Returns an asset package .