diff --git a/src/Composer/Autoload/AutoloadGenerator.php b/src/Composer/Autoload/AutoloadGenerator.php index 05b11acb0..7f79cdc2b 100644 --- a/src/Composer/Autoload/AutoloadGenerator.php +++ b/src/Composer/Autoload/AutoloadGenerator.php @@ -1094,7 +1094,8 @@ INITIALIZER; if ($type === 'files') { $autoloads[$this->getFileIdentifier($package, $path)] = $relativePath; continue; - } elseif ($type === 'classmap') { + } + if ($type === 'classmap') { $autoloads[] = $relativePath; continue; } diff --git a/src/Composer/Command/CreateProjectCommand.php b/src/Composer/Command/CreateProjectCommand.php index e4b7e40c0..b3bff893e 100644 --- a/src/Composer/Command/CreateProjectCommand.php +++ b/src/Composer/Command/CreateProjectCommand.php @@ -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.'); } } diff --git a/src/Composer/Command/RunScriptCommand.php b/src/Composer/Command/RunScriptCommand.php index 8747af501..810325243 100644 --- a/src/Composer/Command/RunScriptCommand.php +++ b/src/Composer/Command/RunScriptCommand.php @@ -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"'); } diff --git a/src/Composer/Config.php b/src/Composer/Config.php index 54d2e360c..d437a5c9a 100644 --- a/src/Composer/Config.php +++ b/src/Composer/Config.php @@ -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: Accessing $host over $scheme which is an insecure protocol."); diff --git a/src/Composer/DependencyResolver/Solver.php b/src/Composer/DependencyResolver/Solver.php index a383f64cf..431ce2302 100644 --- a/src/Composer/DependencyResolver/Solver.php +++ b/src/Composer/DependencyResolver/Solver.php @@ -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." ); diff --git a/src/Composer/Json/JsonFormatter.php b/src/Composer/Json/JsonFormatter.php index 44acaff59..386e62673 100644 --- a/src/Composer/Json/JsonFormatter.php +++ b/src/Composer/Json/JsonFormatter.php @@ -58,7 +58,8 @@ class JsonFormatter $buffer .= $char; $noescape = '\\' === $char ? !$noescape : true; continue; - } elseif ('' !== $buffer) { + } + if ('' !== $buffer) { if ($unescapeSlashes) { $buffer = str_replace('\\/', '/', $buffer); } diff --git a/src/Composer/Repository/VcsRepository.php b/src/Composer/Repository/VcsRepository.php index 74f8e51bf..148f587d4 100644 --- a/src/Composer/Repository/VcsRepository.php +++ b/src/Composer/Repository/VcsRepository.php @@ -196,7 +196,8 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt $this->addPackage($cachedPackage); continue; - } elseif ($cachedPackage === false) { + } + if ($cachedPackage === false) { $this->emptyReferences[] = $identifier; continue; diff --git a/src/Composer/Util/Bitbucket.php b/src/Composer/Util/Bitbucket.php index 20c2bc654..11b7f9dd9 100644 --- a/src/Composer/Util/Bitbucket.php +++ b/src/Composer/Util/Bitbucket.php @@ -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('Invalid OAuth consumer provided.'); $this->io->writeError('You can also add it manually later by using "composer config --global --auth bitbucket-oauth.bitbucket.org "');