original_string: protected function getPackages($type)
      {
          $packages = $this->packages->all();
  
          if (! is_null($type)) {
              $packages = $packages->where('type', $type);
          }
  
          $results = array();
  
          foreach ($packages->sortBy('basename') as $package) {
              $results[] = $this->getPackageInformation($package);
          }
  
          return array_filter($results);
      }
code: protected function getPackages($type)
      {
          $packages = $this->packages->all();
  
          if (! is_null($type)) {
              $packages = $packages->where('type', $type);
          }
  
          $results = array();
  
          foreach ($packages->sortBy('basename') as $package) {
              $results[] = $this->getPackageInformation($package);
          }
  
          return array_filter($results);
      }
code_tokens: protected function getPackages ( $ type ) { $ packages = $ this -> packages -> all ( ) ; if ( ! is_null ( $ type ) ) { $ packages = $ packages -> where ( 'type' , $ type ) ; } $ results = array ( ) ; foreach ( $ packages -> sortBy ( 'basename' ) as $ package ) { $ results [ ] = $ this -> getPackageInformation ( $ package ) ; } return array_filter ( $ results ) ; }
docstring: Get all Packages.
  
  @return array
docstring_tokens: Get all Packages .