Skip to content

Commit

Permalink
Merge branch 'fix/add-arguments-to-import-commands' of github.com:sta…
Browse files Browse the repository at this point in the history
…tamic/eloquent-driver into fix/add-arguments-to-import-commands
  • Loading branch information
duncanmcclean committed Apr 11, 2024
2 parents 2d081ce + 5399b83 commit a2497d3
Show file tree
Hide file tree
Showing 16 changed files with 15 additions and 44 deletions.
9 changes: 3 additions & 6 deletions src/Commands/ImportAssets.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/Commands/ImportBlueprints.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ class ImportBlueprints extends Command

/**
* Execute the console command.
*
* @return int
*/
public function handle(): int
{
Expand Down
2 changes: 0 additions & 2 deletions src/Commands/ImportCollections.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ class ImportCollections extends Command

/**
* Execute the console command.
*
* @return int
*/
public function handle(): int
{
Expand Down
2 changes: 0 additions & 2 deletions src/Commands/ImportEntries.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ class ImportEntries extends Command

/**
* Execute the console command.
*
* @return int
*/
public function handle(): int
{
Expand Down
2 changes: 0 additions & 2 deletions src/Commands/ImportForms.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ class ImportForms extends Command

/**
* Execute the console command.
*
* @return int
*/
public function handle(): int
{
Expand Down
4 changes: 1 addition & 3 deletions src/Commands/ImportGlobals.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
4 changes: 1 addition & 3 deletions src/Commands/ImportNavs.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
7 changes: 3 additions & 4 deletions src/Commands/ImportRevisions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 1 addition & 3 deletions src/Commands/ImportTaxonomies.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
3 changes: 1 addition & 2 deletions tests/Commands/ImportAssetsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion tests/Commands/ImportCollectionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 1 addition & 4 deletions tests/Commands/ImportEntriesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,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;

Expand Down
2 changes: 1 addition & 1 deletion tests/Commands/ImportFormsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Commands/ImportGlobalsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Commands/ImportRevisionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function setUp(): void

config()->set('statamic.revisions', [
'enabled' => true,
'path' => __DIR__ . '/tmp',
'path' => __DIR__.'/tmp',
]);

mkdir(__DIR__.'/tmp');
Expand Down
7 changes: 0 additions & 7 deletions tests/Commands/ImportTaxonomiesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit a2497d3

Please sign in to comment.