Skip to content

Commit 2000464

Browse files
Sairahcazgithub-actions[bot]
authored andcommitted
Fix styling
1 parent 710208f commit 2000464

8 files changed

+12
-19
lines changed

.php-cs-fixer.cache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"php":"8.2.7","version":"3.20.0","indent":" ","lineEnding":"\n","rules":{"blank_line_after_opening_tag":true,"blank_line_between_import_groups":true,"blank_lines_before_namespace":true,"class_definition":{"inline_constructor_arguments":false,"space_before_parenthesis":true},"compact_nullable_typehint":true,"curly_braces_position":{"allow_single_line_empty_anonymous_classes":true},"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_braces":true,"no_blank_lines_after_class_opening":true,"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"sort_algorithm":"alpha"},"return_type_declaration":true,"short_scalar_cast":true,"single_import_per_statement":{"group_to_single_imports":false},"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"control_structure_braces":true,"control_structure_continuation_position":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"no_break_comment":true,"no_closing_tag":true,"no_multiple_statements_per_line":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_line_after_imports":true,"statement_indentation":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"no_unused_imports":true,"not_operator_with_successor_space":true,"trailing_comma_in_multiline":true,"phpdoc_scalar":true,"unary_operator_spaces":true,"binary_operator_spaces":true,"blank_line_before_statement":{"statements":["break","continue","declare","return","throw","try"]},"phpdoc_single_line_var_spacing":true,"phpdoc_var_without_name":true,"class_attributes_separation":{"elements":{"method":"one"}}},"hashes":{"src\/Commands\/GenerateRulesCommand.php":"a500ac55c779ee5246dd3e77417d4fe2","src\/LaravelSchemaRulesServiceProvider.php":"c368b1f24fdf572c8c5da6d90e4fe8f9","src\/Resolvers\/SchemaRulesResolverMySql.php":"6ce5e561e87b6885fe800a331b3a832f","src\/Resolvers\/SchemaRulesResolverPgSql.php":"fa8d9ec3061744b5e48b5f3207fcb5ee","src\/Resolvers\/SchemaRulesResolverSqlite.php":"3a790800d813e42ada906e20fc70a399","src\/Resolvers\/SchemaRulesResolverInterface.php":"c40de2c178467b5a592a80fab75d4e37","src\/Exceptions\/FailedToCreateRequestClassException.php":"88d97c20dfda22508445696a600edd8f","src\/Exceptions\/UnsupportedDbDriverException.php":"55e1f4f48764869ea78e5444357e7a3a","src\/Exceptions\/ColumnDoesNotExistException.php":"e1b74bfac1771e4ae77962805adb3173","src\/Exceptions\/MultipleTablesSuppliedException.php":"44534013008741de6a024fd8c0fc62e2","src\/Exceptions\/TableDoesNotExistException.php":"d19bb30aab5ede9920cc925f9d4b3cde","tests\/TestCase.php":"17d5b78ef193fff416305ee717483177","tests\/Pest.php":"71da07894ee59b1ebc0e98d205618731","tests\/SchemaRulesTest.php":"90e6c084c25da8aab935b3e50a5eba4e"}}
1+
{"php":"8.2.7","version":"3.20.0","indent":" ","lineEnding":"\n","rules":{"blank_line_after_opening_tag":true,"blank_line_between_import_groups":true,"blank_lines_before_namespace":true,"class_definition":{"inline_constructor_arguments":false,"space_before_parenthesis":true},"compact_nullable_typehint":true,"curly_braces_position":{"allow_single_line_empty_anonymous_classes":true},"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_braces":true,"no_blank_lines_after_class_opening":true,"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"sort_algorithm":"alpha"},"return_type_declaration":true,"short_scalar_cast":true,"single_import_per_statement":{"group_to_single_imports":false},"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"control_structure_braces":true,"control_structure_continuation_position":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"no_break_comment":true,"no_closing_tag":true,"no_multiple_statements_per_line":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_line_after_imports":true,"statement_indentation":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"no_unused_imports":true,"not_operator_with_successor_space":true,"trailing_comma_in_multiline":true,"phpdoc_scalar":true,"unary_operator_spaces":true,"binary_operator_spaces":true,"blank_line_before_statement":{"statements":["break","continue","declare","return","throw","try"]},"phpdoc_single_line_var_spacing":true,"phpdoc_var_without_name":true,"class_attributes_separation":{"elements":{"method":"one"}}},"hashes":{"src\/Commands\/GenerateRulesCommand.php":"efe430d939ae29e942fd34608d465458","src\/LaravelSchemaRulesServiceProvider.php":"7e21700c24396b1b3ae4093f5a611a34","src\/Resolvers\/SchemaRulesResolverMySql.php":"c50b48648ad7adbc48b871e9f4c9dff2","src\/Resolvers\/SchemaRulesResolverPgSql.php":"4a3570d5b48c8e007966c392522b4771","src\/Resolvers\/SchemaRulesResolverSqlite.php":"f6d30cd50082722c8991f8afeaf6bbbd","src\/Resolvers\/SchemaRulesResolverInterface.php":"c40de2c178467b5a592a80fab75d4e37","src\/Exceptions\/FailedToCreateRequestClassException.php":"88d97c20dfda22508445696a600edd8f","src\/Exceptions\/UnsupportedDbDriverException.php":"55e1f4f48764869ea78e5444357e7a3a","src\/Exceptions\/ColumnDoesNotExistException.php":"e1b74bfac1771e4ae77962805adb3173","src\/Exceptions\/MultipleTablesSuppliedException.php":"44534013008741de6a024fd8c0fc62e2","src\/Exceptions\/TableDoesNotExistException.php":"d19bb30aab5ede9920cc925f9d4b3cde","tests\/TestCase.php":"17d5b78ef193fff416305ee717483177","tests\/Pest.php":"71da07894ee59b1ebc0e98d205618731","tests\/SchemaRulesTest.php":"2279a35708710e8a0a78b4edfc8f0095","src\/Resolvers\/BaseSchemaRulesResolver.php":"85f5dcca23e897416d93b4830437a445","src\/Contracts\/SchemaRulesResolverInterface.php":"0661d95c8ab20c86180132b20002e8b9"}}

src/Commands/GenerateRulesCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
use Illuminate\Support\Facades\File;
1111
use Illuminate\Support\Facades\Schema;
1212
use Illuminate\Support\Str;
13+
use LaracraftTech\LaravelSchemaRules\Contracts\SchemaRulesResolverInterface;
1314
use LaracraftTech\LaravelSchemaRules\Exceptions\ColumnDoesNotExistException;
1415
use LaracraftTech\LaravelSchemaRules\Exceptions\FailedToCreateRequestClassException;
1516
use LaracraftTech\LaravelSchemaRules\Exceptions\MultipleTablesSuppliedException;
1617
use LaracraftTech\LaravelSchemaRules\Exceptions\TableDoesNotExistException;
17-
use LaracraftTech\LaravelSchemaRules\Contracts\SchemaRulesResolverInterface;
1818

1919
class GenerateRulesCommand extends Command
2020
{

src/LaravelSchemaRulesServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
namespace LaracraftTech\LaravelSchemaRules;
44

55
use LaracraftTech\LaravelSchemaRules\Commands\GenerateRulesCommand;
6-
use LaracraftTech\LaravelSchemaRules\Exceptions\UnsupportedDbDriverException;
76
use LaracraftTech\LaravelSchemaRules\Contracts\SchemaRulesResolverInterface;
7+
use LaracraftTech\LaravelSchemaRules\Exceptions\UnsupportedDbDriverException;
88
use LaracraftTech\LaravelSchemaRules\Resolvers\SchemaRulesResolverMySql;
99
use LaracraftTech\LaravelSchemaRules\Resolvers\SchemaRulesResolverPgSql;
1010
use LaracraftTech\LaravelSchemaRules\Resolvers\SchemaRulesResolverSqlite;

src/Resolvers/BaseSchemaRulesResolver.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
abstract class BaseSchemaRulesResolver implements SchemaRulesResolverInterface
99
{
10-
1110
private string $table;
1211
private array $columns;
1312

@@ -58,12 +57,11 @@ protected function columns()
5857
return $this->columns;
5958
}
6059

61-
abstract protected function isAutoIncrement($column) : bool;
60+
abstract protected function isAutoIncrement($column): bool;
6261

63-
abstract protected function getField($column) : string;
62+
abstract protected function getField($column): string;
6463

6564
abstract protected function getColumnsDefinitionsFromTable();
6665

6766
abstract protected function generateColumnRules(stdClass $column): array;
68-
6967
}

src/Resolvers/SchemaRulesResolverMySql.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
class SchemaRulesResolverMySql extends BaseSchemaRulesResolver implements SchemaRulesResolverInterface
1111
{
12-
1312
public static array $integerTypes = [
1413
'tinyint' => [
1514
'unsigned' => ['0', '255'],
@@ -140,14 +139,13 @@ protected function generateColumnRules(stdClass $column): array
140139
return $columnRules;
141140
}
142141

143-
protected function isAutoIncrement($column) : bool
142+
protected function isAutoIncrement($column): bool
144143
{
145144
return $column->Extra === 'auto_increment';
146145
}
147146

148-
protected function getField($column) : string
147+
protected function getField($column): string
149148
{
150149
return $column->Field;
151150
}
152-
153151
}

src/Resolvers/SchemaRulesResolverPgSql.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
class SchemaRulesResolverPgSql extends BaseSchemaRulesResolver implements SchemaRulesResolverInterface
1111
{
12-
1312
public static array $integerTypes = [
1413
'smallint' => ['-32768', '32767'],
1514
'integer' => ['-2147483648', '2147483647'],
@@ -120,14 +119,13 @@ protected function generateColumnRules(stdClass $column): array
120119
return $columnRules;
121120
}
122121

123-
protected function isAutoIncrement($column) : bool
122+
protected function isAutoIncrement($column): bool
124123
{
125124
return Str::contains($column->column_default, 'nextval');
126125
}
127126

128-
protected function getField($column) : string
127+
protected function getField($column): string
129128
{
130129
return $column->column_name;
131130
}
132-
133131
}

src/Resolvers/SchemaRulesResolverSqlite.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
class SchemaRulesResolverSqlite extends BaseSchemaRulesResolver implements SchemaRulesResolverInterface
1111
{
12-
1312
protected function getColumnsDefinitionsFromTable()
1413
{
1514

@@ -73,12 +72,12 @@ protected function generateColumnRules(stdClass $column): array
7372
return $columnRules;
7473
}
7574

76-
protected function isAutoIncrement($column) : bool
75+
protected function isAutoIncrement($column): bool
7776
{
7877
return $column->pk;
7978
}
8079

81-
protected function getField($column) : string
80+
protected function getField($column): string
8281
{
8382
return $column->name;
8483
}

tests/SchemaRulesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
use Illuminate\Database\Schema\Blueprint;
44
use Illuminate\Support\Facades\Schema;
5+
use LaracraftTech\LaravelSchemaRules\Contracts\SchemaRulesResolverInterface;
56
use LaracraftTech\LaravelSchemaRules\Exceptions\ColumnDoesNotExistException;
67
use LaracraftTech\LaravelSchemaRules\Exceptions\MultipleTablesSuppliedException;
78
use LaracraftTech\LaravelSchemaRules\Exceptions\TableDoesNotExistException;
8-
use LaracraftTech\LaravelSchemaRules\Contracts\SchemaRulesResolverInterface;
99
use LaracraftTech\LaravelSchemaRules\Resolvers\SchemaRulesResolverMySql;
1010

1111
beforeEach(function () {

0 commit comments

Comments
 (0)