Skip to content

Commit 3748e5a

Browse files
Merge pull request #225 from TheDragonCode/code-style-to954og
The code style has been fixed
2 parents a6f053c + f4e2202 commit 3748e5a

File tree

13 files changed

+151
-24
lines changed

13 files changed

+151
-24
lines changed

biome.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
3+
"vcs": {
4+
"enabled": false,
5+
"clientKind": "git",
6+
"useIgnoreFile": false
7+
},
8+
"files": {
9+
"ignoreUnknown": false,
10+
"includes": [
11+
"**",
12+
"!node_modules",
13+
"!vendor",
14+
"!composer.lock",
15+
"!package-lock.json"
16+
]
17+
},
18+
"formatter": {
19+
"enabled": true,
20+
"indentStyle": "space",
21+
"indentWidth": 4
22+
},
23+
"linter": {
24+
"enabled": true,
25+
"rules": {
26+
"recommended": true
27+
}
28+
},
29+
"javascript": {
30+
"formatter": {
31+
"quoteStyle": "double"
32+
}
33+
},
34+
"json": {
35+
"formatter": {
36+
"enabled": true,
37+
"bracketSpacing": true,
38+
"expand": "always"
39+
},
40+
"parser": {
41+
"allowComments": true
42+
}
43+
},
44+
"assist": {
45+
"enabled": true,
46+
"actions": {
47+
"source": {
48+
"organizeImports": "on"
49+
}
50+
}
51+
}
52+
}

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
"dragon-code/codestyler": true,
8080
"ergebnis/composer-normalize": true,
8181
"friendsofphp/php-cs-fixer": true,
82+
"laravel/pint": true,
8283
"symfony/thanks": true
8384
},
8485
"preferred-install": "dist",

docs/snippets/failed_status.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
return new class extends Operation {
99
public function up(): void
1010
{
11-
throw new Exeption();
11+
throw new Exeption;
1212
}
1313

1414
public function down(): void
1515
{
16-
throw new Exeption();
16+
throw new Exeption;
1717
}
1818

1919
public function success(): void

pint.json

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"preset": "laravel",
3+
"rules": {
4+
"@PHP71Migration": true,
5+
"@PHP73Migration": true,
6+
"@PHP74Migration": true,
7+
"@PHP80Migration": true,
8+
"@PHP81Migration": true,
9+
"@PHP82Migration": true,
10+
"concat_space": {
11+
"spacing": "one"
12+
},
13+
"blank_line_before_statement": {
14+
"statements": [
15+
"declare",
16+
"phpdoc",
17+
"continue",
18+
"return"
19+
]
20+
},
21+
"class_attributes_separation": {
22+
"elements": {
23+
"case": "none",
24+
"const": "none",
25+
"method": "one",
26+
"property": "one",
27+
"trait_import": "none"
28+
}
29+
},
30+
"class_definition": {
31+
"multi_line_extends_each_single_line": true,
32+
"single_item_single_line": true,
33+
"single_line": true,
34+
"space_before_parenthesis": true
35+
},
36+
"combine_consecutive_issets": true,
37+
"combine_consecutive_unsets": true,
38+
"braces_position": {
39+
"allow_single_line_anonymous_functions": true,
40+
"allow_single_line_empty_anonymous_classes": true,
41+
"anonymous_classes_opening_brace": "same_line"
42+
},
43+
"escape_implicit_backslashes": {
44+
"double_quoted": true,
45+
"heredoc_syntax": true,
46+
"single_quoted": false
47+
},
48+
"global_namespace_import": {
49+
"import_classes": true,
50+
"import_constants": true,
51+
"import_functions": true
52+
},
53+
"multiline_comment_opening_closing": true,
54+
"no_superfluous_elseif": true,
55+
"no_useless_else": true,
56+
"operator_linebreak": {
57+
"only_booleans": false
58+
},
59+
"ordered_types": {
60+
"null_adjustment": "always_last",
61+
"sort_algorithm": "alpha"
62+
},
63+
"phpdoc_line_span": {
64+
"const": "single",
65+
"method": "multi",
66+
"property": "single"
67+
},
68+
"return_assignment": true,
69+
"simplified_if_return": true,
70+
"phpdoc_param_order": true,
71+
"fully_qualified_strict_types": true,
72+
"declare_strict_types": true,
73+
"types_spaces": {
74+
"space_multiple_catch": "none"
75+
},
76+
"binary_operator_spaces": {
77+
"default": "align_single_space_minimal"
78+
},
79+
"php_unit_method_casing": {
80+
"case": "camel_case"
81+
}
82+
}
83+
}

src/Console/Command.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
4646

4747
try {
4848
return parent::execute($input, $output);
49-
}
50-
finally {
49+
} finally {
5150
if ($this->getIsolateOption() !== false) {
5251
$this->isolationMutex()->forget($this);
5352
}

src/Helpers/OperationHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class OperationHelper
1313
{
1414
public static function run(?string $path = null, ?bool $realpath = null): void
1515
{
16-
$parameters = (new Collection())
16+
$parameters = (new Collection)
1717
->when($path, fn (Collection $items) => $items->put('--' . Options::Path, $path))
1818
->when($realpath, fn (Collection $items) => $items->put('--' . Options::Realpath, true))
1919
->all();

src/Processors/OperationsProcessor.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ protected function runOperations(array $completed): void
5151
}
5252

5353
$this->fireEvent(NoPendingDeployOperations::class, MethodEnum::Up);
54-
}
55-
catch (Throwable $e) {
54+
} catch (Throwable $e) {
5655
$this->fireEvent(DeployOperationFailed::class, MethodEnum::Up);
5756

5857
throw $e;

src/Services/MigratorService.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ protected function runOperation(Operation $operation, string $method): void
9898
$this->runMethod($operation, $method, $operation->withinTransactions());
9999

100100
$operation->success();
101-
}
102-
catch (Throwable $e) {
101+
} catch (Throwable $e) {
103102
$operation->failed();
104103

105104
throw $e;

tests/Commands/EventsTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ public function testFailed(): void
4040

4141
try {
4242
$this->artisan(Names::Operations)->run();
43-
}
44-
catch (Throwable $e) {
43+
} catch (Throwable $e) {
4544
Event::assertDispatchedTimes(DeployOperationStarted::class, 1);
4645
Event::assertDispatchedTimes(DeployOperationFailed::class, 1);
4746

tests/Commands/MutexTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ protected function setUp(): void
2626

2727
public function handle(): int
2828
{
29-
++$this->ran;
29+
$this->ran++;
3030

3131
return self::SUCCESS;
3232
}
@@ -94,7 +94,7 @@ public function testCanRunCommandAgainNonAutomated(): void
9494
protected function runCommand($withIsolated = true)
9595
{
9696
$input = new ArrayInput(['--' . Options::Isolated => $withIsolated]);
97-
$output = new NullOutput();
97+
$output = new NullOutput;
9898

9999
$this->command->run($input, $output);
100100
}

0 commit comments

Comments
 (0)