1 | <?php |
||
21 | class OAuth2Subscriber implements SubscriberInterface |
||
22 | { |
||
23 | const AUTH_NAME = 'gigya-oauth2'; |
||
24 | |||
25 | /** @var GrantInterface */ |
||
26 | private $grant; |
||
27 | /** @var string|null */ |
||
28 | private $name; |
||
29 | |||
30 | /** |
||
31 | * @param GrantInterface $grant |
||
32 | * @param string|null $name |
||
33 | */ |
||
34 | 8 | public function __construct(GrantInterface $grant, $name = null) |
|
39 | |||
40 | /** |
||
41 | * Returns an array of event names this subscriber wants to listen to. |
||
42 | * |
||
43 | * @return array |
||
44 | */ |
||
45 | 1 | public function getEvents() |
|
52 | |||
53 | /** |
||
54 | * Add the authentication params to the request. |
||
55 | * |
||
56 | * @param BeforeEvent $event |
||
57 | */ |
||
58 | 1 | public function sign(BeforeEvent $event) |
|
71 | |||
72 | /** |
||
73 | * @param ErrorEvent $event |
||
74 | */ |
||
75 | 4 | public function error(ErrorEvent $event) |
|
92 | } |
||
93 |