mirror of
https://github.com/composer/composer
synced 2025-05-09 08:32:56 +00:00
Run cs fixer and update config to latest master
This commit is contained in:
parent
b9ce06f46b
commit
3b0a1c6f70
25 changed files with 76 additions and 69 deletions
8
.php_cs
8
.php_cs
|
@ -10,7 +10,7 @@ For the full copyright and license information, please view the LICENSE
|
|||
file that was distributed with this source code.
|
||||
EOF;
|
||||
|
||||
$finder = Symfony\CS\Finder::create()
|
||||
$finder = PhpCsFixer\Finder::create()
|
||||
->files()
|
||||
->name('*.php')
|
||||
->exclude('Fixtures')
|
||||
|
@ -18,7 +18,7 @@ $finder = Symfony\CS\Finder::create()
|
|||
->in(__DIR__.'/tests')
|
||||
;
|
||||
|
||||
return Symfony\CS\Config::create()
|
||||
return PhpCsFixer\Config::create()
|
||||
->setUsingCache(true)
|
||||
//->setUsingLinter(false)
|
||||
->setRiskyAllowed(true)
|
||||
|
@ -26,6 +26,7 @@ return Symfony\CS\Config::create()
|
|||
'@PSR2' => true,
|
||||
'binary_operator_spaces' => true,
|
||||
'blank_line_before_return' => true,
|
||||
'cast_spaces' => true,
|
||||
'header_comment' => array('header' => $header),
|
||||
'include' => true,
|
||||
'long_array_syntax' => true,
|
||||
|
@ -39,6 +40,7 @@ return Symfony\CS\Config::create()
|
|||
'no_leading_namespace_whitespace' => true,
|
||||
'no_trailing_comma_in_singleline_array' => true,
|
||||
'no_unused_imports' => true,
|
||||
'no_whitespace_in_blank_lines' => true,
|
||||
'object_operator_without_whitespace' => true,
|
||||
'phpdoc_align' => true,
|
||||
'phpdoc_indent' => true,
|
||||
|
@ -50,11 +52,9 @@ return Symfony\CS\Config::create()
|
|||
'phpdoc_type_to_var' => true,
|
||||
'psr0' => true,
|
||||
'single_blank_line_before_namespace' => true,
|
||||
'spaces_cast' => true,
|
||||
'standardize_not_equals' => true,
|
||||
'ternary_operator_spaces' => true,
|
||||
'trailing_comma_in_multiline_array' => true,
|
||||
'whitespacy_lines' => true,
|
||||
))
|
||||
->finder($finder)
|
||||
;
|
||||
|
|
|
@ -117,7 +117,7 @@ EOT
|
|||
->setClassMapAuthoritative($authoritative)
|
||||
->setUpdate(true)
|
||||
->setUpdateWhitelist($packages)
|
||||
->setWhitelistDependencies( ! $input->getOption('no-update-with-dependencies'))
|
||||
->setWhitelistDependencies(!$input->getOption('no-update-with-dependencies'))
|
||||
->setIgnorePlatformRequirements($input->getOption('ignore-platform-reqs'))
|
||||
;
|
||||
|
||||
|
|
|
@ -305,8 +305,8 @@ TAGSPUBKEY
|
|||
* @param string $localFilename
|
||||
* @param string $newFilename
|
||||
* @param string $backupTarget
|
||||
* @return \UnexpectedValueException|\PharException|null
|
||||
* @throws \Exception
|
||||
* @return \UnexpectedValueException|\PharException|null
|
||||
*/
|
||||
protected function setLocalPhar($localFilename, $newFilename, $backupTarget = null)
|
||||
{
|
||||
|
@ -325,6 +325,7 @@ TAGSPUBKEY
|
|||
}
|
||||
|
||||
rename($newFilename, $localFilename);
|
||||
|
||||
return null;
|
||||
} catch (\Exception $e) {
|
||||
if (!$e instanceof \UnexpectedValueException && !$e instanceof \PharException) {
|
||||
|
|
|
@ -80,11 +80,11 @@ class PathDownloader extends FileDownloader
|
|||
$this->io->writeError(sprintf(' Junctioned from %s', $url));
|
||||
} else {
|
||||
$absolutePath = $path;
|
||||
if ( ! $this->filesystem->isAbsolutePath($absolutePath)) {
|
||||
if (!$this->filesystem->isAbsolutePath($absolutePath)) {
|
||||
$absolutePath = getcwd() . DIRECTORY_SEPARATOR . $path;
|
||||
}
|
||||
$shortestPath = $this->filesystem->findShortestPath($absolutePath, $realUrl);
|
||||
$path = rtrim($path,"/");
|
||||
$path = rtrim($path, "/");
|
||||
$fileSystem->symlink($shortestPath, $path);
|
||||
$this->io->writeError(sprintf(' Symlinked from %s', $url));
|
||||
}
|
||||
|
|
|
@ -137,9 +137,9 @@ class EventDispatcher
|
|||
* Triggers the listeners of an event.
|
||||
*
|
||||
* @param Event $event The event object to pass to the event handlers/listeners.
|
||||
* @throws \RuntimeException|\Exception
|
||||
* @return int return code of the executed script if any, for php scripts a false return
|
||||
* value is changed to 1, anything else to 0
|
||||
* @throws \RuntimeException|\Exception
|
||||
*/
|
||||
protected function doDispatch(Event $event)
|
||||
{
|
||||
|
|
|
@ -61,7 +61,7 @@ class PluginInstaller extends LibraryInstaller
|
|||
parent::install($repo, $package);
|
||||
try {
|
||||
$this->composer->getPluginManager()->registerPackage($package, true);
|
||||
} catch(\Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
// Rollback installation
|
||||
$this->io->writeError('Plugin installation failed, rolling back');
|
||||
parent::uninstall($repo, $package);
|
||||
|
|
|
@ -94,6 +94,7 @@ class ArchivableFilesFinder extends \FilterIterator
|
|||
}
|
||||
|
||||
$iterator = new FilesystemIterator($current, FilesystemIterator::SKIP_DOTS);
|
||||
|
||||
return !$iterator->valid();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,6 +72,7 @@ class GitExcludeFilter extends BaseExcludeFilter
|
|||
if (count($parts) == 2 && $parts[1] === 'export-ignore') {
|
||||
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 null;
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ class Bitbucket
|
|||
'http' => array(
|
||||
'method' => 'POST',
|
||||
'content' => 'grant_type=client_credentials',
|
||||
)
|
||||
),
|
||||
));
|
||||
|
||||
$this->token = json_decode($json, true);
|
||||
|
@ -150,7 +150,7 @@ class Bitbucket
|
|||
|
||||
$consumer = array(
|
||||
"consumer-key" => $consumerKey,
|
||||
"consumer-secret" => $consumerSecret
|
||||
"consumer-secret" => $consumerSecret,
|
||||
);
|
||||
$this->config->getAuthConfigSource()->addConfigSetting('bitbucket-oauth.'.$originUrl, $consumer);
|
||||
|
||||
|
|
|
@ -127,7 +127,7 @@ class Git
|
|||
$auth = $this->io->getAuthentication($match[1]);
|
||||
|
||||
//We already have an access_token from a previous request.
|
||||
if($auth['username'] !== 'x-token-auth') {
|
||||
if ($auth['username'] !== 'x-token-auth') {
|
||||
$token = $bitbucketUtil->requestToken($match[1], $auth['username'], $auth['password']);
|
||||
$this->io->setAuthentication($match[1], 'x-token-auth', $token['access_token']);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
namespace Composer\Test;
|
||||
|
||||
use Composer\Config;
|
||||
use Composer\Downloader\TransportException;
|
||||
|
||||
class ConfigTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
@ -252,7 +251,8 @@ class ConfigTest extends \PHPUnit_Framework_TestCase
|
|||
'file://myserver.localhost/mygit.git',
|
||||
'file://example.org/mygit.git',
|
||||
);
|
||||
return array_combine($urls, array_map(function($e) { return array($e); }, $urls));
|
||||
|
||||
return array_combine($urls, array_map(function ($e) { return array($e); }, $urls));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -270,7 +270,8 @@ class ConfigTest extends \PHPUnit_Framework_TestCase
|
|||
'svn://1.2.3.4/trunk',
|
||||
'git://5.6.7.8/git.git',
|
||||
);
|
||||
return array_combine($urls, array_map(function($e) { return array($e); }, $urls));
|
||||
|
||||
return array_combine($urls, array_map(function ($e) { return array($e); }, $urls));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue