1 | <?php |
||
27 | final class Error implements InitializationInterface { |
||
28 | /** |
||
29 | * Error string constants |
||
30 | */ |
||
31 | const STRING_INVALID_GRANT = 'invalid_grant', |
||
32 | STRING_INVALID_CLIENT = 'invalid_client'; |
||
33 | |||
34 | /** |
||
35 | * @var string google error code |
||
36 | */ |
||
37 | private $error = ''; |
||
38 | |||
39 | /** |
||
40 | * Setter for error code |
||
41 | * @param string $error error code |
||
42 | * @return Error self |
||
43 | */ |
||
44 | 1 | private function setError($error) { |
|
48 | |||
49 | /** |
||
50 | * Getter for invalid grant error |
||
51 | * @return bool if error is invalid grant |
||
52 | */ |
||
53 | 1 | public function isInvalidGrant() { |
|
56 | |||
57 | /** |
||
58 | * Getter for invalid client error |
||
59 | * @return bool if error is invalid client |
||
60 | */ |
||
61 | 1 | public function isInvalidClient() { |
|
64 | |||
65 | private function __construct() {} |
||
66 | |||
67 | /** |
||
68 | * Method for object initialization by the string |
||
69 | * @param string $string response string |
||
70 | * @return Error error object |
||
71 | */ |
||
72 | 1 | public static function initializeByString($string) { |
|
78 | } |
||
79 |