Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false,
"includes": [
"**",
"!node_modules",
"!vendor",
"!composer.lock",
"!package-lock.json"
]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 4
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"javascript": {
"formatter": {
"quoteStyle": "double"
}
},
"json": {
"formatter": {
"enabled": true,
"bracketSpacing": true,
"expand": "always"
},
"parser": {
"allowComments": true
}
},
"assist": {
"enabled": true,
"actions": {
"source": {
"organizeImports": "on"
}
}
}
}
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"dragon-code/codestyler": true,
"ergebnis/composer-normalize": true,
"friendsofphp/php-cs-fixer": true,
"laravel/pint": true,
"symfony/thanks": true
},
"preferred-install": "dist",
Expand Down
4 changes: 2 additions & 2 deletions docs/snippets/failed_status.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
return new class extends Operation {
public function up(): void
{
throw new Exeption();
throw new Exeption;
}

public function down(): void
{
throw new Exeption();
throw new Exeption;
}

public function success(): void
Expand Down
83 changes: 83 additions & 0 deletions pint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"preset": "laravel",
"rules": {
"@PHP71Migration": true,
"@PHP73Migration": true,
"@PHP74Migration": true,
"@PHP80Migration": true,
"@PHP81Migration": true,
"@PHP82Migration": true,
"concat_space": {
"spacing": "one"
},
"blank_line_before_statement": {
"statements": [
"declare",
"phpdoc",
"continue",
"return"
]
},
"class_attributes_separation": {
"elements": {
"case": "none",
"const": "none",
"method": "one",
"property": "one",
"trait_import": "none"
}
},
"class_definition": {
"multi_line_extends_each_single_line": true,
"single_item_single_line": true,
"single_line": true,
"space_before_parenthesis": true
},
"combine_consecutive_issets": true,
"combine_consecutive_unsets": true,
"braces_position": {
"allow_single_line_anonymous_functions": true,
"allow_single_line_empty_anonymous_classes": true,
"anonymous_classes_opening_brace": "same_line"
},
"escape_implicit_backslashes": {
"double_quoted": true,
"heredoc_syntax": true,
"single_quoted": false
},
"global_namespace_import": {
"import_classes": true,
"import_constants": true,
"import_functions": true
},
"multiline_comment_opening_closing": true,
"no_superfluous_elseif": true,
"no_useless_else": true,
"operator_linebreak": {
"only_booleans": false
},
"ordered_types": {
"null_adjustment": "always_last",
"sort_algorithm": "alpha"
},
"phpdoc_line_span": {
"const": "single",
"method": "multi",
"property": "single"
},
"return_assignment": true,
"simplified_if_return": true,
"phpdoc_param_order": true,
"fully_qualified_strict_types": true,
"declare_strict_types": true,
"types_spaces": {
"space_multiple_catch": "none"
},
"binary_operator_spaces": {
"default": "align_single_space_minimal"
},
"php_unit_method_casing": {
"case": "camel_case"
}
}
}
3 changes: 1 addition & 2 deletions src/Console/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int

try {
return parent::execute($input, $output);
}
finally {
} finally {
if ($this->getIsolateOption() !== false) {
$this->isolationMutex()->forget($this);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Helpers/OperationHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class OperationHelper
{
public static function run(?string $path = null, ?bool $realpath = null): void
{
$parameters = (new Collection())
$parameters = (new Collection)
->when($path, fn (Collection $items) => $items->put('--' . Options::Path, $path))
->when($realpath, fn (Collection $items) => $items->put('--' . Options::Realpath, true))
->all();
Expand Down
3 changes: 1 addition & 2 deletions src/Processors/OperationsProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ protected function runOperations(array $completed): void
}

$this->fireEvent(NoPendingDeployOperations::class, MethodEnum::Up);
}
catch (Throwable $e) {
} catch (Throwable $e) {
$this->fireEvent(DeployOperationFailed::class, MethodEnum::Up);

throw $e;
Expand Down
3 changes: 1 addition & 2 deletions src/Services/MigratorService.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ protected function runOperation(Operation $operation, string $method): void
$this->runMethod($operation, $method, $operation->withinTransactions());

$operation->success();
}
catch (Throwable $e) {
} catch (Throwable $e) {
$operation->failed();

throw $e;
Expand Down
3 changes: 1 addition & 2 deletions tests/Commands/EventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ public function testFailed(): void

try {
$this->artisan(Names::Operations)->run();
}
catch (Throwable $e) {
} catch (Throwable $e) {
Event::assertDispatchedTimes(DeployOperationStarted::class, 1);
Event::assertDispatchedTimes(DeployOperationFailed::class, 1);

Expand Down
4 changes: 2 additions & 2 deletions tests/Commands/MutexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ protected function setUp(): void

public function handle(): int
{
++$this->ran;
$this->ran++;

return self::SUCCESS;
}
Expand Down Expand Up @@ -94,7 +94,7 @@ public function testCanRunCommandAgainNonAutomated(): void
protected function runCommand($withIsolated = true)
{
$input = new ArrayInput(['--' . Options::Isolated => $withIsolated]);
$output = new NullOutput();
$output = new NullOutput;

$this->command->run($input, $output);
}
Expand Down
9 changes: 3 additions & 6 deletions tests/Commands/OperationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ public function testFailedTransaction(): void

try {
$this->artisan(Names::Operations)->assertExitCode(0);
}
catch (Exception $e) {
} catch (Exception $e) {
$this->assertSame(Exception::class, get_class($e));
$this->assertSame('Random message', $e->getMessage());
}
Expand Down Expand Up @@ -270,8 +269,7 @@ public function testUpSuccessOnFailed(): void
$this->copySuccessFailureMethod();

$this->artisan(Names::Operations)->assertExitCode(0);
}
catch (Throwable $e) {
} catch (Throwable $e) {
$this->assertInstanceOf(Exception::class, $e);

$this->assertSame('Custom exception', $e->getMessage());
Expand Down Expand Up @@ -323,8 +321,7 @@ public function testUpFailedOnException(): void
$this->copyFailedMethod();

$this->artisan(Names::Operations)->assertExitCode(0);
}
catch (Throwable $e) {
} catch (Throwable $e) {
$this->assertInstanceOf(Exception::class, $e);

$this->assertSame('Custom exception', $e->getMessage());
Expand Down
6 changes: 2 additions & 4 deletions tests/Commands/RollbackTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@ public function testDownSuccessOnFailed(): void
$this->assertDatabaseOperationHas($this->table, 'run_success_on_failed');

$this->artisan(Names::Rollback)->assertExitCode(1);
}
catch (Throwable $e) {
} catch (Throwable $e) {
$this->assertInstanceOf(Exception::class, $e);

$this->assertSame('Custom exception', $e->getMessage());
Expand Down Expand Up @@ -197,8 +196,7 @@ public function testUpFailedOnException(): void
$this->table()->insert(['operation' => '2021_12_23_184029_run_failed_failure', 'batch' => 999]);

$this->artisan(Names::Rollback)->assertExitCode(0);
}
catch (Throwable $e) {
} catch (Throwable $e) {
$this->assertInstanceOf(Exception::class, $e);

$this->assertSame('Custom exception', $e->getMessage());
Expand Down
2 changes: 1 addition & 1 deletion tests/Helpers/SorterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@ public function testByRan(): void

protected function sorter(): SorterHelper
{
return new SorterHelper();
return new SorterHelper;
}
}