original_string: public function register($assets, $type, $position, $order = 0, $mode = 'default')
      {
          if (! in_array($type, $this->types)) {
              throw new InvalidArgumentException("Invalid assets type [${type}]");
          } else if (! in_array($mode, array('default', 'inline', 'view'))) {
              throw new InvalidArgumentException("Invalid assets mode [${mode}]");
          }
  
          // The assets type and mode are valid.
          else if (! empty($items = $this->parseAssets($assets, $order, $mode))) {
              // We will merge the items for the specified type and position.
  
              Arr::set($this->positions, $key = "${type}.${position}", array_merge(
                  Arr::get($this->positions, $key, array()), $items
              ));
          }
      }
code: public function register($assets, $type, $position, $order = 0, $mode = 'default')
      {
          if (! in_array($type, $this->types)) {
              throw new InvalidArgumentException("Invalid assets type [${type}]");
          } else if (! in_array($mode, array('default', 'inline', 'view'))) {
              throw new InvalidArgumentException("Invalid assets mode [${mode}]");
          }
  
          // The assets type and mode are valid.
          else if (! empty($items = $this->parseAssets($assets, $order, $mode))) {
              // We will merge the items for the specified type and position.
  
              Arr::set($this->positions, $key = "${type}.${position}", array_merge(
                  Arr::get($this->positions, $key, array()), $items
              ));
          }
      }
code_tokens: public function register ( $ assets , $ type , $ position , $ order = 0 , $ mode = 'default' ) { if ( ! in_array ( $ type , $ this -> types ) ) { throw new InvalidArgumentException ( "Invalid assets type [${type}]" ) ; } else if ( ! in_array ( $ mode , array ( 'default' , 'inline' , 'view' ) ) ) { throw new InvalidArgumentException ( "Invalid assets mode [${mode}]" ) ; } // The assets type and mode are valid. else if ( ! empty ( $ items = $ this -> parseAssets ( $ assets , $ order , $ mode ) ) ) { // We will merge the items for the specified type and position. Arr :: set ( $ this -> positions , $ key = "${type}.${position}" , array_merge ( Arr :: get ( $ this -> positions , $ key , array ( ) ) , $ items ) ) ; } }
docstring: Register new Assets.
  
  @param  string|array $assets
  @param  string $type
  @param  string $position
  @param  int $order
  @param  string $mode
  
  @return void
  @throws \InvalidArgumentException
docstring_tokens: Register new Assets .