From 5399b834264beec418871897ee69f674ac904935 Mon Sep 17 00:00:00 2001 From: duncanmcclean Date: Thu, 11 Apr 2024 18:46:56 +0000 Subject: [PATCH] Fix styling --- src/Commands/ImportAssets.php | 9 +++------ src/Commands/ImportBlueprints.php | 2 -- src/Commands/ImportCollections.php | 2 -- src/Commands/ImportEntries.php | 2 -- src/Commands/ImportForms.php | 2 -- src/Commands/ImportGlobals.php | 4 +--- src/Commands/ImportNavs.php | 4 +--- src/Commands/ImportRevisions.php | 7 +++---- src/Commands/ImportTaxonomies.php | 4 +--- tests/Commands/ImportAssetsTest.php | 3 +-- tests/Commands/ImportCollectionsTest.php | 2 +- tests/Commands/ImportEntriesTest.php | 5 +---- tests/Commands/ImportFormsTest.php | 2 +- tests/Commands/ImportGlobalsTest.php | 2 +- tests/Commands/ImportRevisionsTest.php | 2 +- tests/Commands/ImportTaxonomiesTest.php | 7 ------- 16 files changed, 15 insertions(+), 44 deletions(-) diff --git a/src/Commands/ImportAssets.php b/src/Commands/ImportAssets.php index b97d0569..dba8ae54 100644 --- a/src/Commands/ImportAssets.php +++ b/src/Commands/ImportAssets.php @@ -7,7 +7,6 @@ use Statamic\Assets\AssetContainerContents; use Statamic\Assets\AssetRepository; use Statamic\Console\RunsInPlease; -use Statamic\Contracts\Assets\Asset; use Statamic\Contracts\Assets\AssetContainer as AssetContainerContract; use Statamic\Contracts\Assets\AssetContainerRepository as AssetContainerRepositoryContract; use Statamic\Contracts\Assets\AssetRepository as AssetRepositoryContract; @@ -37,12 +36,10 @@ class ImportAssets extends Command * * @var string */ - protected $description = "Imports file-based asset containers & asset metadata into the database."; + protected $description = 'Imports file-based asset containers & asset metadata into the database.'; /** * Execute the console command. - * - * @return int */ public function handle(): int { @@ -76,7 +73,7 @@ private function importAssetContainers(): void AssetContainer::makeModelFromContract($container); }); - $this->components->info("Assets containers imported sucessfully"); + $this->components->info('Assets containers imported sucessfully'); } private function importAssets(): void @@ -89,7 +86,7 @@ private function importAssets(): void EloquentAsset::makeModelFromContract($asset); }); - $this->components->info("Assets imported sucessfully"); + $this->components->info('Assets imported sucessfully'); } private function shouldImportAssetContainers(): bool diff --git a/src/Commands/ImportBlueprints.php b/src/Commands/ImportBlueprints.php index e9f205a1..abc86a4d 100644 --- a/src/Commands/ImportBlueprints.php +++ b/src/Commands/ImportBlueprints.php @@ -33,8 +33,6 @@ class ImportBlueprints extends Command /** * Execute the console command. - * - * @return int */ public function handle(): int { diff --git a/src/Commands/ImportCollections.php b/src/Commands/ImportCollections.php index 0cd0a4ea..b3536925 100644 --- a/src/Commands/ImportCollections.php +++ b/src/Commands/ImportCollections.php @@ -39,8 +39,6 @@ class ImportCollections extends Command /** * Execute the console command. - * - * @return int */ public function handle(): int { diff --git a/src/Commands/ImportEntries.php b/src/Commands/ImportEntries.php index 40d2fa3b..82bc0613 100644 --- a/src/Commands/ImportEntries.php +++ b/src/Commands/ImportEntries.php @@ -34,8 +34,6 @@ class ImportEntries extends Command /** * Execute the console command. - * - * @return int */ public function handle(): int { diff --git a/src/Commands/ImportForms.php b/src/Commands/ImportForms.php index d31716eb..daa92066 100644 --- a/src/Commands/ImportForms.php +++ b/src/Commands/ImportForms.php @@ -37,8 +37,6 @@ class ImportForms extends Command /** * Execute the console command. - * - * @return int */ public function handle(): int { diff --git a/src/Commands/ImportGlobals.php b/src/Commands/ImportGlobals.php index 708b7c87..4f83aed6 100644 --- a/src/Commands/ImportGlobals.php +++ b/src/Commands/ImportGlobals.php @@ -34,12 +34,10 @@ class ImportGlobals extends Command * * @var string */ - protected $description = "Imports file-based global sets & variables into the database."; + protected $description = 'Imports file-based global sets & variables into the database.'; /** * Execute the console command. - * - * @return int */ public function handle(): int { diff --git a/src/Commands/ImportNavs.php b/src/Commands/ImportNavs.php index 95a2b3cb..553dd45c 100644 --- a/src/Commands/ImportNavs.php +++ b/src/Commands/ImportNavs.php @@ -34,12 +34,10 @@ class ImportNavs extends Command * * @var string */ - protected $description = "Imports file-based navigations & nav trees into the database."; + protected $description = 'Imports file-based navigations & nav trees into the database.'; /** * Execute the console command. - * - * @return int */ public function handle(): int { diff --git a/src/Commands/ImportRevisions.php b/src/Commands/ImportRevisions.php index b66fe53f..4770e7e3 100644 --- a/src/Commands/ImportRevisions.php +++ b/src/Commands/ImportRevisions.php @@ -25,17 +25,16 @@ class ImportRevisions extends Command * * @var string */ - protected $description = "Imports file-based revisions into the database."; + protected $description = 'Imports file-based revisions into the database.'; /** * Execute the console command. - * - * @return int */ public function handle(): int { if (! config('statamic.revisions.enabled')) { - $this->components->error("This import can only be run when revisions are enabled."); + $this->components->error('This import can only be run when revisions are enabled.'); + return 1; } diff --git a/src/Commands/ImportTaxonomies.php b/src/Commands/ImportTaxonomies.php index 26524e57..7e5bb4a7 100644 --- a/src/Commands/ImportTaxonomies.php +++ b/src/Commands/ImportTaxonomies.php @@ -38,12 +38,10 @@ class ImportTaxonomies extends Command * * @var string */ - protected $description = "Imports file-based taxonomies & terms into the database."; + protected $description = 'Imports file-based taxonomies & terms into the database.'; /** * Execute the console command. - * - * @return int */ public function handle(): int { diff --git a/tests/Commands/ImportAssetsTest.php b/tests/Commands/ImportAssetsTest.php index 44479e97..acfd9212 100644 --- a/tests/Commands/ImportAssetsTest.php +++ b/tests/Commands/ImportAssetsTest.php @@ -10,15 +10,14 @@ use Statamic\Contracts\Assets\AssetRepository as AssetRepositoryContract; use Statamic\Eloquent\Assets\AssetContainerModel; use Statamic\Eloquent\Assets\AssetModel; +use Statamic\Facades\AssetContainer; use Tests\PreventSavingStacheItemsToDisk; use Tests\TestCase; -use Statamic\Facades\AssetContainer; class ImportAssetsTest extends TestCase { use PreventSavingStacheItemsToDisk; - public function setUp(): void { parent::setUp(); diff --git a/tests/Commands/ImportCollectionsTest.php b/tests/Commands/ImportCollectionsTest.php index 406d6ea0..9809f153 100644 --- a/tests/Commands/ImportCollectionsTest.php +++ b/tests/Commands/ImportCollectionsTest.php @@ -11,8 +11,8 @@ use Statamic\Contracts\Structures\CollectionTreeRepository as CollectionTreeRepositoryContract; use Statamic\Eloquent\Collections\CollectionModel; use Statamic\Eloquent\Structures\TreeModel; -use Statamic\Facades\Entry; use Statamic\Facades\Collection; +use Statamic\Facades\Entry; use Statamic\Structures\CollectionStructure; use Tests\PreventSavingStacheItemsToDisk; use Tests\TestCase; diff --git a/tests/Commands/ImportEntriesTest.php b/tests/Commands/ImportEntriesTest.php index 7fb1e430..5c26173f 100644 --- a/tests/Commands/ImportEntriesTest.php +++ b/tests/Commands/ImportEntriesTest.php @@ -9,13 +9,10 @@ use Statamic\Contracts\Entries\EntryRepository as EntryRepositoryContract; use Statamic\Contracts\Structures\CollectionTree as CollectionTreeContract; use Statamic\Contracts\Structures\CollectionTreeRepository as CollectionTreeRepositoryContract; -use Statamic\Eloquent\Collections\CollectionModel; use Statamic\Eloquent\Entries\EntryModel; -use Statamic\Eloquent\Structures\TreeModel; -use Statamic\Facades\Entry; use Statamic\Facades\Collection; +use Statamic\Facades\Entry; use Statamic\Facades\Site; -use Statamic\Structures\CollectionStructure; use Tests\PreventSavingStacheItemsToDisk; use Tests\TestCase; diff --git a/tests/Commands/ImportFormsTest.php b/tests/Commands/ImportFormsTest.php index c010823c..ec103113 100644 --- a/tests/Commands/ImportFormsTest.php +++ b/tests/Commands/ImportFormsTest.php @@ -9,9 +9,9 @@ use Statamic\Contracts\Forms\SubmissionRepository as SubmissionRepositoryContract; use Statamic\Eloquent\Forms\FormModel; use Statamic\Eloquent\Forms\SubmissionModel; +use Statamic\Facades\Form; use Tests\PreventSavingStacheItemsToDisk; use Tests\TestCase; -use Statamic\Facades\Form; class ImportFormsTest extends TestCase { diff --git a/tests/Commands/ImportGlobalsTest.php b/tests/Commands/ImportGlobalsTest.php index 99b17c3d..6a3969cd 100644 --- a/tests/Commands/ImportGlobalsTest.php +++ b/tests/Commands/ImportGlobalsTest.php @@ -9,9 +9,9 @@ use Statamic\Contracts\Globals\Variables as VariablesContract; use Statamic\Eloquent\Globals\GlobalSetModel; use Statamic\Eloquent\Globals\VariablesModel; +use Statamic\Facades\GlobalSet; use Tests\PreventSavingStacheItemsToDisk; use Tests\TestCase; -use Statamic\Facades\GlobalSet; class ImportGlobalsTest extends TestCase { diff --git a/tests/Commands/ImportRevisionsTest.php b/tests/Commands/ImportRevisionsTest.php index 7e094bb2..f8e41c61 100644 --- a/tests/Commands/ImportRevisionsTest.php +++ b/tests/Commands/ImportRevisionsTest.php @@ -21,7 +21,7 @@ public function setUp(): void config()->set('statamic.revisions', [ 'enabled' => true, - 'path' => __DIR__ . '/tmp', + 'path' => __DIR__.'/tmp', ]); mkdir(__DIR__.'/tmp'); diff --git a/tests/Commands/ImportTaxonomiesTest.php b/tests/Commands/ImportTaxonomiesTest.php index 8f3d049f..bdb5cd80 100644 --- a/tests/Commands/ImportTaxonomiesTest.php +++ b/tests/Commands/ImportTaxonomiesTest.php @@ -5,19 +5,12 @@ use Illuminate\Support\Facades\Facade; use Statamic\Contracts\Taxonomies\Taxonomy as TaxonomyContract; use Statamic\Contracts\Taxonomies\TaxonomyRepository as TaxonomyRepositoryContract; -use Statamic\Contracts\Entries\EntryRepository as EntryRepositoryContract; use Statamic\Contracts\Taxonomies\Term as TermContract; use Statamic\Contracts\Taxonomies\TermRepository as TermRepositoryContract; -use Statamic\Eloquent\Collections\CollectionModel; -use Statamic\Eloquent\Entries\EntryModel; -use Statamic\Eloquent\Structures\TreeModel; use Statamic\Eloquent\Taxonomies\TaxonomyModel; use Statamic\Eloquent\Taxonomies\TermModel; -use Statamic\Facades\Entry; -use Statamic\Facades\Site; use Statamic\Facades\Taxonomy; use Statamic\Facades\Term; -use Statamic\Structures\CollectionStructure; use Tests\PreventSavingStacheItemsToDisk; use Tests\TestCase;