1 | <?php |
||
24 | final class OAuth2 |
||
25 | { |
||
26 | /** |
||
27 | * @var null|string |
||
28 | */ |
||
29 | private $scope = null; |
||
30 | |||
31 | /** |
||
32 | * @var null|string |
||
33 | */ |
||
34 | private $clientId = null; |
||
35 | |||
36 | /** |
||
37 | * @var null|string |
||
38 | */ |
||
39 | private $resourceOwnerId = null; |
||
40 | |||
41 | /** |
||
42 | * @param array $data an array of key/value parameters |
||
43 | * |
||
44 | * @throws \BadMethodCallException |
||
45 | */ |
||
46 | public function __construct(array $data) |
||
61 | |||
62 | /** |
||
63 | * @param string $clientId |
||
64 | */ |
||
65 | protected function setClientId(string $clientId) |
||
66 | { |
||
67 | Assertion::string($clientId, 'The client public ID should be a string.'); |
||
68 | $this->clientId = $clientId; |
||
69 | } |
||
70 | |||
71 | /** |
||
72 | * @return null|string |
||
73 | */ |
||
74 | public function getClientId(): ?string |
||
75 | { |
||
76 | return $this->clientId; |
||
77 | } |
||
78 | |||
79 | /** |
||
80 | * @param string $resourceOwnerId |
||
81 | */ |
||
82 | protected function setResourceOwnerId(string $resourceOwnerId) |
||
83 | { |
||
84 | Assertion::string($resourceOwnerId, 'The resource owner public ID should be a string.'); |
||
85 | $this->resourceOwnerId = $resourceOwnerId; |
||
86 | } |
||
87 | |||
88 | /** |
||
89 | * @return null|string |
||
90 | */ |
||
91 | public function getResourceOwnerId(): ?string |
||
92 | { |
||
93 | return $this->resourceOwnerId; |
||
94 | } |
||
95 | |||
96 | /** |
||
97 | * @param string $scope |
||
98 | */ |
||
99 | protected function setScope(string $scope) |
||
103 | |||
104 | /** |
||
105 | * @return null|string |
||
106 | */ |
||
107 | public function getScope(): ?string |
||
111 | } |
||
112 |