1
0
Fork 0
pull/3894/merge
Jordi Boggiano 2015-04-15 01:21:03 +01:00
parent 8a154d7300
commit dbfd47eeca
7 changed files with 239 additions and 238 deletions

View File

@ -173,7 +173,7 @@ class ClassMapGenerator
if ($name[0] === ':') {
// This is an XHP class, https://github.com/facebook/xhp
$name = 'xhp'.substr(str_replace(array('-', ':'), array('_', '__'), $name), 1);
} else if ($matches['type'][$i] === 'enum') {
} elseif ($matches['type'][$i] === 'enum') {
// In Hack, something like:
// enum Foo: int { HERP = '123'; }
// The regex above captures the colon, which isn't part of

View File

@ -19,7 +19,6 @@ use Composer\Plugin\PluginEvents;
use Composer\Package\PackageInterface;
use Composer\Repository\RepositoryInterface;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Helper\TableStyle;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

View File

@ -389,11 +389,11 @@ EOT
$licenses = $package->getLicense();
foreach($licenses as $licenseId) {
foreach ($licenses as $licenseId) {
$license = $spdxLicense->getLicenseByIdentifier($licenseId); // keys: 0 fullname, 1 osi, 2 url
// is license OSI approved?
if($license[1] === true) {
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]);

View File

@ -126,6 +126,7 @@ class ConsoleIO extends BaseIO
if (true === $stderr && $this->output instanceof ConsoleOutputInterface) {
$this->output->getErrorOutput()->write($messages, $newline);
$this->lastMessageErr = join($newline ? "\n" : '', (array) $messages);
return;
}

View File

@ -154,7 +154,8 @@ class Git
}
}
private function isAuthenticationFailure ($url, &$match) {
private function isAuthenticationFailure($url, &$match)
{
if (!preg_match('{(https?://)([^/]+)(.*)$}i', $url, $match)) {
return false;
}

View File

@ -34,7 +34,7 @@ class SpdxLicense
private function loadLicenses()
{
if(is_array($this->licenses)) {
if (is_array($this->licenses)) {
return $this->licenses;
}
@ -71,7 +71,7 @@ class SpdxLicense
public function getIdentifierByName($name)
{
foreach ($this->licenses as $identifier => $licenseData) {
if($licenseData[0] === $name) { // key 0 = fullname
if ($licenseData[0] === $name) { // key 0 = fullname
return $identifier;
}
}

View File

@ -42,14 +42,14 @@ class SpdxLicensesUpdater
$trs = $xPath->query('//table//tbody//tr');
// iterate over each row in the table
foreach($trs as $tr) {
foreach ($trs as $tr) {
$tds = $tr->getElementsByTagName('td'); // get the columns in this row
if($tds->length < 4) {
if ($tds->length < 4) {
throw new \Exception('Obtaining the license table failed. Wrong table format. Found less than 4 cells in a row.');
}
if(trim($tds->item(3)->nodeValue) == 'License Text') {
if (trim($tds->item(3)->nodeValue) == 'License Text') {
$fullname = trim($tds->item(0)->nodeValue);
$identifier = trim($tds->item(1)->nodeValue);
$osiApproved = ((isset($tds->item(2)->nodeValue) && $tds->item(2)->nodeValue === 'Y')) ? true : false;