original_string: protected function printLicenses(CompletePackageInterface $package)
      {
          $spdxLicense = new SpdxLicense;
  
          $licenses = $package->getLicense();
  
          foreach ($licenses as $licenseId) {
              $license = $spdxLicense->getLicenseByIdentifier($licenseId); // keys: 0 fullname, 1 osi, 2 url
  
              if (!$license) {
                  $out = $licenseId;
              } else {
                  // is license OSI approved?
                  if ($license[1] === true) {
                      $out = sprintf('%s (%s) (OSI approved) %s', $license[0], $licenseId, $license[2]);
                  } else {
                      $out = sprintf('%s (%s) %s', $license[0], $licenseId, $license[2]);
                  }
              }
  
              $this->getIO()->write('<info>license</info>  : ' . $out);
          }
      }
code: protected function printLicenses(CompletePackageInterface $package)
      {
          $spdxLicense = new SpdxLicense;
  
          $licenses = $package->getLicense();
  
          foreach ($licenses as $licenseId) {
              $license = $spdxLicense->getLicenseByIdentifier($licenseId); // keys: 0 fullname, 1 osi, 2 url
  
              if (!$license) {
                  $out = $licenseId;
              } else {
                  // is license OSI approved?
                  if ($license[1] === true) {
                      $out = sprintf('%s (%s) (OSI approved) %s', $license[0], $licenseId, $license[2]);
                  } else {
                      $out = sprintf('%s (%s) %s', $license[0], $licenseId, $license[2]);
                  }
              }
  
              $this->getIO()->write('<info>license</info>  : ' . $out);
          }
      }
code_tokens: protected function printLicenses ( CompletePackageInterface $ package ) { $ spdxLicense = new SpdxLicense ; $ licenses = $ package -> getLicense ( ) ; foreach ( $ licenses as $ licenseId ) { $ license = $ spdxLicense -> getLicenseByIdentifier ( $ licenseId ) ; // keys: 0 fullname, 1 osi, 2 url if ( ! $ license ) { $ out = $ licenseId ; } else { // is license OSI approved? if ( $ license [ 1 ] === true ) { $ out = sprintf ( '%s (%s) (OSI approved) %s' , $ license [ 0 ] , $ licenseId , $ license [ 2 ] ) ; } else { $ out = sprintf ( '%s (%s) %s' , $ license [ 0 ] , $ licenseId , $ license [ 2 ] ) ; } } $ this -> getIO ( ) -> write ( '<info>license</info>  : ' . $ out ) ; } }
docstring: Prints the licenses of a package with metadata
  
  @param CompletePackageInterface $package
docstring_tokens: Prints the licenses of a package with metadata