Permalink
Browse files

minor #28673 [CS] Use combined assignment operators when possible (ca…

…rusogabriel)

This PR was merged into the 2.8 branch.

Discussion
----------

[CS] Use combined assignment operators when possible

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | -   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | - <!-- required for new features -->

Less opcodes for us 😄

Commits
-------

c561e99 [CS] Use combined assignment operators when possible
  • Loading branch information...
nicolas-grekas committed Oct 2, 2018
2 parents a164bb9 + c561e99 commit 73d74c48e4e7fb5fead58abface411bd3fc04a6f
@@ -90,7 +90,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$address = $input->getArgument('address');
if (false === strpos($address, ':')) {
$address = $address.':'.$input->getOption('port');
$address .= ':'.$input->getOption('port');
}
if ($this->isOtherServerProcessRunning($address)) {
@@ -112,7 +112,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$address = $input->getArgument('address');
if (false === strpos($address, ':')) {
$address = $address.':'.$input->getOption('port');
$address .= ':'.$input->getOption('port');
}
if (!$input->getOption('force') && $this->isOtherServerProcessRunning($address)) {
@@ -49,7 +49,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$address = $input->getArgument('address');
if (false === strpos($address, ':')) {
$address = $address.':'.$input->getOption('port');
$address .= ':'.$input->getOption('port');
}
// remove an orphaned lock file
@@ -59,7 +59,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$address = $input->getArgument('address');
if (false === strpos($address, ':')) {
$address = $address.':'.$input->getOption('port');
$address .= ':'.$input->getOption('port');
}
$lockFile = $this->getLockFile($address);
@@ -263,7 +263,7 @@ private function extractMessages($locale, $transPaths)
{
$extractedCatalogue = new MessageCatalogue($locale);
foreach ($transPaths as $path) {
$path = $path.'views';
$path .= 'views';
if (is_dir($path)) {
$this->getContainer()->get('translation.extractor')->extract($path, $extractedCatalogue);
}
@@ -283,7 +283,7 @@ private function loadCurrentMessages($locale, $transPaths, TranslationLoader $lo
{
$currentCatalogue = new MessageCatalogue($locale);
foreach ($transPaths as $path) {
$path = $path.'translations';
$path .= 'translations';
if (is_dir($path)) {
$loader->loadMessages($path, $currentCatalogue);
}
@@ -311,7 +311,7 @@ private function loadFallbackCatalogues($locale, $transPaths, TranslationLoader
$fallbackCatalogue = new MessageCatalogue($fallbackLocale);
foreach ($transPaths as $path) {
$path = $path.'translations';
$path .= 'translations';
if (is_dir($path)) {
$loader->loadMessages($path, $fallbackCatalogue);
}
@@ -264,7 +264,7 @@ public function testUserCheckerConfigWithNoCheckers()
protected function getContainer($file)
{
$file = $file.'.'.$this->getFileExtension();
$file .= '.'.$this->getFileExtension();
if (isset(self::$containerCache[$file])) {
return self::$containerCache[$file];
@@ -53,7 +53,7 @@ public static function load($classes, $cacheDir, $name, $autoReload, $adaptive =
$classes = array_diff($classes, $declared);
// the cache is different depending on which classes are already declared
$name = $name.'-'.substr(hash('sha256', implode('|', $classes)), 0, 5);
$name .= '-'.substr(hash('sha256', implode('|', $classes)), 0, 5);
}
$classes = array_unique($classes);
@@ -390,7 +390,7 @@ public function getSynopsis($short = false)
if (!$argument->isRequired()) {
$element = '['.$element.']';
} elseif ($argument->isArray()) {
$element = $element.' ('.$element.')';
$element .= ' ('.$element.')';
}
if ($argument->isArray()) {
@@ -35,7 +35,7 @@ public function testTrimUtf8Separators($hex)
// Convert UCS-2BE to UTF-8
$symbol = mb_convert_encoding($binary, 'UTF-8', 'UCS-2BE');
$symbol = $symbol."ab\ncd".$symbol;
$symbol .= "ab\ncd".$symbol;
$this->assertSame("ab\ncd", StringUtil::trim($symbol));
}
@@ -351,7 +351,7 @@ public static function create($uri, $method = 'GET', $parameters = array(), $coo
if (isset($components['port'])) {
$server['SERVER_PORT'] = $components['port'];
$server['HTTP_HOST'] = $server['HTTP_HOST'].':'.$components['port'];
$server['HTTP_HOST'] .= ':'.$components['port'];
}
if (isset($components['user'])) {

0 comments on commit 73d74c4

Please sign in to comment.