فهرست منبع

Use combined assignment operators

Gabriel Caruso 6 سال پیش
والد
کامیت
71c8735e11

+ 1 - 1
src/Composer/Command/InitCommand.php

@@ -204,7 +204,7 @@ EOT
                 $name = get_current_user() . '/' . $name;
             } else {
                 // package names must be in the format foo/bar
-                $name = $name . '/' . $name;
+                $name .= '/' . $name;
             }
             $name = strtolower($name);
         } else {

+ 1 - 1
src/Composer/DependencyResolver/Rule.php

@@ -111,7 +111,7 @@ abstract class Rule
 
     public function enable()
     {
-        $this->bitfield = $this->bitfield & ~(255 << self::BITFIELD_DISABLED);
+        $this->bitfield &= ~(255 << self::BITFIELD_DISABLED);
     }
 
     public function isDisabled()

+ 3 - 3
src/Composer/Util/Perforce.php

@@ -269,9 +269,9 @@ class Perforce
     public function generateP4Command($command, $useClient = true)
     {
         $p4Command = 'p4 ';
-        $p4Command = $p4Command . '-u ' . $this->getUser() . ' ';
+        $p4Command .= '-u ' . $this->getUser() . ' ';
         if ($useClient) {
-            $p4Command = $p4Command . '-c ' . $this->getClient() . ' ';
+            $p4Command .= '-c ' . $this->getClient() . ' ';
         }
         $p4Command = $p4Command . '-p ' . $this->getPort() . ' ' . $command;
 
@@ -312,7 +312,7 @@ class Perforce
         chdir($this->path);
         $p4SyncCommand = $this->generateP4Command('sync -f ');
         if (null !== $sourceReference) {
-            $p4SyncCommand = $p4SyncCommand . '@' . $sourceReference;
+            $p4SyncCommand .= '@' . $sourceReference;
         }
         $this->executeCommand($p4SyncCommand);
         chdir($prevDir);

+ 1 - 1
tests/Composer/Test/Downloader/ArchiveDownloaderTest.php

@@ -131,7 +131,7 @@ class ArchiveDownloaderTest extends TestCase
         $method = new \ReflectionMethod($downloader, 'processUrl');
         $method->setAccessible(true);
 
-        $url = $url . '.' . $extension;
+        $url .= '.' . $extension;
         $expected = 'https://bitbucket.org/davereid/drush-virtualhost/get/ref.' . $extension;
 
         $package = $this->getMockBuilder('Composer\Package\PackageInterface')->getMock();