Removed unneccesary elseifs

main
Simon Berger 4 years ago
parent 80a75e9959
commit 974e7ba296

@ -1094,7 +1094,8 @@ INITIALIZER;
if ($type === 'files') {
$autoloads[$this->getFileIdentifier($package, $path)] = $relativePath;
continue;
} elseif ($type === 'classmap') {
}
if ($type === 'classmap') {
$autoloads[] = $relativePath;
continue;
}

@ -339,7 +339,8 @@ EOT
if (file_exists($directory)) {
if (!is_dir($directory)) {
throw new \InvalidArgumentException('Cannot create project directory at "'.$directory.'", it exists as a file.');
} elseif (!$fs->isDirEmpty($directory)) {
}
if (!$fs->isDirEmpty($directory)) {
throw new \InvalidArgumentException('Project directory "'.$directory.'" is not empty.');
}
}

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

@ -465,7 +465,8 @@ class Config
if (in_array($scheme, array('http', 'git', 'ftp', 'svn'))) {
if ($this->get('secure-http')) {
throw new TransportException("Your configuration does not allow connections to $url. See https://getcomposer.org/doc/06-config.md#secure-http for details.");
} elseif ($io) {
}
if ($io) {
$host = parse_url($url, PHP_URL_HOST);
if (!isset($this->warnedHosts[$host])) {
$io->writeError("<warning>Warning: Accessing $host over $scheme which is an insecure protocol.</warning>");

@ -319,7 +319,8 @@ class Solver
throw new SolverBugException(
"Trying to revert to invalid level ".(int) $newLevel." from level ".(int) $level."."
);
} elseif (!$newRule) {
}
if (!$newRule) {
throw new SolverBugException(
"No rule was learned from analyzing $rule at level $level."
);

@ -58,7 +58,8 @@ class JsonFormatter
$buffer .= $char;
$noescape = '\\' === $char ? !$noescape : true;
continue;
} elseif ('' !== $buffer) {
}
if ('' !== $buffer) {
if ($unescapeSlashes) {
$buffer = str_replace('\\/', '/', $buffer);
}

@ -196,7 +196,8 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
$this->addPackage($cachedPackage);
continue;
} elseif ($cachedPackage === false) {
}
if ($cachedPackage === false) {
$this->emptyReferences[] = $identifier;
continue;

@ -113,7 +113,8 @@ class Bitbucket
$this->io->writeError('2. You are using an OAuth consumer, but didn\'t configure a (dummy) callback url');
return false;
} elseif (in_array($e->getCode(), array(403, 401))) {
}
if (in_array($e->getCode(), array(403, 401))) {
$this->io->writeError('<error>Invalid OAuth consumer provided.</error>');
$this->io->writeError('You can also add it manually later by using "composer config --global --auth bitbucket-oauth.bitbucket.org <consumer-key> <consumer-secret>"');

Loading…
Cancel
Save