@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | $di = new DI(); |
| 18 | 18 | $service = 'someService'; |
| 19 | 19 | |
| 20 | - $di->set($service, function () { |
|
| 20 | + $di->set($service, function() { |
|
| 21 | 21 | return new \stdClass(); |
| 22 | 22 | }); |
| 23 | 23 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | $di = new DI(); |
| 36 | 36 | $service = 'someService'; |
| 37 | 37 | |
| 38 | - $di->setShared($service, function () { |
|
| 38 | + $di->setShared($service, function() { |
|
| 39 | 39 | return new \stdClass(); |
| 40 | 40 | }); |
| 41 | 41 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | $di = new DI(); |
| 90 | 90 | $service = 'session'; |
| 91 | 91 | |
| 92 | - $di->set($service, function () { |
|
| 92 | + $di->set($service, function() { |
|
| 93 | 93 | $session = new \stdClass(); |
| 94 | 94 | return $session; |
| 95 | 95 | }); |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | { |
| 108 | 108 | $di = new DI(); |
| 109 | 109 | |
| 110 | - $di->set("dummy", function () { |
|
| 110 | + $di->set("dummy", function() { |
|
| 111 | 111 | $obj = new DummyService(); |
| 112 | 112 | return $obj; |
| 113 | 113 | }); |
@@ -131,11 +131,11 @@ discard block |
||
| 131 | 131 | { |
| 132 | 132 | $di = new DI(); |
| 133 | 133 | |
| 134 | - $di->set("service1", function () { |
|
| 134 | + $di->set("service1", function() { |
|
| 135 | 135 | return new \stdClass(); |
| 136 | 136 | }); |
| 137 | 137 | |
| 138 | - $di->set("service2", function () { |
|
| 138 | + $di->set("service2", function() { |
|
| 139 | 139 | return new \stdClass(); |
| 140 | 140 | }); |
| 141 | 141 | |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | "request" => [ |
| 22 | 22 | "active" => true, |
| 23 | 23 | "shared" => false, |
| 24 | - "callback" => function () { |
|
| 24 | + "callback" => function() { |
|
| 25 | 25 | $object = new \stdClass(); |
| 26 | 26 | return $object; |
| 27 | 27 | } |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | "services" => [ |
| 8 | 8 | "db" => [ |
| 9 | 9 | "shared" => true, |
| 10 | - "callback" => function () { |
|
| 10 | + "callback" => function() { |
|
| 11 | 11 | $db = new \Anax\Database\Database(); |
| 12 | 12 | |
| 13 | 13 | // Load the configuration files |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | { |
| 30 | 30 | $this->expectException("Anax\Database\Exception\Exception"); |
| 31 | 31 | $db = new Database([ |
| 32 | - "dsn" => "NO DNS" |
|
| 32 | + "dsn" => "NO DNS" |
|
| 33 | 33 | ]); |
| 34 | 34 | $db->connect(); |
| 35 | 35 | } |
@@ -43,8 +43,8 @@ discard block |
||
| 43 | 43 | { |
| 44 | 44 | $this->expectException("\PDOException"); |
| 45 | 45 | $db = new Database([ |
| 46 | - "dsn" => "NO DNS", |
|
| 47 | - "debug_connect" => true, |
|
| 46 | + "dsn" => "NO DNS", |
|
| 47 | + "debug_connect" => true, |
|
| 48 | 48 | ]); |
| 49 | 49 | $db->connect(); |
| 50 | 50 | } |
@@ -10,8 +10,8 @@ |
||
| 10 | 10 | /** |
| 11 | 11 | * Set the error reporting. |
| 12 | 12 | */ |
| 13 | -error_reporting(-1); // Report all type of errors |
|
| 14 | -ini_set('display_errors', 1); // Display all errors |
|
| 13 | +error_reporting(-1); // Report all type of errors |
|
| 14 | +ini_set('display_errors', 1); // Display all errors |
|
| 15 | 15 | |
| 16 | 16 | |
| 17 | 17 | |
@@ -119,7 +119,7 @@ |
||
| 119 | 119 | */ |
| 120 | 120 | public function dump() : string |
| 121 | 121 | { |
| 122 | - $html = '<p><i>You have made ' . self::$numQueries . ' database queries.</i></p><pre>'; |
|
| 122 | + $html = '<p><i>You have made ' . self::$numQueries . ' database queries.</i></p><pre>'; |
|
| 123 | 123 | |
| 124 | 124 | foreach (self::$queries as $key => $val) { |
| 125 | 125 | $params = empty(self::$params[$key]) |
@@ -407,10 +407,10 @@ |
||
| 407 | 407 | |
| 408 | 408 | |
| 409 | 409 | /** |
| 410 | - * Return rows affected of last INSERT, UPDATE, DELETE |
|
| 411 | - * |
|
| 412 | - * @return integer as rows affected on last statement |
|
| 413 | - */ |
|
| 410 | + * Return rows affected of last INSERT, UPDATE, DELETE |
|
| 411 | + * |
|
| 412 | + * @return integer as rows affected on last statement |
|
| 413 | + */ |
|
| 414 | 414 | public function rowCount() : int |
| 415 | 415 | { |
| 416 | 416 | return $this->stmt->rowCount(); |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | |
| 138 | 138 | if ($nrOfItems) { |
| 139 | 139 | $query = substr($query, 0, $offset) |
| 140 | - . str_repeat("?,", $nrOfItems - 1) |
|
| 140 | + . str_repeat("?,", $nrOfItems - 1) |
|
| 141 | 141 | . "?" |
| 142 | 142 | . substr($query, $offset + 1); |
| 143 | 143 | $param = array_merge($param, $val); |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | string $query, |
| 200 | 200 | array $params, |
| 201 | 201 | string $class |
| 202 | - ) :? object { |
|
| 202 | + ) : ? object { |
|
| 203 | 203 | return $this->execute($query, $params)->fetchClass($class); |
| 204 | 204 | } |
| 205 | 205 | |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | string $query, |
| 220 | 220 | array $params, |
| 221 | 221 | object $object |
| 222 | - ) :? object { |
|
| 222 | + ) : ? object { |
|
| 223 | 223 | return $this->execute($query, $params)->fetchInto($object); |
| 224 | 224 | } |
| 225 | 225 | |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | * |
| 258 | 258 | * @return null|object with details, null when no resultset |
| 259 | 259 | */ |
| 260 | - public function fetchClass(string $classname) :? object |
|
| 260 | + public function fetchClass(string $classname) : ? object |
|
| 261 | 261 | { |
| 262 | 262 | $this->stmt->setFetchMode(\PDO::FETCH_CLASS, $classname); |
| 263 | 263 | return $this->fetch(); |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | * |
| 289 | 289 | * @return null|object with resultset or null when no match |
| 290 | 290 | */ |
| 291 | - public function fetchInto(object $object) :? object |
|
| 291 | + public function fetchInto(object $object) : ? object |
|
| 292 | 292 | { |
| 293 | 293 | $this->stmt->setFetchMode(\PDO::FETCH_INTO, $object); |
| 294 | 294 | return $this->fetch(); |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | "services" => [ |
| 7 | 7 | "url" => [ |
| 8 | 8 | "shared" => true, |
| 9 | - "callback" => function () { |
|
| 9 | + "callback" => function() { |
|
| 10 | 10 | $url = new \Anax\Url\Url(); |
| 11 | 11 | $request = $this->get("request"); |
| 12 | 12 | $url->setSiteUrl($request->getSiteUrl()); |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | "services" => [ |
| 7 | 7 | "url-empty" => [ |
| 8 | 8 | "shared" => true, |
| 9 | - "callback" => function () { |
|
| 9 | + "callback" => function() { |
|
| 10 | 10 | $url = new \Anax\Url\Url(); |
| 11 | 11 | $request = $this->get("request"); |
| 12 | 12 | $url->setSiteUrl($request->getSiteUrl()); |