@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | * |
| 325 | 325 | * @param string $type The attachment type. |
| 326 | 326 | * @throws InvalidArgumentException If provided argument is not of type 'string'. |
| 327 | - * @return string |
|
| 327 | + * @return Attachment |
|
| 328 | 328 | */ |
| 329 | 329 | public function setType($type) |
| 330 | 330 | { |
@@ -765,7 +765,7 @@ discard block |
||
| 765 | 765 | /** |
| 766 | 766 | * Retrieve the attachment's sub-title. |
| 767 | 767 | * |
| 768 | - * @return Translation|string|null |
|
| 768 | + * @return null|Translation |
|
| 769 | 769 | */ |
| 770 | 770 | public function subtitle() |
| 771 | 771 | { |
@@ -775,7 +775,7 @@ discard block |
||
| 775 | 775 | /** |
| 776 | 776 | * Retrieve attachment's description. |
| 777 | 777 | * |
| 778 | - * @return Translation|string|null |
|
| 778 | + * @return null|Translation |
|
| 779 | 779 | */ |
| 780 | 780 | public function description() |
| 781 | 781 | { |
@@ -795,7 +795,7 @@ discard block |
||
| 795 | 795 | /** |
| 796 | 796 | * Retrieve the path to the thumbnail associated with the object. |
| 797 | 797 | * |
| 798 | - * @return string|null |
|
| 798 | + * @return string |
|
| 799 | 799 | */ |
| 800 | 800 | public function thumbnail() |
| 801 | 801 | { |
@@ -838,7 +838,7 @@ discard block |
||
| 838 | 838 | /** |
| 839 | 839 | * Retrieve the file label. |
| 840 | 840 | * |
| 841 | - * @return string|null |
|
| 841 | + * @return null|Translation |
|
| 842 | 842 | */ |
| 843 | 843 | public function fileLabel() |
| 844 | 844 | { |
@@ -848,7 +848,7 @@ discard block |
||
| 848 | 848 | /** |
| 849 | 849 | * Retrieve the link label. |
| 850 | 850 | * |
| 851 | - * @return string|null |
|
| 851 | + * @return null|Translation |
|
| 852 | 852 | */ |
| 853 | 853 | public function linkLabel() |
| 854 | 854 | { |
@@ -893,7 +893,7 @@ discard block |
||
| 893 | 893 | } |
| 894 | 894 | |
| 895 | 895 | /** |
| 896 | - * @return ModelInterface|mixed |
|
| 896 | + * @return ModelInterface |
|
| 897 | 897 | */ |
| 898 | 898 | public function presenter() |
| 899 | 899 | { |
@@ -1001,7 +1001,7 @@ discard block |
||
| 1001 | 1001 | * Prepend the base URI to the given path. |
| 1002 | 1002 | * |
| 1003 | 1003 | * @param string $text A string to parse relative URIs. |
| 1004 | - * @return UriInterface|null |
|
| 1004 | + * @return string |
|
| 1005 | 1005 | */ |
| 1006 | 1006 | protected function resolveUrls($text) |
| 1007 | 1007 | { |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | { |
| 197 | 197 | parent::__construct($data); |
| 198 | 198 | |
| 199 | - if (is_callable([ $this, 'defaultData' ])) { |
|
| 199 | + if (is_callable([$this, 'defaultData'])) { |
|
| 200 | 200 | $defaultData = $this->metadata()->defaultData(); |
| 201 | 201 | if ($defaultData) { |
| 202 | 202 | $this->setData($defaultData); |
@@ -372,7 +372,7 @@ discard block |
||
| 372 | 372 | */ |
| 373 | 373 | public function heading() |
| 374 | 374 | { |
| 375 | - $heading = $this->render((string)$this->heading); |
|
| 375 | + $heading = $this->render((string) $this->heading); |
|
| 376 | 376 | |
| 377 | 377 | if (!$heading) { |
| 378 | 378 | $heading = $this->translator()->translation('{{ objType }} #{{ id }}', [ |
@@ -415,7 +415,7 @@ discard block |
||
| 415 | 415 | public function preview() |
| 416 | 416 | { |
| 417 | 417 | if ($this->preview) { |
| 418 | - return $this->render((string)$this->preview); |
|
| 418 | + return $this->render((string) $this->preview); |
|
| 419 | 419 | } |
| 420 | 420 | |
| 421 | 421 | return ''; |
@@ -1008,19 +1008,19 @@ discard block |
||
| 1008 | 1008 | static $search; |
| 1009 | 1009 | |
| 1010 | 1010 | if ($search === null) { |
| 1011 | - $attr = [ 'href', 'link', 'url', 'src' ]; |
|
| 1012 | - $scheme = [ '../', './', '/', 'data', 'mailto', 'http' ]; |
|
| 1011 | + $attr = ['href', 'link', 'url', 'src']; |
|
| 1012 | + $scheme = ['../', './', '/', 'data', 'mailto', 'http']; |
|
| 1013 | 1013 | |
| 1014 | 1014 | $search = sprintf( |
| 1015 | 1015 | '(?<=%1$s=")(?!%2$s)(\S+)(?=")', |
| 1016 | - implode('="|', array_map('preg_quote', $attr, [ '~' ])), |
|
| 1017 | - implode('|', array_map('preg_quote', $scheme, [ '~' ])) |
|
| 1016 | + implode('="|', array_map('preg_quote', $attr, ['~'])), |
|
| 1017 | + implode('|', array_map('preg_quote', $scheme, ['~'])) |
|
| 1018 | 1018 | ); |
| 1019 | 1019 | } |
| 1020 | 1020 | |
| 1021 | 1021 | $text = preg_replace_callback( |
| 1022 | 1022 | '~'.$search.'~i', |
| 1023 | - function ($matches) { |
|
| 1023 | + function($matches) { |
|
| 1024 | 1024 | return $this->createAbsoluteUrl($matches[1]); |
| 1025 | 1025 | }, |
| 1026 | 1026 | $text |
@@ -1039,7 +1039,7 @@ discard block |
||
| 1039 | 1039 | protected function isRelativeUri($uri) |
| 1040 | 1040 | { |
| 1041 | 1041 | if ($uri && !parse_url($uri, PHP_URL_SCHEME)) { |
| 1042 | - if (!in_array($uri[0], [ '/', '#', '?' ])) { |
|
| 1042 | + if (!in_array($uri[0], ['/', '#', '?'])) { |
|
| 1043 | 1043 | return true; |
| 1044 | 1044 | } |
| 1045 | 1045 | } |
@@ -24,7 +24,6 @@ |
||
| 24 | 24 | use League\CLImate\Util\UtilFactory; |
| 25 | 25 | |
| 26 | 26 | // From 'charcoal-core' |
| 27 | -use Charcoal\Source\DatabaseSource; |
|
| 28 | 27 | use Charcoal\Model\ServiceProvider\ModelServiceProvider; |
| 29 | 28 | |
| 30 | 29 | // From 'charcoal-user' |
@@ -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 | } |