@@ -23,7 +23,7 @@ |
||
23 | 23 | */ |
24 | 24 | public function register(): void |
25 | 25 | { |
26 | - $this->app->singleton(Guzzle::class, function () { |
|
26 | + $this->app->singleton(Guzzle::class, function() { |
|
27 | 27 | return new Guzzle(); |
28 | 28 | }); |
29 | 29 |
@@ -39,7 +39,7 @@ |
||
39 | 39 | private function loadLocalProviders(Repository $repository): void |
40 | 40 | { |
41 | 41 | if ($this->app->isLocal()) { |
42 | - $providers = (array)$repository->get('app.local_providers', []); |
|
42 | + $providers = (array) $repository->get('app.local_providers', []); |
|
43 | 43 | |
44 | 44 | foreach ($providers as $provider) { |
45 | 45 | $this->app->register($provider); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | */ |
26 | 26 | public function boot(): void |
27 | 27 | { |
28 | - $this->app->singleton(NavMatcher::class, function (Container $app) { |
|
28 | + $this->app->singleton(NavMatcher::class, function(Container $app) { |
|
29 | 29 | $route = $this->route($app->make(Router::class)); |
30 | 30 | |
31 | 31 | return new NavMatcher($route); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | private function route(Router $router): Route |
40 | 40 | { |
41 | - $route = $router->current(); |
|
41 | + $route = $router->current(); |
|
42 | 42 | |
43 | 43 | if ($route === null) { |
44 | 44 | $route = $router->get('/'); |
@@ -6,7 +6,7 @@ discard block |
||
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 | |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | // Documentation renderer |
34 | 34 | $this->app->when(ContentObserver::class) |
35 | 35 | ->needs(ContentRenderInterface::class) |
36 | - ->give(function () { |
|
36 | + ->give(function() { |
|
37 | 37 | return new LaravelDocsRenderer(new GithubMarkdown()); |
38 | 38 | }); |
39 | 39 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | private function registerDefaultBehaviour() |
52 | 52 | { |
53 | - $this->app->singleton(MarkdownRenderer::class, function () { |
|
53 | + $this->app->singleton(MarkdownRenderer::class, function() { |
|
54 | 54 | return new MarkdownRenderer(new GithubMarkdown()); |
55 | 55 | }); |
56 | 56 |
@@ -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,12 +132,12 @@ 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 | 139 | |
140 | - if (! $docs->title) { |
|
140 | + if (!$docs->title) { |
|
141 | 141 | $docs->title = Str::ucfirst(str_replace( |
142 | 142 | ['-', '_'], |
143 | 143 | ' ', |
@@ -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 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | */ |
61 | 61 | private function removeTipQuotes(): \Closure |
62 | 62 | { |
63 | - return function (string $body) { |
|
63 | + return function(string $body) { |
|
64 | 64 | return preg_replace('/>\s+{\s*tip\s*}\s+/iu', '> ', $body); |
65 | 65 | }; |
66 | 66 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | */ |
73 | 73 | private function removeLeadingNavigation(): \Closure |
74 | 74 | { |
75 | - return function (string $body) { |
|
75 | + return function(string $body) { |
|
76 | 76 | /** |
77 | 77 | * TODO This expression are vulnerable: ReDoS-based exploit. Probably we can improve and fix it? |
78 | 78 | * |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | */ |
90 | 90 | private function removeNoteQuotes(): \Closure |
91 | 91 | { |
92 | - return function (string $body) { |
|
92 | + return function(string $body) { |
|
93 | 93 | return preg_replace('/>\s+{\s*note\s*}\s+/iu', '> ', $body); |
94 | 94 | }; |
95 | 95 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | { |
105 | 105 | $replacement = '<a href="#" style="display: none;" name="$1"></a>'; |
106 | 106 | |
107 | - return function (string $body) use ($replacement) { |
|
107 | + return function(string $body) use ($replacement) { |
|
108 | 108 | return preg_replace('/<a.+?name="(.*?)".*?>.*?<\/a>/isu', $replacement, $body); |
109 | 109 | }; |
110 | 110 | } |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | private function removeDocumentTitle(): \Closure |
118 | 118 | { |
119 | - return function (string $body) { |
|
119 | + return function(string $body) { |
|
120 | 120 | return preg_replace('/^[\s\n]+?#\s+?.*?\n/isu', '', $body); |
121 | 121 | }; |
122 | 122 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | { |
25 | 25 | $links = []; |
26 | 26 | |
27 | - $body = preg_replace_callback('/<(h\d+)>(.*?)<\/h\d+>/isu', function ($data) use (&$links) { |
|
27 | + $body = preg_replace_callback('/<(h\d+)>(.*?)<\/h\d+>/isu', function($data) use (&$links) { |
|
28 | 28 | list($data, $tag, $header) = $data; |
29 | 29 | |
30 | 30 | $id = $this->createAnchorName($header); |
@@ -26,7 +26,7 @@ |
||
26 | 26 | /** |
27 | 27 | * @var array|\Closure[] |
28 | 28 | */ |
29 | - private $after = []; |
|
29 | + private $after = []; |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * @param \Closure $callback |
@@ -6,7 +6,7 @@ discard block |
||
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\Services\ContentRenderer; |
12 | 12 | |
@@ -35,10 +35,10 @@ discard block |
||
35 | 35 | private function removeDisallowedTags(string $body): string |
36 | 36 | { |
37 | 37 | return strip_tags($body, [ |
38 | - 'b', 'strong', // bold |
|
39 | - 'i', 'em', // italic |
|
40 | - 'ul', 'li', 'ol', // list |
|
41 | - 'a', // link |
|
38 | + 'b', 'strong', // bold |
|
39 | + 'i', 'em', // italic |
|
40 | + 'ul', 'li', 'ol', // list |
|
41 | + 'a', // link |
|
42 | 42 | 'code', 'pre' // code |
43 | 43 | ]); |
44 | 44 | } |