From b43c8e1ea730b1107efc65d43c9368edf268a22a Mon Sep 17 00:00:00 2001 From: stancl Date: Fri, 16 Aug 2019 20:09:52 +0000 Subject: [PATCH] Apply fixes from StyleCI --- bootstrap.php | 7 +++---- config.php | 10 +++++----- config.production.php | 4 ++-- config.staging.php | 4 ++-- listeners/GenerateSitemap.php | 12 ++++++------ navigation.php | 22 +++++++++++----------- 6 files changed, 29 insertions(+), 30 deletions(-) diff --git a/bootstrap.php b/bootstrap.php index d08a538c..5c4b2dae 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -3,10 +3,10 @@ use App\Listeners\GenerateSitemap; use TightenCo\Jigsaw\Jigsaw; -/** @var $container \Illuminate\Container\Container */ -/** @var $events \TightenCo\Jigsaw\Events\EventBus */ +/* @var $container \Illuminate\Container\Container */ +/* @var $events \TightenCo\Jigsaw\Events\EventBus */ -/** +/* * You can run custom code at different stages of the build process by * listening to the 'beforeBuild', 'afterCollections', and 'afterBuild' events. * @@ -18,4 +18,3 @@ use TightenCo\Jigsaw\Jigsaw; */ $events->afterBuild(GenerateSitemap::class); - diff --git a/config.php b/config.php index cd912242..c04c933f 100644 --- a/config.php +++ b/config.php @@ -1,13 +1,13 @@ '', - 'production' => false, - 'siteName' => 'stancl/tenancy documentation', + 'baseUrl' => '', + 'production' => false, + 'siteName' => 'stancl/tenancy documentation', 'siteDescription' => 'A Laravel multi-database tenanyc package that respects your code.', // Algolia DocSearch credentials - 'docsearchApiKey' => '', + 'docsearchApiKey' => '', 'docsearchIndexName' => '', // navigation menu @@ -25,6 +25,6 @@ return [ } }, 'url' => function ($page, $path) { - return starts_with($path, 'http') ? $path : '/' . trimPath($path); + return starts_with($path, 'http') ? $path : '/'.trimPath($path); }, ]; diff --git a/config.production.php b/config.production.php index bae024a1..e914b6fc 100644 --- a/config.production.php +++ b/config.production.php @@ -1,10 +1,10 @@ 'https://my-jigsaw-docs.com', + 'baseUrl' => 'https://my-jigsaw-docs.com', 'production' => true, // DocSearch credentials - 'docsearchApiKey' => '', + 'docsearchApiKey' => '', 'docsearchIndexName' => '', ]; diff --git a/config.staging.php b/config.staging.php index 85f65f4d..aa254914 100644 --- a/config.staging.php +++ b/config.staging.php @@ -1,10 +1,10 @@ 'http://jigsaw-docs-staging.tighten.co', + 'baseUrl' => 'http://jigsaw-docs-staging.tighten.co', 'production' => false, // DocSearch credentials - 'docsearchApiKey' => '', + 'docsearchApiKey' => '', 'docsearchIndexName' => '', ]; diff --git a/listeners/GenerateSitemap.php b/listeners/GenerateSitemap.php index 876100aa..262e9710 100644 --- a/listeners/GenerateSitemap.php +++ b/listeners/GenerateSitemap.php @@ -10,27 +10,27 @@ class GenerateSitemap protected $exclude = [ '/assets/*', '*/favicon.ico', - '*/404' + '*/404', ]; public function handle(Jigsaw $jigsaw) { $baseUrl = $jigsaw->getConfig('baseUrl'); - if (! $baseUrl) { - echo("\nTo generate a sitemap.xml file, please specify a 'baseUrl' in config.php.\n\n"); + if (!$baseUrl) { + echo "\nTo generate a sitemap.xml file, please specify a 'baseUrl' in config.php.\n\n"; return; } - $sitemap = new Sitemap($jigsaw->getDestinationPath() . '/sitemap.xml'); + $sitemap = new Sitemap($jigsaw->getDestinationPath().'/sitemap.xml'); collect($jigsaw->getOutputPaths()) ->reject(function ($path) { return $this->isExcluded($path); })->each(function ($path) use ($baseUrl, $sitemap) { - $sitemap->addItem(rtrim($baseUrl, '/') . $path, time(), Sitemap::DAILY); - }); + $sitemap->addItem(rtrim($baseUrl, '/').$path, time(), Sitemap::DAILY); + }); $sitemap->write(); } diff --git a/navigation.php b/navigation.php index 63c2b354..3481a98a 100644 --- a/navigation.php +++ b/navigation.php @@ -2,30 +2,30 @@ return [ 'Getting Started' => [ - 'url' => 'docs/getting-started', + 'url' => 'docs/getting-started', 'children' => [ - 'Installation' => 'docs/installation', + 'Installation' => 'docs/installation', 'Storage Drivers' => 'docs/storage-drivers', - 'Configuration' => 'docs/configuration', + 'Configuration' => 'docs/configuration', ], ], 'Usage' => [ - 'url' => 'docs/usage', + 'url' => 'docs/usage', 'children' => [ 'Creating Tenants' => 'docs/creating-tenants', - 'Tenant Routes' => 'docs/tenant-routes', - 'Tenant Storage' => 'docs/tenant-storage', + 'Tenant Routes' => 'docs/tenant-routes', + 'Tenant Storage' => 'docs/tenant-storage', 'Console Commands' => 'docs/console-commands', ], ], 'Digging Deeper' => [ - 'url' => 'docs/digging-deeper', + 'url' => 'docs/digging-deeper', 'children' => [ 'Middleware Configuration' => 'docs/middleware-configuration', - 'Custom Database Names' => 'docs/custom-database-names', - 'Development' => 'docs/development', - ] + 'Custom Database Names' => 'docs/custom-database-names', + 'Development' => 'docs/development', + ], ], 'Stay Updated' => 'docs/stay-updated', - 'GitHub' => 'https://github.com/stancl/tenancy', + 'GitHub' => 'https://github.com/stancl/tenancy', ];