Exemple #1
0
 /**
  * Prognosis in seconds
  * @param float $distance distance in km
  * @return int
  */
 public function inSeconds($distance)
 {
     if (null === $this->Strategy) {
         throw new \RuntimeException('Prognosis class requires a strategy to be set.');
     }
     return $this->Strategy->inSeconds($distance);
 }
Exemple #2
0
 /**
  * @return bool
  */
 public function isValid()
 {
     return null !== $this->Strategy && $this->Strategy->valuesAreValid();
 }