@@ -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 @@ |
||
| 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 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | private function removeDocumentTitle(): \Closure |
| 46 | 46 | { |
| 47 | - return function (string $body) { |
|
| 47 | + return function(string $body) { |
|
| 48 | 48 | return preg_replace('/^[\s\n]*?#\s+?.*?\n/isu', '', $body); |
| 49 | 49 | }; |
| 50 | 50 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | private function removeLeadingNavigation(): \Closure |
| 57 | 57 | { |
| 58 | - return function (string $body) { |
|
| 58 | + return function(string $body) { |
|
| 59 | 59 | /** |
| 60 | 60 | * TODO This expression are vulnerable: ReDoS-based exploit. Probably we can improve and fix it? |
| 61 | 61 | * @see https://en.wikipedia.org/wiki/ReDoS |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | { |
| 74 | 74 | $replacement = '<a href="#" style="display: none;" name="$1"></a>'; |
| 75 | 75 | |
| 76 | - return function (string $body) use ($replacement) { |
|
| 76 | + return function(string $body) use ($replacement) { |
|
| 77 | 77 | return preg_replace('/<a.+?name="(.*?)".*?>.*?<\/a>/isu', $replacement, $body); |
| 78 | 78 | }; |
| 79 | 79 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | private function fixDocsNavigationLinks(): \Closure |
| 87 | 87 | { |
| 88 | - return function (string $body) { |
|
| 88 | + return function(string $body) { |
|
| 89 | 89 | return $body; |
| 90 | 90 | }; |
| 91 | 91 | } |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | { |
| 99 | 99 | $pattern = '/<blockquote>\s*<p>\s*{([a-z]+)}\s*(.*?)<\/p>\s*<\/blockquote>/isu'; |
| 100 | 100 | |
| 101 | - return function (string $body) use ($pattern) { |
|
| 101 | + return function(string $body) use ($pattern) { |
|
| 102 | 102 | return preg_replace( |
| 103 | 103 | $pattern, |
| 104 | 104 | '<blockquote class="quote-$1"><p>$2</p></blockquote>', |
@@ -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 | |
@@ -33,17 +33,17 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | protected function normalizeHeaders(): \Closure |
| 35 | 35 | { |
| 36 | - return function (string $body) { |
|
| 36 | + return function(string $body) { |
|
| 37 | 37 | $delta = $this->getMaxHeaderLevel($body) - $this->maxHeaderLevel; |
| 38 | 38 | |
| 39 | - return preg_replace_callback('/^(#+)\s+(.*?)\s*$/mius', function (array $matches) use ($delta) { |
|
| 39 | + return preg_replace_callback('/^(#+)\s+(.*?)\s*$/mius', function(array $matches) use ($delta) { |
|
| 40 | 40 | [$body, $tag, $title] = $matches; |
| 41 | 41 | |
| 42 | 42 | $level = $this->mdTagToLevel($tag); |
| 43 | 43 | $level += $delta; |
| 44 | 44 | $level = min($this->minHeaderLevel, max($this->maxHeaderLevel, $level)); |
| 45 | 45 | |
| 46 | - return str_repeat('#', $level) . ' ' . $title; |
|
| 46 | + return str_repeat('#', $level).' '.$title; |
|
| 47 | 47 | }, $body); |
| 48 | 48 | }; |
| 49 | 49 | } |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | public function saving(Docs $docs): void |
| 23 | 23 | { |
| 24 | - if (! $docs->slug) { |
|
| 24 | + if (!$docs->slug) { |
|
| 25 | 25 | $docs->slug = Str::slug($docs->title); |
| 26 | 26 | } |
| 27 | 27 | } |
@@ -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 = $this->getTopLevelHeader($page->getUrl(), $page->getContent()); |
| 141 | 141 | $docs->slug = $page->getUrl(); |
| 142 | 142 | } |