Skip to content

Commit 664cacc

Browse files
committed
Update code-style 💻
1 parent bcf3002 commit 664cacc

26 files changed

+42
-140
lines changed

database/migrations/anonymous/2022_08_18_180137_change_migration_actions_table.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@
44

55
use DragonCode\LaravelActions\Database\BaseChangeColumn;
66

7-
return new class () extends BaseChangeColumn
8-
{
9-
};
7+
return new class () extends BaseChangeColumn {};

database/migrations/anonymous/2023_01_21_172923_rename_migrations_actions_table_to_actions.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@
44

55
use DragonCode\LaravelActions\Database\BaseRenameMigrationsActionsTableToActions;
66

7-
return new class () extends BaseRenameMigrationsActionsTableToActions
8-
{
9-
};
7+
return new class () extends BaseRenameMigrationsActionsTableToActions {};

database/migrations/named/2022_08_18_180137_change_migration_actions_table.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@
44

55
use DragonCode\LaravelActions\Database\BaseChangeColumn;
66

7-
class ChangeMigrationActionsTable extends BaseChangeColumn
8-
{
9-
}
7+
class ChangeMigrationActionsTable extends BaseChangeColumn {}

database/migrations/named/2023_01_21_172923_rename_migrations_actions_table_to_actions.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@
44

55
use DragonCode\LaravelActions\Database\BaseRenameMigrationsActionsTableToActions;
66

7-
class RenameMigrationsActionsTableToActions extends BaseRenameMigrationsActionsTableToActions
8-
{
9-
}
7+
class RenameMigrationsActionsTableToActions extends BaseRenameMigrationsActionsTableToActions {}

src/Action.php

Lines changed: 4 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -15,52 +15,38 @@ abstract class Action extends Migration
1515
*
1616
* If true, then it will be executed once.
1717
* If false, then the action will run every time the `actions` command is invoked.
18-
*
19-
* @var bool
2018
*/
2119
protected bool $once = true;
2220

2321
/**
2422
* Determines a call to database transactions.
2523
*
2624
* By default, false.
27-
*
28-
* @var bool
2925
*/
3026
protected bool $transactions = false;
3127

3228
/**
3329
* The number of attempts to execute a request within a transaction before throwing an error.
34-
*
35-
* @var int
3630
*/
3731
protected int $transactionAttempts = 1;
3832

3933
/**
4034
* Determines which environment to run on.
41-
*
42-
* @var array|string|null
4335
*/
44-
protected string|array|null $environment = null;
36+
protected array|string|null $environment = null;
4537

4638
/**
4739
* Determines in which environment it should not run.
48-
*
49-
* @var array|string|null
5040
*/
51-
protected string|array|null $exceptEnvironment = null;
41+
protected array|string|null $exceptEnvironment = null;
5242

5343
/**
5444
* Defines a possible "pre-launch" of the action.
55-
*
56-
* @var bool
5745
*/
5846
protected bool $before = true;
5947

6048
/**
6149
* Defines whether the action will run synchronously or asynchronously.
62-
*
63-
* @var bool
6450
*/
6551
protected bool $async = false;
6652

@@ -69,8 +55,6 @@ abstract class Action extends Migration
6955
*
7056
* If true, then it will be executed once.
7157
* If false, then the action will run every time the `actions` command is invoked.
72-
*
73-
* @return bool
7458
*/
7559
public function isOnce(): bool
7660
{
@@ -79,8 +63,6 @@ public function isOnce(): bool
7963

8064
/**
8165
* Determines a call to database transactions.
82-
*
83-
* @return bool
8466
*/
8567
public function enabledTransactions(): bool
8668
{
@@ -89,8 +71,6 @@ public function enabledTransactions(): bool
8971

9072
/**
9173
* The number of attempts to execute a request within a transaction before throwing an error.
92-
*
93-
* @return int
9474
*/
9575
public function transactionAttempts(): int
9676
{
@@ -99,8 +79,6 @@ public function transactionAttempts(): int
9979

10080
/**
10181
* Determines which environment to run on.
102-
*
103-
* @return array
10482
*/
10583
public function onEnvironment(): array
10684
{
@@ -109,8 +87,6 @@ public function onEnvironment(): array
10987

11088
/**
11189
* Determines in which environment it should not run.
112-
*
113-
* @return array
11490
*/
11591
public function exceptEnvironment(): array
11692
{
@@ -119,8 +95,6 @@ public function exceptEnvironment(): array
11995

12096
/**
12197
* Determines whether the given action can be called conditionally.
122-
*
123-
* @return bool
12498
*/
12599
public function allow(): bool
126100
{
@@ -129,8 +103,6 @@ public function allow(): bool
129103

130104
/**
131105
* Defines a possible "pre-launch" of the action.
132-
*
133-
* @return bool
134106
*/
135107
public function hasBefore(): bool
136108
{
@@ -139,8 +111,6 @@ public function hasBefore(): bool
139111

140112
/**
141113
* Defines whether the action will run synchronously or asynchronously.
142-
*
143-
* @return bool
144114
*/
145115
public function isAsync(): bool
146116
{
@@ -149,19 +119,11 @@ public function isAsync(): bool
149119

150120
/**
151121
* Method to be called when the job completes successfully.
152-
*
153-
* @return void
154122
*/
155-
public function success(): void
156-
{
157-
}
123+
public function success(): void {}
158124

159125
/**
160126
* The method will be called if an error occurs.
161-
*
162-
* @return void
163127
*/
164-
public function failed(): void
165-
{
166-
}
128+
public function failed(): void {}
167129
}

src/Concerns/Artisan.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@ trait Artisan
1111
{
1212
/**
1313
* Run an Artisan console command by name.
14-
*
15-
* @param string $command
16-
* @param array $parameters
17-
* @param \Illuminate\Console\OutputStyle|null $outputBuffer
18-
*
19-
* @return void
2014
*/
2115
protected function artisan(string $command, array $parameters = [], ?OutputStyle $outputBuffer = null): void
2216
{

src/Concerns/Isolatable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ protected function isolatedStatusCode(): int
2323
return self::SUCCESS;
2424
}
2525

26-
protected function getIsolateOption(): int|bool
26+
protected function getIsolateOption(): bool|int
2727
{
2828
return $this->hasIsolateOption() ? $this->option(Options::ISOLATED) : false;
2929
}

src/Console/Command.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
abstract class Command extends BaseCommand
1818
{
1919
use ConfirmableTrait;
20-
2120
use Isolatable;
22-
2321
use Optionable;
2422

2523
protected Processor|string $processor;

src/Constants/Names.php

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,14 @@
44

55
class Names
66
{
7-
public const ACTIONS = 'actions';
8-
9-
public const FRESH = 'actions:fresh';
10-
11-
public const INSTALL = 'actions:install';
12-
13-
public const MAKE = 'make:action';
14-
15-
public const REFRESH = 'actions:refresh';
16-
17-
public const RESET = 'actions:reset';
18-
19-
public const ROLLBACK = 'actions:rollback';
20-
21-
public const STATUS = 'actions:status';
22-
7+
public const ACTIONS = 'actions';
8+
public const FRESH = 'actions:fresh';
9+
public const INSTALL = 'actions:install';
10+
public const MAKE = 'make:action';
11+
public const REFRESH = 'actions:refresh';
12+
public const RESET = 'actions:reset';
13+
public const ROLLBACK = 'actions:rollback';
14+
public const STATUS = 'actions:status';
2315
public const STUB_PUBLISH = 'actions:stub';
24-
25-
public const UPGRADE = 'actions:upgrade';
16+
public const UPGRADE = 'actions:upgrade';
2617
}

src/Constants/Options.php

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,14 @@
66

77
class Options
88
{
9-
public const BEFORE = 'before';
10-
9+
public const BEFORE = 'before';
1110
public const CONNECTION = 'connection';
12-
13-
public const FORCE = 'force';
14-
15-
public const ISOLATED = 'isolated';
16-
17-
public const MUTE = 'mute';
18-
19-
public const NAME = 'name';
20-
21-
public const PATH = 'path';
22-
23-
public const REALPATH = 'realpath';
24-
25-
public const STEP = 'step';
26-
27-
public const SYNC = 'sync';
11+
public const FORCE = 'force';
12+
public const ISOLATED = 'isolated';
13+
public const MUTE = 'mute';
14+
public const NAME = 'name';
15+
public const PATH = 'path';
16+
public const REALPATH = 'realpath';
17+
public const STEP = 'step';
18+
public const SYNC = 'sync';
2819
}

0 commit comments

Comments
 (0)