original_string: public function set(array $data)
      {
          $build = $this->build($data);
  
          if (empty($build['asset'])) {
              return false;
          }
  
          if (!empty($build['merge']) && is_array($build['asset'])) {
              if (isset($this->assets[$build['type']][$build['position']][$build['merge']])) {
                  $existing = $this->assets[$build['type']][$build['position']][$build['merge']]['asset'];
                  $this->assets[$build['type']][$build['position']][$build['merge']]['asset'] = array_merge($existing, $build['asset']);
              }
          }
  
          if (isset($this->assets[$build['type']][$build['position']][$build['key']])) {
              return false;
          }
  
          $this->assets[$build['type']][$build['position']][$build['key']] = $build;
          return $this->assets[$build['type']];
      }
code: public function set(array $data)
      {
          $build = $this->build($data);
  
          if (empty($build['asset'])) {
              return false;
          }
  
          if (!empty($build['merge']) && is_array($build['asset'])) {
              if (isset($this->assets[$build['type']][$build['position']][$build['merge']])) {
                  $existing = $this->assets[$build['type']][$build['position']][$build['merge']]['asset'];
                  $this->assets[$build['type']][$build['position']][$build['merge']]['asset'] = array_merge($existing, $build['asset']);
              }
          }
  
          if (isset($this->assets[$build['type']][$build['position']][$build['key']])) {
              return false;
          }
  
          $this->assets[$build['type']][$build['position']][$build['key']] = $build;
          return $this->assets[$build['type']];
      }
code_tokens: public function set ( array $ data ) { $ build = $ this -> build ( $ data ) ; if ( empty ( $ build [ 'asset' ] ) ) { return false ; } if ( ! empty ( $ build [ 'merge' ] ) && is_array ( $ build [ 'asset' ] ) ) { if ( isset ( $ this -> assets [ $ build [ 'type' ] ] [ $ build [ 'position' ] ] [ $ build [ 'merge' ] ] ) ) { $ existing = $ this -> assets [ $ build [ 'type' ] ] [ $ build [ 'position' ] ] [ $ build [ 'merge' ] ] [ 'asset' ] ; $ this -> assets [ $ build [ 'type' ] ] [ $ build [ 'position' ] ] [ $ build [ 'merge' ] ] [ 'asset' ] = array_merge ( $ existing , $ build [ 'asset' ] ) ; } } if ( isset ( $ this -> assets [ $ build [ 'type' ] ] [ $ build [ 'position' ] ] [ $ build [ 'key' ] ] ) ) { return false ; } $ this -> assets [ $ build [ 'type' ] ] [ $ build [ 'position' ] ] [ $ build [ 'key' ] ] = $ build ; return $ this -> assets [ $ build [ 'type' ] ] ; }
docstring: Sets an asset
  @param array $data
  @return bool|array
docstring_tokens: Sets an asset