@@ -6,7 +6,7 @@ |
||
| 6 | 6 | * For the full copyright and license information, please view the LICENSE |
| 7 | 7 | * file that was distributed with this source code. |
| 8 | 8 | */ |
| 9 | -declare(strict_types=1); |
|
| 9 | +declare(strict_types = 1); |
|
| 10 | 10 | |
| 11 | 11 | namespace App\Providers; |
| 12 | 12 | |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | * For the full copyright and license information, please view the LICENSE |
| 7 | 7 | * file that was distributed with this source code. |
| 8 | 8 | */ |
| 9 | -declare(strict_types=1); |
|
| 9 | +declare(strict_types = 1); |
|
| 10 | 10 | |
| 11 | 11 | namespace App\Providers; |
| 12 | 12 | |
@@ -5,7 +5,7 @@ discard block |
||
| 5 | 5 | * For the full copyright and license information, please view the LICENSE |
| 6 | 6 | * file that was distributed with this source code. |
| 7 | 7 | */ |
| 8 | -declare(strict_types=1); |
|
| 8 | +declare(strict_types = 1); |
|
| 9 | 9 | |
| 10 | 10 | namespace App\Console\Commands; |
| 11 | 11 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | if (count($files) === 0) { |
| 58 | 58 | $this->info('Skipping: Documentation are actual.'); |
| 59 | 59 | } else { |
| 60 | - $this->info('Found ' . count($files) . ' new pages.'); |
|
| 60 | + $this->info('Found '.count($files).' new pages.'); |
|
| 61 | 61 | $this->info('Start sync progress...'); |
| 62 | 62 | |
| 63 | 63 | $this->output->progressStart(count($files)); |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | return $manager->findFiles(...$config->values()) |
| 103 | 103 | // Remove not updated docs |
| 104 | - ->reject(function (DocsStatus $status) use ($exists, $isForce) { |
|
| 104 | + ->reject(function(DocsStatus $status) use ($exists, $isForce) { |
|
| 105 | 105 | if ($isForce) { |
| 106 | 106 | return false; |
| 107 | 107 | } |
@@ -132,11 +132,11 @@ discard block |
||
| 132 | 132 | $docs->content_source = $page->getContent(); |
| 133 | 133 | $docs->github_hash = $status->getHash(); |
| 134 | 134 | |
| 135 | - if (! $docs->category_id) { |
|
| 135 | + if (!$docs->category_id) { |
|
| 136 | 136 | $docs->category_id = 0; // TODO |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | - if (! $docs->title) { |
|
| 139 | + if (!$docs->title) { |
|
| 140 | 140 | $docs->title = Str::ucfirst(str_replace( |
| 141 | 141 | ['-', '_'], |
| 142 | 142 | ' ', |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | * For the full copyright and license information, please view the LICENSE |
| 6 | 6 | * file that was distributed with this source code. |
| 7 | 7 | */ |
| 8 | -declare(strict_types=1); |
|
| 8 | +declare(strict_types = 1); |
|
| 9 | 9 | |
| 10 | 10 | namespace App\Services\ContentRenderer\Anchors; |
| 11 | 11 | |
@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | * For the full copyright and license information, please view the LICENSE |
| 5 | 5 | * file that was distributed with this source code. |
| 6 | 6 | */ |
| 7 | -declare(strict_types=1); |
|
| 7 | +declare(strict_types = 1); |
|
| 8 | 8 | |
| 9 | 9 | namespace App\Services\ContentRenderer; |
| 10 | 10 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | private function fixDocsNavigationLinks(): \Closure |
| 50 | 50 | { |
| 51 | - return function (string $body) { |
|
| 51 | + return function(string $body) { |
|
| 52 | 52 | return $body; |
| 53 | 53 | }; |
| 54 | 54 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | { |
| 63 | 63 | $pattern = '/<blockquote>\s*<p>\s*{([a-z]+)}\s*(.*?)<\/p>\s*<\/blockquote>/isu'; |
| 64 | 64 | |
| 65 | - return function (string $body) use ($pattern) { |
|
| 65 | + return function(string $body) use ($pattern) { |
|
| 66 | 66 | return preg_replace($pattern, '<blockquote class="quote-$1">$2</blockquote>', $body); |
| 67 | 67 | }; |
| 68 | 68 | } |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | private function removeLeadingNavigation(): \Closure |
| 76 | 76 | { |
| 77 | - return function (string $body) { |
|
| 77 | + return function(string $body) { |
|
| 78 | 78 | /** |
| 79 | 79 | * TODO This expression are vulnerable: ReDoS-based exploit. Probably we can improve and fix it? |
| 80 | 80 | * |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | { |
| 95 | 95 | $replacement = '<a href="#" style="display: none;" name="$1"></a>'; |
| 96 | 96 | |
| 97 | - return function (string $body) use ($replacement) { |
|
| 97 | + return function(string $body) use ($replacement) { |
|
| 98 | 98 | return preg_replace('/<a.+?name="(.*?)".*?>.*?<\/a>/isu', $replacement, $body); |
| 99 | 99 | }; |
| 100 | 100 | } |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | */ |
| 107 | 107 | private function removeDocumentTitle(): \Closure |
| 108 | 108 | { |
| 109 | - return function (string $body) { |
|
| 109 | + return function(string $body) { |
|
| 110 | 110 | return preg_replace('/^[\s\n]*?#\s+?.*?\n/isu', '', $body); |
| 111 | 111 | }; |
| 112 | 112 | } |
@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | * For the full copyright and license information, please view the LICENSE |
| 5 | 5 | * file that was distributed with this source code. |
| 6 | 6 | */ |
| 7 | -declare(strict_types=1); |
|
| 7 | +declare(strict_types = 1); |
|
| 8 | 8 | |
| 9 | 9 | namespace App\Services\ContentRenderer\Support; |
| 10 | 10 | |
@@ -30,15 +30,15 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | protected function normalizeHeaders(): \Closure |
| 32 | 32 | { |
| 33 | - return function (string $body) { |
|
| 34 | - return preg_replace_callback('/^(#+)\s+(.*?)\s*$/mius', function (array $matches) { |
|
| 33 | + return function(string $body) { |
|
| 34 | + return preg_replace_callback('/^(#+)\s+(.*?)\s*$/mius', function(array $matches) { |
|
| 35 | 35 | [$body, $level, $title] = $matches; |
| 36 | 36 | |
| 37 | 37 | $size = $this->tags[ |
| 38 | 38 | max(1, min(6, strlen($level))) |
| 39 | 39 | ]; |
| 40 | 40 | |
| 41 | - return str_repeat('#', $size) . ' ' . $title; |
|
| 41 | + return str_repeat('#', $size).' '.$title; |
|
| 42 | 42 | }, $body); |
| 43 | 43 | }; |
| 44 | 44 | } |