Beispiel #1
0
 private function createPolicy()
 {
     $preferStable = null;
     if (!$this->update && $this->locker->isLocked()) {
         $preferStable = $this->locker->getPreferStable();
     }
     // old lock file without prefer stable will return null
     // so in this case we use the composer.json info
     if (null === $preferStable) {
         $preferStable = $this->package->getPreferStable();
     }
     return new DefaultPolicy($preferStable);
 }
Beispiel #2
0
 /**
  * @return DefaultPolicy
  */
 private function createPolicy()
 {
     $preferStable = null;
     $preferLowest = null;
     if (!$this->update) {
         $preferStable = $this->locker->getPreferStable();
         $preferLowest = $this->locker->getPreferLowest();
     }
     // old lock file without prefer stable/lowest will return null
     // so in this case we use the composer.json info
     if (null === $preferStable) {
         $preferStable = $this->preferStable || $this->package->getPreferStable();
     }
     if (null === $preferLowest) {
         $preferLowest = $this->preferLowest;
     }
     return new DefaultPolicy($preferStable, $preferLowest);
 }