1 | <?php |
||
8 | class ConfigRetriever implements \SocialiteProviders\Manager\Contracts\Helpers\ConfigRetrieverInterface |
||
9 | { |
||
10 | |||
11 | /** |
||
12 | * @var string |
||
13 | */ |
||
14 | private $providerName; |
||
15 | |||
16 | /** |
||
17 | * @var string |
||
18 | */ |
||
19 | private $providerIdentifier; |
||
20 | |||
21 | /** |
||
22 | * @var array |
||
23 | */ |
||
24 | private $servicesArray; |
||
25 | |||
26 | /** |
||
27 | * @param string $providerIdentifier |
||
28 | * @param array $additionalConfigKeys |
||
29 | * |
||
30 | * @return ConfigInterface |
||
31 | * @throws MissingConfigException |
||
32 | */ |
||
33 | 2 | public function fromEnv($providerIdentifier, array $additionalConfigKeys = []) |
|
45 | |||
46 | /** |
||
47 | * @param string $providerName |
||
48 | * @param array $additionalConfigKeys |
||
49 | * |
||
50 | * @return ConfigInterface |
||
51 | * @throws MissingConfigException |
||
52 | */ |
||
53 | 2 | public function fromServices($providerName, array $additionalConfigKeys = []) |
|
66 | |||
67 | /** |
||
68 | * @param array $configKeys |
||
69 | * @param \Closure $keyRetrievalClosure |
||
70 | * |
||
71 | * @return array |
||
72 | */ |
||
73 | 2 | private function getConfigItems(array $configKeys, \Closure $keyRetrievalClosure) |
|
81 | |||
82 | /** |
||
83 | * @param array $keys |
||
84 | * @param \Closure $keyRetrievalClosure |
||
85 | * |
||
86 | * @return array |
||
87 | */ |
||
88 | 2 | private function retrieveItemsFromConfig(array $keys, \Closure $keyRetrievalClosure) |
|
98 | |||
99 | /** |
||
100 | * @param string $key |
||
101 | * |
||
102 | * @return string |
||
103 | * @throws MissingConfigException |
||
104 | */ |
||
105 | 1 | private function getFromServices($key) |
|
113 | |||
114 | /** |
||
115 | * @param string $key |
||
116 | * |
||
117 | * @return string |
||
118 | * @throws MissingConfigException |
||
119 | */ |
||
120 | 2 | private function getFromEnv($key) |
|
131 | |||
132 | /** |
||
133 | * @param string $providerName |
||
134 | * |
||
135 | * @return array |
||
136 | * @throws MissingConfigException |
||
137 | */ |
||
138 | 2 | protected function getConfigFromServicesArray($providerName) |
|
150 | } |
||
151 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.