/** * @param array $game * @throws \Exception */ public function __construct(array $game = NULL) { parent::__construct(); if ($game == NULL) { throw new \Exception("Parameter 'game' not set"); } return $this->updateGame($game); }
/** * @return Perguntados $this */ public function __construct() { parent::__construct(); $this->dash = []; $this->maxLives = (int) 0; $this->lives = (int) 0; $this->nextIncrement = (int) 0; $this->coins = (int) 0; $this->extraShots = (int) 0; $this->games = []; $this->url = getenv('APP_URL'); $this->userId = getenv('USER_ID'); $this->headers = ['Cookie' => 'ap_session=' . getenv('APP_COOKIE'), 'Eter-Agent' => '1|iOS-AppStr|iPhone7,2|0|iOS 9.1|0|2.3.0.1|pt-BR|pt-BR|BR|1', 'Connection' => 'keep-alive', 'Accept' => '*/*', 'Accept-Language' => 'pt-br']; $this->guzzleConf = ['base_uri' => $this->url, 'cookies' => false, 'verify' => false, 'exceptions' => false, 'allow_redirects' => true, 'debug' => false, 'headers' => $this->headers]; $this->conn = new Client($this->guzzleConf); return $this->_connect(); }