@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Micro |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Micro |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | * @param Logger $logger |
| 48 | 48 | * @return void |
| 49 | 49 | */ |
| 50 | - public function __construct(?Iterable $config, Logger $logger) |
|
| 50 | + public function __construct(? Iterable $config, Logger $logger) |
|
| 51 | 51 | { |
| 52 | 52 | $this->logger = $logger; |
| 53 | 53 | $this->setOptions($config); |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | * @param Iterable $config |
| 72 | 72 | * @return AdapterInterface |
| 73 | 73 | */ |
| 74 | - public function setOptions(?Iterable $config=null): AdapterInterface |
|
| 74 | + public function setOptions(? Iterable $config = null) : AdapterInterface |
|
| 75 | 75 | { |
| 76 | 76 | if ($config === null) { |
| 77 | 77 | return $this; |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Micro |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Micro |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | * @param Iterable $config |
| 39 | 39 | * @return LdapServer |
| 40 | 40 | */ |
| 41 | - public function setOptions(?Iterable $config=null): LdapServer |
|
| 41 | + public function setOptions(? Iterable $config = null) : LdapServer |
|
| 42 | 42 | { |
| 43 | 43 | if ($config === null) { |
| 44 | 44 | return $this; |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | */ |
| 107 | 107 | protected function preauth(string $value): bool |
| 108 | 108 | { |
| 109 | - $parts = explode('|', $value); |
|
| 109 | + $parts = explode('|', $value); |
|
| 110 | 110 | |
| 111 | 111 | if (count($parts) !== 2) { |
| 112 | 112 | $this->logger->warning('invalid header x-preauth value, parts != 2', [ |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | 'category' => get_class($this) |
| 194 | 194 | ]); |
| 195 | 195 | |
| 196 | - $this->ldap_dn = $dn; |
|
| 196 | + $this->ldap_dn = $dn; |
|
| 197 | 197 | |
| 198 | 198 | return true; |
| 199 | 199 | } |
@@ -218,6 +218,6 @@ discard block |
||
| 218 | 218 | $ip_decimal = ip2long($ip); |
| 219 | 219 | $wildcard_decimal = pow(2, (32 - $netmask)) - 1; |
| 220 | 220 | $netmask_decimal = ~ $wildcard_decimal; |
| 221 | - return (($ip_decimal & $netmask_decimal) == ($range_decimal & $netmask_decimal)); |
|
| 221 | + return (($ip_decimal&$netmask_decimal) == ($range_decimal&$netmask_decimal)); |
|
| 222 | 222 | } |
| 223 | 223 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Micro |
@@ -35,13 +35,13 @@ discard block |
||
| 35 | 35 | * @param Iterable $config |
| 36 | 36 | * @return AdapterInterface |
| 37 | 37 | */ |
| 38 | - public function setOptions(?Iterable $config=null): AdapterInterface |
|
| 38 | + public function setOptions(? Iterable $config = null) : AdapterInterface |
|
| 39 | 39 | { |
| 40 | 40 | if ($config === null) { |
| 41 | 41 | return $this; |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - if(isset($config['provider_url'])) { |
|
| 44 | + if (isset($config['provider_url'])) { |
|
| 45 | 45 | $this->discovery_url = (string)$config['provider_url']; |
| 46 | 46 | } |
| 47 | 47 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | */ |
| 102 | 102 | protected function getDiscoveryDocument(): array |
| 103 | 103 | { |
| 104 | - if($apc = extension_loaded('apc') && apc_exists($this->provider_url)) { |
|
| 104 | + if ($apc = extension_loaded('apc') && apc_exists($this->provider_url)) { |
|
| 105 | 105 | return apc_get($this->provider_url); |
| 106 | 106 | } else { |
| 107 | 107 | $ch = curl_init(); |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | $discovery = json_decode($result, true); |
| 113 | 113 | |
| 114 | - if($apc === true) { |
|
| 114 | + if ($apc === true) { |
|
| 115 | 115 | apc_store($this->provider_url, $discovery); |
| 116 | 116 | } |
| 117 | 117 | |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | protected function verifyToken(string $token): bool |
| 130 | 130 | { |
| 131 | 131 | $discovery = $this->getDiscoverDocument(); |
| 132 | - if(!(isset($discovery['authorization_endpoint']))) { |
|
| 132 | + if (!(isset($discovery['authorization_endpoint']))) { |
|
| 133 | 133 | throw new Exception('authorization_endpoint could not be determained'); |
| 134 | 134 | } |
| 135 | 135 | |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Micro |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | * @param Logger $logger |
| 22 | 22 | * @return void |
| 23 | 23 | */ |
| 24 | - public function __construct(?Iterable $config, Logger $logger); |
|
| 24 | + public function __construct(? Iterable $config, Logger $logger); |
|
| 25 | 25 | |
| 26 | 26 | |
| 27 | 27 | /** |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Micro |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | * @param Logger $logger |
| 51 | 51 | * @return void |
| 52 | 52 | */ |
| 53 | - public function __construct(?Iterable $config, Logger $logger) |
|
| 53 | + public function __construct(? Iterable $config, Logger $logger) |
|
| 54 | 54 | { |
| 55 | 55 | $this->logger = $logger; |
| 56 | 56 | $this->setOptions($config); |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | * @param Iterable $config |
| 64 | 64 | * @return AdapterInterface |
| 65 | 65 | */ |
| 66 | - public function setOptions(?Iterable $config=null): AdapterInterface |
|
| 66 | + public function setOptions(? Iterable $config = null) : AdapterInterface |
|
| 67 | 67 | { |
| 68 | 68 | if ($config === null) { |
| 69 | 69 | return $this; |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - if(!isset($config['ldap'])) { |
|
| 84 | + if (!isset($config['ldap'])) { |
|
| 85 | 85 | $this->ldap = new LdapServer(); |
| 86 | 86 | } |
| 87 | 87 | |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Micro |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | return false; |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - $this->identifier = $username; |
|
| 92 | + $this->identifier = $username; |
|
| 93 | 93 | return true; |
| 94 | 94 | } |
| 95 | 95 | |
@@ -100,5 +100,5 @@ discard block |
||
| 100 | 100 | * @param string $username |
| 101 | 101 | * @return array |
| 102 | 102 | */ |
| 103 | - protected abstract function findIdentity(string $username): ?array; |
|
| 103 | + protected abstract function findIdentity(string $username): ? array; |
|
| 104 | 104 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Micro |
@@ -83,21 +83,21 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | switch ($value['type']) { |
| 85 | 85 | case 'array': |
| 86 | - $arr = (array)$data[$value['attr']]; |
|
| 86 | + $arr = (array)$data[$value['attr']]; |
|
| 87 | 87 | unset($arr['count']); |
| 88 | 88 | $attrs[$attr] = $arr; |
| 89 | 89 | break; |
| 90 | 90 | |
| 91 | 91 | case 'string': |
| 92 | - $attrs[$attr] = (string)$store; |
|
| 92 | + $attrs[$attr] = (string)$store; |
|
| 93 | 93 | break; |
| 94 | 94 | |
| 95 | 95 | case 'int': |
| 96 | - $attrs[$attr] = (int)$store; |
|
| 96 | + $attrs[$attr] = (int)$store; |
|
| 97 | 97 | break; |
| 98 | 98 | |
| 99 | 99 | case 'bool': |
| 100 | - $attrs[$attr] = (bool)$store; |
|
| 100 | + $attrs[$attr] = (bool)$store; |
|
| 101 | 101 | break; |
| 102 | 102 | |
| 103 | 103 | default: |