Undefined or default return points fixed.

main
Niels Keurentjes 8 years ago
parent 40c14709f7
commit e6f21137ad

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

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save