original_string: protected function removeDuplicates()
      {
          foreach ($this->assets as $type => &$collection) {
  
              $pathCache = [];
              foreach ($collection as $key => $asset) {
  
                  if (!$path = array_get($asset, 'path')) {
                      continue;
                  }
  
                  if (isset($pathCache[$path])) {
                      array_forget($collection, $key);
                      continue;
                  }
  
                  $pathCache[$path] = true;
              }
  
          }
      }
code: protected function removeDuplicates()
      {
          foreach ($this->assets as $type => &$collection) {
  
              $pathCache = [];
              foreach ($collection as $key => $asset) {
  
                  if (!$path = array_get($asset, 'path')) {
                      continue;
                  }
  
                  if (isset($pathCache[$path])) {
                      array_forget($collection, $key);
                      continue;
                  }
  
                  $pathCache[$path] = true;
              }
  
          }
      }
code_tokens: protected function removeDuplicates ( ) { foreach ( $ this -> assets as $ type => & $ collection ) { $ pathCache = [ ] ; foreach ( $ collection as $ key => $ asset ) { if ( ! $ path = array_get ( $ asset , 'path' ) ) { continue ; } if ( isset ( $ pathCache [ $ path ] ) ) { array_forget ( $ collection , $ key ) ; continue ; } $ pathCache [ $ path ] = true ; } } }
docstring: Removes duplicate assets from the entire collection.
  @return void
docstring_tokens: Removes duplicate assets from the entire collection .