@@ -10,7 +10,6 @@ |
||
10 | 10 | |
11 | 11 | use Illuminate\Support\Str; |
12 | 12 | use Illuminate\Database\Eloquent\Model; |
13 | -use Illuminate\Database\Eloquent\Builder; |
|
14 | 13 | use Illuminate\Database\Eloquent\Relations\HasMany; |
15 | 14 | |
16 | 15 | /** |
@@ -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\Models; |
10 | 10 | |
@@ -37,6 +37,6 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function getTitleAttribute(string $title): string |
39 | 39 | { |
40 | - return Str::ucfirst($title) . ' (' . $this->version . ')'; |
|
40 | + return Str::ucfirst($title).' ('.$this->version.')'; |
|
41 | 41 | } |
42 | 42 | } |
@@ -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\Models\DocsPage; |
11 | 11 | |
@@ -47,11 +47,11 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public function saving(DocsPage $page): void |
49 | 49 | { |
50 | - $body = $this->render($this->getRenderer($page), (string)$page->content_source); |
|
50 | + $body = $this->render($this->getRenderer($page), (string) $page->content_source); |
|
51 | 51 | |
52 | 52 | // Update data |
53 | 53 | $page->nav = $body->getLinks(); |
54 | - $page->content_rendered = (string)$body->getContent(); |
|
54 | + $page->content_rendered = (string) $body->getContent(); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
@@ -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\Models\DocsPage; |
10 | 10 | |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public function saving(DocsPage $page): void |
23 | 23 | { |
24 | - if (! $page->slug) { |
|
24 | + if (!$page->slug) { |
|
25 | 25 | $page->slug = Str::slug($page->title); |
26 | 26 | } |
27 | 27 | } |
@@ -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\Models; |
10 | 10 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | public function getNav(...$level): Collection |
67 | 67 | { |
68 | 68 | return $this->nav->whereIn('level', $level) |
69 | - ->map(function (array $data) { |
|
69 | + ->map(function(array $data) { |
|
70 | 70 | return (object) $data; |
71 | 71 | }); |
72 | 72 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public static function scopeWhereVersion(Builder $builder, string $version): Builder |
80 | 80 | { |
81 | - return $builder->with(['docs' => function (BelongsTo $relation) use ($version) { |
|
81 | + return $builder->with(['docs' => function(BelongsTo $relation) use ($version) { |
|
82 | 82 | return $relation->where('version', $version); |
83 | 83 | }]); |
84 | 84 | } |
@@ -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\Services\ContentRenderer; |
12 | 12 |
@@ -50,7 +50,7 @@ |
||
50 | 50 | $class = $this->get(sprintf('renderers.%s', $name)); |
51 | 51 | |
52 | 52 | if ($class === null) { |
53 | - throw new \InvalidArgumentException("Renderer ${name} not found"); |
|
53 | + throw new \InvalidArgumentException("renderer ${name} not found"); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | return $class; |
@@ -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\Providers; |
11 | 11 | |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | |
36 | 36 | // Repository with all renderers |
37 | - $this->app->singleton(RenderersRepository::class, function (Container $app) { |
|
37 | + $this->app->singleton(RenderersRepository::class, function(Container $app) { |
|
38 | 38 | $config = $app->make(Repository::class)->get('renderers'); |
39 | 39 | |
40 | 40 | return new RenderersRepository($app, $config); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | |
44 | 44 | // Register default |
45 | - $this->app->singleton(ContentRenderInterface::class, function (Container $app) { |
|
45 | + $this->app->singleton(ContentRenderInterface::class, function(Container $app) { |
|
46 | 46 | return $app->make(RenderersRepository::class)->getDefaultRenderer(); |
47 | 47 | }); |
48 | 48 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | // Tips content renderer |
51 | 51 | $this->app->when(RawTextRenderer::class) |
52 | 52 | ->needs(ContentRenderInterface::class) |
53 | - ->give(function () { |
|
53 | + ->give(function() { |
|
54 | 54 | return $this->app->make(RenderersRepository::class) |
55 | 55 | ->getRenderer('raw'); |
56 | 56 | }); |
@@ -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 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | |
57 | 57 | foreach ($importer->files($config) as $file) { |
58 | - $prefix = '[' . $repo->title . ']::' . $file->getRoute(); |
|
58 | + $prefix = '['.$repo->title.']::'.$file->getRoute(); |
|
59 | 59 | |
60 | 60 | /* |
61 | 61 | |-------------------------------------------------------------------------- |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $updateRequired = $repo->pages->where('hash', $file->getHash())->isEmpty(); |
66 | 66 | |
67 | 67 | if (!$updateRequired) { |
68 | - $this->comment($prefix . ' has no available updates.'); |
|
68 | + $this->comment($prefix.' has no available updates.'); |
|
69 | 69 | continue; |
70 | 70 | } |
71 | 71 | |
@@ -77,10 +77,10 @@ discard block |
||
77 | 77 | $page = $repo->pages->where('identify', $file->getId())->first(); |
78 | 78 | |
79 | 79 | |
80 | - $message = $prefix . ' found. Updating sources...'; |
|
80 | + $message = $prefix.' found. Updating sources...'; |
|
81 | 81 | |
82 | 82 | if ($page === null) { |
83 | - $message = $prefix . ' not exists. Uploading new...'; |
|
83 | + $message = $prefix.' not exists. Uploading new...'; |
|
84 | 84 | $page = new DocsPage(['identify' => $file->getId()]); |
85 | 85 | } |
86 | 86 |