@@ -39,7 +39,6 @@ |
||
| 39 | 39 | /** |
| 40 | 40 | * Set options |
| 41 | 41 | * |
| 42 | - * @param Iterable $options |
|
| 43 | 42 | * @return AdapterInterface |
| 44 | 43 | */ |
| 45 | 44 | public function setOptions(?Iterable $config=null) |
@@ -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 |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | * @param Iterable $options |
| 43 | 43 | * @return AdapterInterface |
| 44 | 44 | */ |
| 45 | - public function setOptions(?Iterable $config=null) |
|
| 45 | + public function setOptions(? Iterable $config = null) |
|
| 46 | 46 | { |
| 47 | 47 | parent::setOptions($options); |
| 48 | 48 | |
@@ -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 |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | * @param array $params |
| 73 | 73 | * @return void |
| 74 | 74 | */ |
| 75 | - public function __construct(string $path, $class, ?string $method=null, array $params=[]) |
|
| 75 | + public function __construct(string $path, $class, ? string $method = null, array $params = []) |
|
| 76 | 76 | { |
| 77 | 77 | $this->setPath($path); |
| 78 | 78 | $this->setClass($class); |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public function match(): bool |
| 90 | 90 | { |
| 91 | - $regex = preg_replace_callback('#({([A-Z0-9a-z]+)\:\#(.+?)\#})|\{(.+?)\}#', function ($match) { |
|
| 91 | + $regex = preg_replace_callback('#({([A-Z0-9a-z]+)\:\#(.+?)\#})|\{(.+?)\}#', function($match) { |
|
| 92 | 92 | if (count($match) === 4) { |
| 93 | 93 | return '(?<'.$match[2].'>'.$match[3].'+)'; |
| 94 | 94 | } else { |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | * @param array $constructor |
| 118 | 118 | * @return array |
| 119 | 119 | */ |
| 120 | - public function getCallable($constructor=[]): array |
|
| 120 | + public function getCallable($constructor = []): array |
|
| 121 | 121 | { |
| 122 | 122 | if (is_object($this->class)) { |
| 123 | 123 | $instance = $this->class; |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | * @param string $name |
| 140 | 140 | * @return string |
| 141 | 141 | */ |
| 142 | - protected function _buildMethodName(?string $name): string |
|
| 142 | + protected function _buildMethodName(? string $name) : string |
|
| 143 | 143 | { |
| 144 | 144 | $result = $this->router->getVerb(); |
| 145 | 145 | |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | * @param string $method |
| 265 | 265 | * @return Route |
| 266 | 266 | */ |
| 267 | - public function setMethod(?string $method): Route |
|
| 267 | + public function setMethod(? string $method) : Route |
|
| 268 | 268 | { |
| 269 | 269 | $this->method = $method; |
| 270 | 270 | return $this; |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | * @param bool $next |
| 313 | 313 | * @return Route |
| 314 | 314 | */ |
| 315 | - public function continuePropagation($next=true): Route |
|
| 315 | + public function continuePropagation($next = true): Route |
|
| 316 | 316 | { |
| 317 | 317 | $this->continue_propagation = (bool)$next; |
| 318 | 318 | return $this; |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | * Instance route |
| 68 | 68 | * |
| 69 | 69 | * @param string $path |
| 70 | - * @param string|object $class |
|
| 70 | + * @param string $class |
|
| 71 | 71 | * @param string $method |
| 72 | 72 | * @param array $params |
| 73 | 73 | * @return void |
@@ -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 |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | * @param Iterable $config |
| 79 | 79 | * @param Logger $logger |
| 80 | 80 | */ |
| 81 | - public function __construct(?Iterable $config, Logger $logger) |
|
| 81 | + public function __construct(? Iterable $config, Logger $logger) |
|
| 82 | 82 | { |
| 83 | 83 | $this->setOptions($config); |
| 84 | 84 | $this->logger = $logger; |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | public function connect(): Pdo |
| 94 | 94 | { |
| 95 | 95 | $this->connection = new PdoServer($this->dsn, $this->username, $this->password, $this->options); |
| 96 | - $this->logger->info('connection to db server [' . $this->dsn . '] using pdo was succesful', [ |
|
| 96 | + $this->logger->info('connection to db server ['.$this->dsn.'] using pdo was succesful', [ |
|
| 97 | 97 | 'category' => get_class($this), |
| 98 | 98 | ]); |
| 99 | 99 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | * @param array $argumnets |
| 109 | 109 | * @return mixed |
| 110 | 110 | */ |
| 111 | - public function __call(string $method, array $arguments=[]) |
|
| 111 | + public function __call(string $method, array $arguments = []) |
|
| 112 | 112 | { |
| 113 | 113 | return call_user_func_array([&$this->connection, $method], $arguments); |
| 114 | 114 | } |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | * @param Iterable $config |
| 121 | 121 | * @return Pdo |
| 122 | 122 | */ |
| 123 | - public function setOptions(?Iterable $config = null): Pdo |
|
| 123 | + public function setOptions(? Iterable $config = null) : Pdo |
|
| 124 | 124 | { |
| 125 | 125 | if ($config === null) { |
| 126 | 126 | return $this; |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | $this->password = (string)$value; |
| 139 | 139 | break; |
| 140 | 140 | case 'options': |
| 141 | - foreach($value as $opt => $val) { |
|
| 141 | + foreach ($value as $opt => $val) { |
|
| 142 | 142 | $this->options[$opt] = (string)$val; |
| 143 | 143 | } |
| 144 | 144 | break; |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | $link = $this->getResource(); |
| 180 | 180 | $result = $link->query($query); |
| 181 | 181 | |
| 182 | - if($result === false) { |
|
| 182 | + if ($result === false) { |
|
| 183 | 183 | throw new Exception('failed to execute sql query with error '.$link->errorInfo()[2].' ('.$link->errorCode().')'); |
| 184 | 184 | } |
| 185 | 185 | |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | $link = $this->getResource(); |
| 203 | 203 | $result = $link->exec($query); |
| 204 | 204 | |
| 205 | - if($result === false) { |
|
| 205 | + if ($result === false) { |
|
| 206 | 206 | throw new Exception('failed to execute sql query with error '.$link->errorInfo().' ('.$link->errorCode().')'); |
| 207 | 207 | } else { |
| 208 | 208 | $this->logger->debug('sql query affected ['.$result.'] rows', [ |
@@ -231,12 +231,12 @@ discard block |
||
| 231 | 231 | $link = $this->getResource(); |
| 232 | 232 | $stmt = $link->prepare($query); |
| 233 | 233 | |
| 234 | - if(!($stmt instanceof mysqli_stmt)) { |
|
| 234 | + if (!($stmt instanceof mysqli_stmt)) { |
|
| 235 | 235 | throw new Exception('failed to prepare mysql query with error '.$link->error.' ('.$link->errno.')'); |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | $types = ''; |
| 239 | - foreach($values as $attr => $value) { |
|
| 239 | + foreach ($values as $attr => $value) { |
|
| 240 | 240 | $types .= 's'; |
| 241 | 241 | } |
| 242 | 242 | |
@@ -129,7 +129,7 @@ |
||
| 129 | 129 | * Forward calls |
| 130 | 130 | * |
| 131 | 131 | * @param array $method |
| 132 | - * @param array $argumnets |
|
| 132 | + * @param array $arguments |
|
| 133 | 133 | * @return mixed |
| 134 | 134 | */ |
| 135 | 135 | public function __call(string $method, array $arguments=[]) |
@@ -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 |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | * |
| 69 | 69 | * @var bool |
| 70 | 70 | */ |
| 71 | - protected $tls=false; |
|
| 71 | + protected $tls = false; |
|
| 72 | 72 | |
| 73 | 73 | |
| 74 | 74 | /** |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | * @param Logger $logger |
| 87 | 87 | * @return resource |
| 88 | 88 | */ |
| 89 | - public function __construct(?Iterable $config, Logger $logger) |
|
| 89 | + public function __construct(? Iterable $config, Logger $logger) |
|
| 90 | 90 | { |
| 91 | 91 | $this->setOptions($config); |
| 92 | 92 | $this->logger = $logger; |
@@ -100,13 +100,13 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | public function connect(): Ldap |
| 102 | 102 | { |
| 103 | - if($this->binddn === null) { |
|
| 103 | + if ($this->binddn === null) { |
|
| 104 | 104 | $this->logger->warning('no binddn set for ldap connection, you should avoid anonymous bind', [ |
| 105 | 105 | 'category' => get_class($this), |
| 106 | 106 | ]); |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - if($this->tls === false || substr($this->uri, 0, 5) !== 'ldaps') { |
|
| 109 | + if ($this->tls === false || substr($this->uri, 0, 5) !== 'ldaps') { |
|
| 110 | 110 | $this->logger->warning('neither tls nor ldaps enabled for ldap connection, it is strongly reccommended to encrypt ldap connections', [ |
| 111 | 111 | 'category' => get_class($this), |
| 112 | 112 | ]); |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if ($this->connection) { |
| 126 | - if($this->binddn !== null) { |
|
| 126 | + if ($this->binddn !== null) { |
|
| 127 | 127 | $bind = ldap_bind($this->connection, $this->binddn, $this->bindpw); |
| 128 | 128 | |
| 129 | 129 | if ($bind) { |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | * @param Iterable $config |
| 166 | 166 | * @return Ldap |
| 167 | 167 | */ |
| 168 | - public function setOptions(?Iterable $config=null): Ldap |
|
| 168 | + public function setOptions(? Iterable $config = null) : Ldap |
|
| 169 | 169 | { |
| 170 | 170 | if ($config === null) { |
| 171 | 171 | return $this; |
@@ -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 |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | * @param string $config |
| 41 | 41 | * @return void |
| 42 | 42 | */ |
| 43 | - public function __construct($config=[]) |
|
| 43 | + public function __construct($config = []) |
|
| 44 | 44 | { |
| 45 | 45 | if ($config instanceof ConfigInterface) { |
| 46 | 46 | $this->store = $config->map(); |
@@ -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 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Micro |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Micro |