original_string: protected static function _getThirdParty($package)
      {
          list($vendor, $packageName) = packageSplit($package);
          $packageJson = normalizePath(VENDOR_INCLUDE_PATH . "/{$vendor}/{$packageName}/composer.json");
  
          if (is_readable($packageJson)) {
              $installedJson = normalizePath(VENDOR_INCLUDE_PATH . "composer/installed.json");
              if (is_readable($installedJson)) {
                  $json = (array)json_decode(file_get_contents($installedJson), true);
                  foreach ($json as $pkg) {
                      if (strtolower($pkg['name']) === strtolower($package)) {
                          return new ThirdPartyPackage($package, dirname($packageJson), $pkg['version']);
                      }
                  }
              }
          }
  
          return false;
      }
code: protected static function _getThirdParty($package)
      {
          list($vendor, $packageName) = packageSplit($package);
          $packageJson = normalizePath(VENDOR_INCLUDE_PATH . "/{$vendor}/{$packageName}/composer.json");
  
          if (is_readable($packageJson)) {
              $installedJson = normalizePath(VENDOR_INCLUDE_PATH . "composer/installed.json");
              if (is_readable($installedJson)) {
                  $json = (array)json_decode(file_get_contents($installedJson), true);
                  foreach ($json as $pkg) {
                      if (strtolower($pkg['name']) === strtolower($package)) {
                          return new ThirdPartyPackage($package, dirname($packageJson), $pkg['version']);
                      }
                  }
              }
          }
  
          return false;
      }
code_tokens: protected static function _getThirdParty ( $ package ) { list ( $ vendor , $ packageName ) = packageSplit ( $ package ) ; $ packageJson = normalizePath ( VENDOR_INCLUDE_PATH . "/{$vendor}/{$packageName}/composer.json" ) ; if ( is_readable ( $ packageJson ) ) { $ installedJson = normalizePath ( VENDOR_INCLUDE_PATH . "composer/installed.json" ) ; if ( is_readable ( $ installedJson ) ) { $ json = ( array ) json_decode ( file_get_contents ( $ installedJson ) , true ) ; foreach ( $ json as $ pkg ) { if ( strtolower ( $ pkg [ 'name' ] ) === strtolower ( $ package ) ) { return new ThirdPartyPackage ( $ package , dirname ( $ packageJson ) , $ pkg [ 'version' ] ) ; } } } } return false ; }
docstring: Tries to get package that represents a third party library.
  
  - Package must exists on `VENDOR_PATH/vendor-name/package-name/`.
  - Its composer.json file must exists as well.
  - Package must be registered on Composer's "installed.json" file.
  
  @param string $package Full package name
  @return bool|\CMS\Core\Package\ThirdPartyPackage
docstring_tokens: Tries to get package that represents a third party library .