Browse Source

Fixed code. Changes improved code testability

Leszek Prabucki 13 years ago
parent
commit
9488b0f85f

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

@@ -29,6 +29,8 @@ class Rule
     public $next1;
     public $next2;
 
+    public $ruleHash;
+
     public function __construct(array $literals, $reason, $reasonData)
     {
         // sort all packages ascending by id
@@ -85,7 +87,7 @@ class Rule
         }
 
         for ($i = 0, $n = count($this->literals); $i < $n; $i++) {
-            if (!$this->literals[$i]->getId() === $rule->literals[$i]->getId()) {
+            if (!($this->literals[$i]->getId() === $rule->literals[$i]->getId())) {
                 return false;
             }
         }

+ 1 - 0
src/Composer/Downloader/GitDownloader.php

@@ -48,6 +48,7 @@ class GitDownloader extends VcsDownloader
      */
     protected function enforceCleanDirectory($path)
     {
+        $output = array();
         $this->process->execute(sprintf('cd %s && git status --porcelain', escapeshellarg($path)), $output);
         if (trim($output)) {
             throw new \RuntimeException('Source directory has uncommitted changes');

+ 1 - 0
src/Composer/Downloader/HgDownloader.php

@@ -48,6 +48,7 @@ class HgDownloader extends VcsDownloader
      */
     protected function enforceCleanDirectory($path)
     {
+        $output = array();
         $this->process->execute(sprintf('cd %s && hg st', escapeshellarg($path)), $output);
         if (trim($output)) {
             throw new \RuntimeException('Source directory has uncommitted changes');