original_string: 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];
      }
code: 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];
      }
code_tokens: 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 ] ; }
docstring: 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
docstring_tokens: Returns an asset package .