@@ -69,7 +69,7 @@ |
||
| 69 | 69 | $pivot = $this->modelFactory()->create(Join::class); |
| 70 | 70 | |
| 71 | 71 | if (is_string($data) && strpos($data, '_') > 1) { |
| 72 | - $data = array_combine([ 'obj_type', 'obj_id' ], explode('_', $data, 1)); |
|
| 72 | + $data = array_combine(['obj_type', 'obj_id'], explode('_', $data, 1)); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | if (is_scalar($data)) { |
@@ -402,7 +402,7 @@ |
||
| 402 | 402 | ); |
| 403 | 403 | } |
| 404 | 404 | |
| 405 | - $this->position = (int)$position; |
|
| 405 | + $this->position = (int) $position; |
|
| 406 | 406 | |
| 407 | 407 | return $this; |
| 408 | 408 | } |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | ]); |
| 257 | 257 | $rows = $source->dbQuery( |
| 258 | 258 | strtr($sql, $binds), |
| 259 | - [ 'objType' => $row['object_type'] ] |
|
| 259 | + ['objType' => $row['object_type']] |
|
| 260 | 260 | ); |
| 261 | 261 | |
| 262 | 262 | /** @todo Show found rows, confirm deletion of dead relationships */ |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | $sql = 'SELECT p.* FROM `%pivotTable` AS p WHERE p.`%sourceType` = :objType;'; |
| 277 | 277 | $rows = $source->dbQuery( |
| 278 | 278 | strtr($sql, $defaultBinds), |
| 279 | - [ 'objType' => $model ] |
|
| 279 | + ['objType' => $model] |
|
| 280 | 280 | ); |
| 281 | 281 | |
| 282 | 282 | /** @todo Explain missing model, confirm deletion of dead relationships */ |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | ]; |
| 395 | 395 | |
| 396 | 396 | if ($ask && $verb) { |
| 397 | - $dead = array_merge([ 'Deleted' => null, 'Failed' => null ], $dead); |
|
| 397 | + $dead = array_merge(['Deleted' => null, 'Failed' => null], $dead); |
|
| 398 | 398 | } |
| 399 | 399 | } |
| 400 | 400 | |
@@ -617,7 +617,7 @@ discard block |
||
| 617 | 617 | $cli = $this->climate(); |
| 618 | 618 | |
| 619 | 619 | if (is_string($this->action)) { |
| 620 | - $opts = [ 'y', 'n', 'r', 'q', '?' ]; |
|
| 620 | + $opts = ['y', 'n', 'r', 'q', '?']; |
|
| 621 | 621 | $help = [ |
| 622 | 622 | '[y]es — delete the attachment', |
| 623 | 623 | '[n]o — don’t delete the attachment', |
@@ -625,7 +625,7 @@ discard block |
||
| 625 | 625 | '[q]uit — exit immediately (does not undo previous actions)', |
| 626 | 626 | ]; |
| 627 | 627 | } else { |
| 628 | - $opts = [ 'y', 'a', 'n', 's', 'q', '?' ]; |
|
| 628 | + $opts = ['y', 'a', 'n', 's', 'q', '?']; |
|
| 629 | 629 | $help = [ |
| 630 | 630 | '[y]es — delete this attachment', |
| 631 | 631 | '[a]ll — delete all attachments', |
@@ -686,7 +686,7 @@ discard block |
||
| 686 | 686 | { |
| 687 | 687 | $cli = $this->climate(); |
| 688 | 688 | |
| 689 | - $opts = [ 'y', 'n', 'v', '?' ]; |
|
| 689 | + $opts = ['y', 'n', 'v', '?']; |
|
| 690 | 690 | $help = [ |
| 691 | 691 | '[y]es — continue to deletion phase', |
| 692 | 692 | '[n]o — cancel deletion phase', |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | |
| 90 | 90 | $count = count($attachments); |
| 91 | 91 | $i = 0; |
| 92 | - for (; $i<$count; $i++) { |
|
| 92 | + for (; $i < $count; $i++) { |
|
| 93 | 93 | $attachmentId = $attachments[$i]['attachment_id']; |
| 94 | 94 | $position = $attachments[$i]['position']; |
| 95 | 95 | |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | public function attachments(...$args) |
| 59 | 59 | { |
| 60 | 60 | $attachables = $this->attachableObjects(); |
| 61 | - $attachments = call_user_func_array([ $this, 'getAttachments' ], $args); |
|
| 61 | + $attachments = call_user_func_array([$this, 'getAttachments'], $args); |
|
| 62 | 62 | |
| 63 | 63 | foreach ($attachments as $attachment) { |
| 64 | 64 | if (isset($attachables[$attachment->objType()])) { |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | ]); |
| 211 | 211 | |
| 212 | 212 | foreach ($attachments as $attachment) { |
| 213 | - $this->setDynamicTemplate('widget_template', (string)$attachment->rawPreview()); |
|
| 213 | + $this->setDynamicTemplate('widget_template', (string) $attachment->rawPreview()); |
|
| 214 | 214 | |
| 215 | 215 | if (isset($attachableObjects[$attachment->objType()])) { |
| 216 | 216 | $attachment->attachmentType = $attachableObjects[$attachment->objType()]; |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | ); |
| 475 | 475 | } |
| 476 | 476 | |
| 477 | - $num = (int)$num; |
|
| 477 | + $num = (int) $num; |
|
| 478 | 478 | |
| 479 | 479 | if ($num < 0) { |
| 480 | 480 | throw new InvalidArgumentException( |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | ); |
| 503 | 503 | } |
| 504 | 504 | |
| 505 | - $page = (int)$page; |
|
| 505 | + $page = (int) $page; |
|
| 506 | 506 | |
| 507 | 507 | if ($page < 0) { |
| 508 | 508 | throw new InvalidArgumentException( |
@@ -82,11 +82,11 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | public function registerBaseUrl(Container $container) |
| 84 | 84 | { |
| 85 | - $container['base-url'] = function () { |
|
| 85 | + $container['base-url'] = function() { |
|
| 86 | 86 | return Uri::createFromString(''); |
| 87 | 87 | }; |
| 88 | 88 | |
| 89 | - $container['admin/base-url'] = function () { |
|
| 89 | + $container['admin/base-url'] = function() { |
|
| 90 | 90 | return Uri::createFromString('admin'); |
| 91 | 91 | }; |
| 92 | 92 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | */ |
| 100 | 100 | public function registerConfig(Container $container) |
| 101 | 101 | { |
| 102 | - $container['config'] = function () { |
|
| 102 | + $container['config'] = function() { |
|
| 103 | 103 | return new AppConfig([ |
| 104 | 104 | 'base_path' => realpath(__DIR__.'/../../..'), |
| 105 | 105 | 'apis' => [ |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | { |
| 150 | 150 | $this->registerConfig($container); |
| 151 | 151 | |
| 152 | - $container['admin/config'] = function () { |
|
| 152 | + $container['admin/config'] = function() { |
|
| 153 | 153 | return new AdminConfig(); |
| 154 | 154 | }; |
| 155 | 155 | } |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | */ |
| 161 | 161 | public function registerClimate(Container $container) |
| 162 | 162 | { |
| 163 | - $container['climate/system'] = function () { |
|
| 163 | + $container['climate/system'] = function() { |
|
| 164 | 164 | $system = Mockery::mock(Linux::class); |
| 165 | 165 | $system->shouldReceive('hasAnsiSupport')->andReturn(true); |
| 166 | 166 | $system->shouldReceive('width')->andReturn(80); |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | return $system; |
| 169 | 169 | }; |
| 170 | 170 | |
| 171 | - $container['climate/output'] = function () { |
|
| 171 | + $container['climate/output'] = function() { |
|
| 172 | 172 | $output = Mockery::mock(Output::class); |
| 173 | 173 | $output->shouldReceive('persist')->andReturn($output); |
| 174 | 174 | $output->shouldReceive('sameLine')->andReturn($output); |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | return $output; |
| 178 | 178 | }; |
| 179 | 179 | |
| 180 | - $container['climate/reader'] = function () { |
|
| 180 | + $container['climate/reader'] = function() { |
|
| 181 | 181 | $reader = Mockery::mock(Stdin::class); |
| 182 | 182 | $reader->shouldReceive('line')->andReturn('line'); |
| 183 | 183 | $reader->shouldReceive('char')->andReturn('char'); |
@@ -185,11 +185,11 @@ discard block |
||
| 185 | 185 | return $reader; |
| 186 | 186 | }; |
| 187 | 187 | |
| 188 | - $container['climate/util'] = function (Container $container) { |
|
| 188 | + $container['climate/util'] = function(Container $container) { |
|
| 189 | 189 | return new UtilFactory($container['climate/system']); |
| 190 | 190 | }; |
| 191 | 191 | |
| 192 | - $container['climate'] = function (Container $container) { |
|
| 192 | + $container['climate'] = function(Container $container) { |
|
| 193 | 193 | $climate = new CLImate(); |
| 194 | 194 | |
| 195 | 195 | $climate->setOutput($container['climate/output']); |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | */ |
| 207 | 207 | public function registerDatabase(Container $container) |
| 208 | 208 | { |
| 209 | - $container['database'] = function () { |
|
| 209 | + $container['database'] = function() { |
|
| 210 | 210 | $pdo = new PDO('sqlite::memory:'); |
| 211 | 211 | $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
| 212 | 212 | return $pdo; |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | */ |
| 295 | 295 | public function registerLogger(Container $container) |
| 296 | 296 | { |
| 297 | - $container['logger'] = function () { |
|
| 297 | + $container['logger'] = function() { |
|
| 298 | 298 | return new NullLogger(); |
| 299 | 299 | }; |
| 300 | 300 | } |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | */ |
| 306 | 306 | public function registerCache(Container $container) |
| 307 | 307 | { |
| 308 | - $container['cache'] = function () { |
|
| 308 | + $container['cache'] = function() { |
|
| 309 | 309 | return new Pool(); |
| 310 | 310 | }; |
| 311 | 311 | } |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | */ |
| 133 | 133 | public function description() |
| 134 | 134 | { |
| 135 | - return $this->renderTemplate((string)parent::description()); |
|
| 135 | + return $this->renderTemplate((string) parent::description()); |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | /** |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | */ |
| 141 | 141 | public function notes() |
| 142 | 142 | { |
| 143 | - return $this->renderTemplate((string)parent::notes()); |
|
| 143 | + return $this->renderTemplate((string) parent::notes()); |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | /** |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | $rows = array_chunk($this->attachments()->values(), $this->numColumns); |
| 33 | 33 | |
| 34 | 34 | /** Map row content with useful front-end properties. */ |
| 35 | - array_walk($rows, function (&$attachment, $index) { |
|
| 35 | + array_walk($rows, function(&$attachment, $index) { |
|
| 36 | 36 | $attachment = [ |
| 37 | 37 | 'columns' => $attachment, |
| 38 | 38 | 'isFirst' => ($index === 0), |
@@ -50,6 +50,6 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function columnWidth() |
| 52 | 52 | { |
| 53 | - return (string)ceil(12/$this->numColumns); |
|
| 53 | + return (string) ceil(12 / $this->numColumns); |
|
| 54 | 54 | } |
| 55 | 55 | } |