client = $client; $this->config = $config; } /** * @return Client */ public function getClient() { return $this->client; } /** * @return Config */ public function getConfig() { return $this->config; } /** * Check if it's connected * (if there's a "logout" link) * * @return bool */ public function isConnected() { if (!$this->is_connected) { $crawler = $this->client->request('GET', Actions::HOME_URL); $this->is_connected = $crawler->filter('#account_logout')->count() == 1; } return $this->is_connected; } /** * @param bool $connected */ public function setConnected($connected = false) { $this->is_connected = $connected; } }