1
0
Fork 0

Undefined or default return points fixed.

pull/5162/head
Niels Keurentjes 2016-04-07 00:52:50 +02:00
parent 40c14709f7
commit e6f21137ad
11 changed files with 14 additions and 13 deletions

View File

@ -69,7 +69,7 @@ EOT
);
}
return;
return 0;
}
$binary = $input->getArgument('binary');

View File

@ -70,7 +70,7 @@ EOT
if ($input->getOption('list')) {
return $this->listScripts();
} elseif (!$input->getArgument('script')) {
throw new \RunTimeException('Missing required argument "script"');
throw new \RuntimeException('Missing required argument "script"');
}
$script = $input->getArgument('script');

View File

@ -89,7 +89,7 @@ EOT
if ($input->getOption('tree') && ($input->getOption('all') || $input->getOption('available'))) {
$io->writeError('The --tree (-t) option is not usable in combination with --all or --available (-a)');
return;
return 0;
}
// init repos

View File

@ -69,7 +69,7 @@ class HgDownloader extends VcsDownloader
public function getLocalChanges(PackageInterface $package, $path)
{
if (!is_dir($path.'/.hg')) {
return;
return null;
}
$this->process->execute('hg st', $output, realpath($path));

View File

@ -73,7 +73,7 @@ class SvnDownloader extends VcsDownloader
public function getLocalChanges(PackageInterface $package, $path)
{
if (!$this->hasMetadataRepository($path)) {
return;
return null;
}
$this->process->execute('svn status --ignore-externals', $output, $path);

View File

@ -25,6 +25,7 @@ use Composer\Util\Platform;
use Composer\Util\ProcessExecutor;
use Composer\Util\RemoteFilesystem;
use Composer\Util\Silencer;
use Seld\JsonLint\DuplicateKeyException;
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
use Composer\EventDispatcher\EventDispatcher;
use Composer\Autoload\AutoloadGenerator;
@ -270,7 +271,7 @@ class Factory
$jsonParser = new JsonParser;
try {
$jsonParser->parse(file_get_contents($localConfig), JsonParser::DETECT_KEY_CONFLICTS);
} catch (\Seld\JsonLint\DuplicateKeyException $e) {
} catch (DuplicateKeyException $e) {
$details = $e->getDetails();
$io->writeError('<warning>Key '.$details['key'].' is a duplicate in '.$localConfig.' at line '.$details['line'].'</warning>');
}

View File

@ -83,7 +83,7 @@ abstract class BaseExcludeFilter
$line = trim($line);
if (!$line || 0 === strpos($line, '#')) {
return;
return null;
}
return call_user_func($lineParser, $line);

View File

@ -69,12 +69,9 @@ class GitExcludeFilter extends BaseExcludeFilter
{
$parts = preg_split('#\s+#', $line);
if (count($parts) != 2) {
return null;
}
if ($parts[1] === 'export-ignore') {
if (count($parts) == 2 && $parts[1] === 'export-ignore') {
return $this->generatePattern($parts[0]);
}
return null;
}
}

View File

@ -56,6 +56,7 @@ class ArrayRepository extends BaseRepository
}
}
}
return null;
}
/**

View File

@ -58,6 +58,7 @@ class RepositoryManager
return $package;
}
}
return null;
}
/**

View File

@ -70,7 +70,7 @@ final class TlsHelper
}
if (!isset($info['subject']['commonName'])) {
return;
return null;
}
$commonName = strtolower($info['subject']['commonName']);
@ -82,6 +82,7 @@ final class TlsHelper
if (0 === strpos($name, 'DNS:')) {
return strtolower(ltrim(substr($name, 4)));
}
return null;
}, $subjectAltNames));
$subjectAltNames = array_values($subjectAltNames);
}