| Total Complexity | 7 |
| Total Lines | 78 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class Auth |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var Facebook |
||
| 16 | */ |
||
| 17 | public $fb; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var Config |
||
| 21 | */ |
||
| 22 | private $config; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @var |
||
| 26 | */ |
||
| 27 | private $error; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Auth constructor. |
||
| 31 | * |
||
| 32 | * @param Config $config |
||
| 33 | */ |
||
| 34 | public function __construct(Config $config) |
||
| 35 | { |
||
| 36 | $this->config = $config; |
||
| 37 | |||
| 38 | $this->fb = new Facebook([ |
||
| 39 | 'app_id' => $this->config->getParameter('fb_app_id'), |
||
| 40 | 'app_secret' => $this->config->getParameter('fb_app_secret'), |
||
| 41 | 'default_graph_version' => $this->config->getParameter('default_graph_version'), |
||
| 42 | ]); |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Checks if current Facebook access token is valid. |
||
| 47 | * |
||
| 48 | * @return bool |
||
| 49 | */ |
||
| 50 | public function isValid() |
||
| 69 | } |
||
| 70 | } |
||
| 71 | |||
| 72 | /** |
||
| 73 | * Get error. |
||
| 74 | * |
||
| 75 | * @return mixed |
||
| 76 | */ |
||
| 77 | public function getError() |
||
| 78 | { |
||
| 79 | return $this->error; |
||
| 80 | } |
||
| 81 | |||
| 82 | /** |
||
| 83 | * Set default Facebook access token. |
||
| 84 | * |
||
| 85 | * @param string $token |
||
| 86 | */ |
||
| 87 | public function setToken($token) |
||
| 90 | } |
||
| 91 | } |
||
| 92 |