@@ -127,7 +127,7 @@ |
||
127 | 127 | $success = true; |
128 | 128 | |
129 | 129 | foreach ($paths as $path) { |
130 | - if (!@unlink($path)) { |
|
130 | + if ( ! @unlink($path)) { |
|
131 | 131 | $success = false; |
132 | 132 | } |
133 | 133 | } |
@@ -72,7 +72,7 @@ |
||
72 | 72 | */ |
73 | 73 | public function select($query, $bindings = []) |
74 | 74 | { |
75 | - return $this->run($query, $bindings, function ($me, $query, $bindings) { |
|
75 | + return $this->run($query, $bindings, function($me, $query, $bindings) { |
|
76 | 76 | list($query, $bindings) = $me->prepareBindings($query, $bindings); |
77 | 77 | |
78 | 78 | // For select statements, we'll simply execute the query and return an array |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | { |
212 | 212 | $instance = (new static())->setConnection($connection); |
213 | 213 | |
214 | - $items = array_map(function ($item) use ($instance) { |
|
214 | + $items = array_map(function($item) use ($instance) { |
|
215 | 215 | return $instance->newFromBuilder($item); |
216 | 216 | }, $items); |
217 | 217 | |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | $value = $this->getAttributeFromArray($key); |
332 | 332 | |
333 | 333 | if (in_array($key, $this->getDates())) { |
334 | - if (!is_null($value)) { |
|
334 | + if ( ! is_null($value)) { |
|
335 | 335 | return $this->asDateTime($value); |
336 | 336 | } |
337 | 337 | } |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | { |
389 | 389 | $relations = $this->$method(); |
390 | 390 | |
391 | - if (!$relations instanceof Relation) { |
|
391 | + if ( ! $relations instanceof Relation) { |
|
392 | 392 | throw new LogicException('Relationship method must return an object of type '.'Magister\Services\Database\Elegant\Relations\Relation'); |
393 | 393 | } |
394 | 394 |
@@ -95,7 +95,7 @@ |
||
95 | 95 | { |
96 | 96 | $select = is_null($key) ? [$column] : [$column, $key]; |
97 | 97 | |
98 | - return array_map(function ($column) { |
|
98 | + return array_map(function($column) { |
|
99 | 99 | $dot = strpos($column, '.'); |
100 | 100 | |
101 | 101 | return $dot === false ? $column : substr($column, $dot + 1); |
@@ -17,7 +17,7 @@ |
||
17 | 17 | */ |
18 | 18 | public function register() |
19 | 19 | { |
20 | - $this->app->singleton('db', function ($app) { |
|
20 | + $this->app->singleton('db', function($app) { |
|
21 | 21 | return new DatabaseManager($app); |
22 | 22 | }); |
23 | 23 | } |
@@ -42,7 +42,7 @@ |
||
42 | 42 | { |
43 | 43 | $name = $name ?: $this->getDefaultConnection(); |
44 | 44 | |
45 | - if (!isset($this->connections[$name])) { |
|
45 | + if ( ! isset($this->connections[$name])) { |
|
46 | 46 | $connection = $this->makeConnection(); |
47 | 47 | |
48 | 48 | $this->connections[$name] = $connection; |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function make($abstract) |
58 | 58 | { |
59 | - if (!$this->bound($abstract)) { |
|
59 | + if ( ! $this->bound($abstract)) { |
|
60 | 60 | throw new InvalidArgumentException(sprintf('Identifier "%s" is not defined.', $abstract)); |
61 | 61 | } |
62 | 62 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | */ |
100 | 100 | public static function share(Closure $callable) |
101 | 101 | { |
102 | - return function ($c) use ($callable) { |
|
102 | + return function($c) use ($callable) { |
|
103 | 103 | static $object; |
104 | 104 | |
105 | 105 | if (null === $object) { |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public static function protect(Closure $callable) |
121 | 121 | { |
122 | - return function ($c) use ($callable) { |
|
122 | + return function($c) use ($callable) { |
|
123 | 123 | return $callable; |
124 | 124 | }; |
125 | 125 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | */ |
136 | 136 | public function raw($abstract) |
137 | 137 | { |
138 | - if (!array_key_exists($abstract, $this->bindings)) { |
|
138 | + if ( ! array_key_exists($abstract, $this->bindings)) { |
|
139 | 139 | throw new InvalidArgumentException(sprintf('Identifier "%s" is not defined.', $abstract)); |
140 | 140 | } |
141 | 141 | |
@@ -154,17 +154,17 @@ discard block |
||
154 | 154 | */ |
155 | 155 | public function extend($abstract, Closure $callable) |
156 | 156 | { |
157 | - if (!array_key_exists($abstract, $this->bindings)) { |
|
157 | + if ( ! array_key_exists($abstract, $this->bindings)) { |
|
158 | 158 | throw new InvalidArgumentException(sprintf('Identifier "%s" is not defined.', $abstract)); |
159 | 159 | } |
160 | 160 | |
161 | 161 | $factory = $this->bindings[$abstract]; |
162 | 162 | |
163 | - if (!($factory instanceof Closure)) { |
|
163 | + if ( ! ($factory instanceof Closure)) { |
|
164 | 164 | throw new InvalidArgumentException(sprintf('Identifier "%s" does not contain an object definition.', $abstract)); |
165 | 165 | } |
166 | 166 | |
167 | - return $this->bindings[$abstract] = function ($c) use ($callable, $factory) { |
|
167 | + return $this->bindings[$abstract] = function($c) use ($callable, $factory) { |
|
168 | 168 | return $callable($factory($c), $c); |
169 | 169 | }; |
170 | 170 | } |
@@ -16,7 +16,7 @@ |
||
16 | 16 | */ |
17 | 17 | public function register() |
18 | 18 | { |
19 | - $this->app->singleton('cookie', function ($app) { |
|
19 | + $this->app->singleton('cookie', function($app) { |
|
20 | 20 | $cookie = new CookieJar($app['encrypter']); |
21 | 21 | |
22 | 22 | $config = $app['config']['session']; |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function has($key) |
54 | 54 | { |
55 | - return !is_null($this->get($key)); |
|
55 | + return ! is_null($this->get($key)); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | { |
68 | 68 | $value = isset($_COOKIE[$key]) ? $_COOKIE[$key] : null; |
69 | 69 | |
70 | - if (!is_null($value)) { |
|
70 | + if ( ! is_null($value)) { |
|
71 | 71 | return $this->decrypt($value); |
72 | 72 | } |
73 | 73 |