original_string: public function getRequiredPackages()
      {
          $packages = [];
  
          $content = $this->getFileContents('composer.json');
  
          foreach (['require', 'require-dev'] as $key) {
              if (!isset($content[$key])) {
                  continue;
              }
  
              foreach ($content[$key] as $name => $version) {
                  if (!strstr($name, '/')) {
                      continue;
                  }
  
                  $packages[$name] = [
                      'name' => $name,
                      'version' => $version,
                      'devDependency' => $key === 'require-dev',
                  ];
              }
          }
  
          if (empty($packages)) {
              throw new LogicException('We couldn\'t find any required packages.');
          }
  
          return $packages;
      }
code: public function getRequiredPackages()
      {
          $packages = [];
  
          $content = $this->getFileContents('composer.json');
  
          foreach (['require', 'require-dev'] as $key) {
              if (!isset($content[$key])) {
                  continue;
              }
  
              foreach ($content[$key] as $name => $version) {
                  if (!strstr($name, '/')) {
                      continue;
                  }
  
                  $packages[$name] = [
                      'name' => $name,
                      'version' => $version,
                      'devDependency' => $key === 'require-dev',
                  ];
              }
          }
  
          if (empty($packages)) {
              throw new LogicException('We couldn\'t find any required packages.');
          }
  
          return $packages;
      }
code_tokens: public function getRequiredPackages ( ) { $ packages = [ ] ; $ content = $ this -> getFileContents ( 'composer.json' ) ; foreach ( [ 'require' , 'require-dev' ] as $ key ) { if ( ! isset ( $ content [ $ key ] ) ) { continue ; } foreach ( $ content [ $ key ] as $ name => $ version ) { if ( ! strstr ( $ name , '/' ) ) { continue ; } $ packages [ $ name ] = [ 'name' => $ name , 'version' => $ version , 'devDependency' => $ key === 'require-dev' , ] ; } } if ( empty ( $ packages ) ) { throw new LogicException ( 'We couldn\'t find any required packages.' ) ; } return $ packages ; }
docstring: Get required package versions.
  
  @throws \LogicException
  
  @return array
docstring_tokens: Get required package versions .