Ejemplo n.º 1
0
 /**
  * @param int $symbolOffset
  * @param int $symbolLimit
  * @return array
  * @throws ConsoleError
  */
 private function getApplicableSymbols(int $symbolOffset, int $symbolLimit)
 {
     $allSymbols = SymbolCode::values();
     $symbolsCount = count($allSymbols);
     if ($symbolOffset > $symbolsCount) {
         throw new ConsoleError(sprintf('Wrong offset. There are only %d symbol codes.', $symbolsCount));
     }
     return array_slice($allSymbols, $symbolOffset, $symbolLimit);
 }
Ejemplo n.º 2
0
 public function __construct($symbol)
 {
     parent::__construct(sprintf('Symbol %s is invalid. Valid symbols are: %s', $symbol, implode(', ', SymbolCode::values())));
 }