Skip to content

Commit aa9cfa6

Browse files
author
Andrey Helldar
committed
Merge remote-tracking branch 'origin/main' into main
2 parents ef815de + 9bedf77 commit aa9cfa6

File tree

8 files changed

+33
-28
lines changed

8 files changed

+33
-28
lines changed

config/actions.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
22

33
return [
4-
54
/*
65
|--------------------------------------------------------------------------
76
| Action Repository Table

src/Console/Make.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ final class Make extends BaseCommand
4747
*
4848
* @param \Illuminate\Database\Migrations\MigrationCreator $creator
4949
* @param \Illuminate\Support\Composer $composer
50-
*
51-
* @return void
5250
*/
5351
public function __construct(MigrationCreator $creator, Composer $composer)
5452
{
@@ -82,7 +80,8 @@ public function handle()
8280
protected function writeMigration(string $name)
8381
{
8482
$file = $this->creator->create(
85-
$name, $this->getMigrationPath()
83+
$name,
84+
$this->getMigrationPath()
8685
);
8786

8887
$path = pathinfo($file, PATHINFO_FILENAME);

src/Console/Migrate.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
namespace Helldar\LaravelActions\Console;
44

55
use Helldar\LaravelActions\Constants\Names;
6-
use Helldar\LaravelActions\Traits\{Database, Optionable};
6+
use Helldar\LaravelActions\Traits\Database;
7+
use Helldar\LaravelActions\Traits\Optionable;
78
use Illuminate\Database\Console\Migrations\MigrateCommand as BaseCommand;
89

910
final class Migrate extends BaseCommand
@@ -54,8 +55,6 @@ public function handle()
5455

5556
/**
5657
* Prepare the action database for running.
57-
*
58-
* @return void
5958
*/
6059
protected function prepareDatabase()
6160
{

src/Console/Refresh.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function handle()
5151

5252
if ($this->laravel->bound(Dispatcher::class)) {
5353
$this->laravel[Dispatcher::class]->dispatch(
54-
new DatabaseRefreshed
54+
new DatabaseRefreshed()
5555
);
5656
}
5757

@@ -63,8 +63,6 @@ public function handle()
6363
*
6464
* @param string|null $database
6565
* @param int|null $step
66-
*
67-
* @return void
6866
*/
6967
protected function runRollback(?string $database, ?int $step)
7068
{
@@ -79,8 +77,6 @@ protected function runRollback(?string $database, ?int $step)
7977
* Run the reset command.
8078
*
8179
* @param string|null $database
82-
*
83-
* @return void
8480
*/
8581
protected function runReset(?string $database)
8682
{

src/Console/Reset.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ final class Reset extends BaseCommand
4141
* Create a new migration rollback command instance.
4242
*
4343
* @param \Illuminate\Database\Migrations\Migrator $migrator
44-
*
45-
* @return void
4644
*/
4745
public function __construct(Migrator $migrator)
4846
{

src/Console/Rollback.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ public function handle()
4040

4141
$this->migrator->usingConnection($this->optionDatabase(), function () {
4242
$this->migrator->setOutput($this->output)->rollback(
43-
$this->getMigrationPaths(), [
43+
$this->getMigrationPaths(),
44+
[
4445
'step' => $this->optionStep(),
4546
]
4647
);

src/ServiceProvider.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,19 @@
22

33
namespace Helldar\LaravelActions;
44

5-
use Helldar\LaravelActions\Console\{Install, Make, Migrate, Refresh, Reset, Rollback, Status};
6-
use Helldar\LaravelActions\Constants\{Action, Command};
5+
use Helldar\LaravelActions\Console\Install;
6+
use Helldar\LaravelActions\Console\Make;
7+
use Helldar\LaravelActions\Console\Migrate;
8+
use Helldar\LaravelActions\Console\Refresh;
9+
use Helldar\LaravelActions\Console\Reset;
10+
use Helldar\LaravelActions\Console\Rollback;
11+
use Helldar\LaravelActions\Console\Status;
12+
use Helldar\LaravelActions\Constants\Action;
13+
use Helldar\LaravelActions\Constants\Command;
714
use Illuminate\Contracts\Events\Dispatcher;
8-
use Illuminate\Database\Migrations\{DatabaseMigrationRepository, MigrationCreator, Migrator};
15+
use Illuminate\Database\Migrations\DatabaseMigrationRepository;
16+
use Illuminate\Database\Migrations\MigrationCreator;
17+
use Illuminate\Database\Migrations\Migrator;
918
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
1019

1120
final class ServiceProvider extends BaseServiceProvider
@@ -128,7 +137,8 @@ protected function registerMigrateRefreshCommand(): void
128137
protected function registerConfig(): void
129138
{
130139
$this->mergeConfigFrom(
131-
__DIR__ . '/../config/actions.php', 'actions'
140+
__DIR__ . '/../config/actions.php',
141+
'actions'
132142
);
133143
}
134144

tests/TestCase.php

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
use Illuminate\Foundation\Testing\RefreshDatabase;
77
use Illuminate\Support\Facades\DB;
88
use Orchestra\Testbench\TestCase as BaseTestCase;
9-
use Tests\Concerns\{Actionable, Database, Files, Settings};
9+
use Tests\Concerns\Actionable;
10+
use Tests\Concerns\Database;
11+
use Tests\Concerns\Files;
12+
use Tests\Concerns\Settings;
1013

1114
abstract class TestCase extends BaseTestCase
1215
{
@@ -16,6 +19,14 @@ abstract class TestCase extends BaseTestCase
1619
use RefreshDatabase;
1720
use Settings;
1821

22+
protected function setUp(): void
23+
{
24+
parent::setUp();
25+
26+
$this->freshDatabase();
27+
$this->freshFiles();
28+
}
29+
1930
protected function getEnvironmentSetUp($app)
2031
{
2132
parent::getEnvironmentSetUp($app);
@@ -29,14 +40,6 @@ protected function getPackageProviders($app): array
2940
return [ServiceProvider::class];
3041
}
3142

32-
protected function setUp(): void
33-
{
34-
parent::setUp();
35-
36-
$this->freshDatabase();
37-
$this->freshFiles();
38-
}
39-
4043
protected function table()
4144
{
4245
return DB::table($this->table);

0 commit comments

Comments
 (0)