original_string: public static function fromPackageFile($composerJson)
      {
          if (file_exists($composerJson) === false) {
              throw new ComposerJsonNotFoundException("File {$composerJson} not found.");
          }
  
          $config = Config::load($composerJson);
          $autoload = $config->get('autoload.psr-4');
  
          $composerJsonDirectory = dirname($composerJson);
  
          $keys = array_keys($autoload);
          $namespace = array_shift($keys);
  
          $values = array_values($autoload);
          $namespaceDirectory = array_shift($values);
          $namespaceDirectory = realpath($composerJsonDirectory . '/' . $namespaceDirectory);
  
          return new self($namespace, $namespaceDirectory);
      }
code: public static function fromPackageFile($composerJson)
      {
          if (file_exists($composerJson) === false) {
              throw new ComposerJsonNotFoundException("File {$composerJson} not found.");
          }
  
          $config = Config::load($composerJson);
          $autoload = $config->get('autoload.psr-4');
  
          $composerJsonDirectory = dirname($composerJson);
  
          $keys = array_keys($autoload);
          $namespace = array_shift($keys);
  
          $values = array_values($autoload);
          $namespaceDirectory = array_shift($values);
          $namespaceDirectory = realpath($composerJsonDirectory . '/' . $namespaceDirectory);
  
          return new self($namespace, $namespaceDirectory);
      }
code_tokens: public static function fromPackageFile ( $ composerJson ) { if ( file_exists ( $ composerJson ) === false ) { throw new ComposerJsonNotFoundException ( "File {$composerJson} not found." ) ; } $ config = Config :: load ( $ composerJson ) ; $ autoload = $ config -> get ( 'autoload.psr-4' ) ; $ composerJsonDirectory = dirname ( $ composerJson ) ; $ keys = array_keys ( $ autoload ) ; $ namespace = array_shift ( $ keys ) ; $ values = array_values ( $ autoload ) ; $ namespaceDirectory = array_shift ( $ values ) ; $ namespaceDirectory = realpath ( $ composerJsonDirectory . '/' . $ namespaceDirectory ) ; return new self ( $ namespace , $ namespaceDirectory ) ; }
docstring: Create a new matcher package from composer.json
  
  @param string $composerJson composer.json path
  
  @throws \expect\package\ComposerJsonNotFoundException
docstring_tokens: Create a new matcher package from composer . json