Пример #1
0
 /**
  * Creates new client session instance for connection
  *
  * @param ConnectionInterface $connection Connection instance
  *
  * @return Client
  */
 private function _createNewClient(ConnectionInterface $connection)
 {
     $universeBaskets = [];
     for ($i = 0; $i < UNIVERSE_BASKET_COUNT; $i++) {
         $universeBaskets[] = $this->_basketFactory->createFilled(UNIVERSE_BASKET_SIZE);
     }
     return new Client($this, $connection, new JsonProtocol(), $this->_basketFactory->create(USER_BASKET_SIZE), $universeBaskets);
 }
 /**
  * BasketFactory constructor.
  *
  * @param string $class         Basket class
  * @param int    $maxBallNumber Largest ball number
  */
 public function __construct($class, $maxBallNumber)
 {
     parent::__construct($class);
     $this->_ballNumbersAvailable = range(1, $maxBallNumber);
 }