original_string: public function writeCache($path, $packages)
      {
          $data = array();
  
          foreach ($packages->all() as $key => $package) {
              $properties = ($package instanceof Collection) ? $package->all() : $package;
  
              // Normalize to *nix paths.
              $properties['path'] = str_replace('\\', '/', $properties['path']);
  
              //
              ksort($properties);
  
              $data[] = $properties;
          }
  
          //
          $data = var_export($data, true);
  
          $content = <<<PHP
  <?php
  
  return $data;
  
  PHP;
  
          $this->files->put($path, $content);
      }
code: public function writeCache($path, $packages)
      {
          $data = array();
  
          foreach ($packages->all() as $key => $package) {
              $properties = ($package instanceof Collection) ? $package->all() : $package;
  
              // Normalize to *nix paths.
              $properties['path'] = str_replace('\\', '/', $properties['path']);
  
              //
              ksort($properties);
  
              $data[] = $properties;
          }
  
          //
          $data = var_export($data, true);
  
          $content = <<<PHP
  <?php
  
  return $data;
  
  PHP;
  
          $this->files->put($path, $content);
      }
code_tokens: public function writeCache ( $ path , $ packages ) { $ data = array ( ) ; foreach ( $ packages -> all ( ) as $ key => $ package ) { $ properties = ( $ package instanceof Collection ) ? $ package -> all ( ) : $ package ; // Normalize to *nix paths. $ properties [ 'path' ] = str_replace ( '\\' , '/' , $ properties [ 'path' ] ) ; // ksort ( $ properties ) ; $ data [ ] = $ properties ; } // $ data = var_export ( $ data , true ) ; $ content =  <<<PHP
  <?php
  
  return $data;
  
  PHP ; $ this -> files -> put ( $ path , $ content ) ; }
docstring: Write the service cache file to disk.
  
  @param  string $path
  @param  array  $packages
  @return void
docstring_tokens: Write the service cache file to disk .