Browse Source

Fix Literal id generation

Jordi Boggiano 14 năm trước cách đây
mục cha
commit
48774ee6ca
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      src/Composer/DependencyResolver/Literal.php

+ 2 - 2
src/Composer/DependencyResolver/Literal.php

@@ -44,12 +44,12 @@ class Literal
 
     public function getId()
     {
-        return (($this->wanted) ? 1 : -1) * spl_object_hash($this->package);
+        return ($this->wanted ? '' : '-') . spl_object_hash($this->package);
     }
 
     public function __toString()
     {
-        return ($this->isWanted() ? '+' : '-').$this->getPackage();
+        return ($this->wanted ? '+' : '-') . $this->getPackage();
     }
 
     public function inverted()