Skip to content

Commit 9f87fd4

Browse files
committed
Commit from GitHub Actions (style-fix)
1 parent 8689ab0 commit 9f87fd4

File tree

8 files changed

+30
-29
lines changed

8 files changed

+30
-29
lines changed

.php-cs-fixer.cache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"php":"8.1.13","version":"3.13.2:v3.13.2#3952f08a81bd3b1b15e11c3de0b6bf037faa8496","indent":" ","lineEnding":"\n","rules":{"blank_line_after_opening_tag":true,"blank_line_between_import_groups":true,"braces":{"allow_single_line_anonymous_class_with_empty_body":true},"class_definition":{"inline_constructor_arguments":false,"space_before_parenthesis":true},"compact_nullable_typehint":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_blank_line_before_namespace":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,"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_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,"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"}},"php_unit_method_casing":{"case":"snake_case"}},"hashes":{"src\/Morph.php":"5405d8f5b18908099ea7d2010a0b16d3","src\/Events\/RelationMorphFromModelWasCleaned.php":"51a9d997b802b7cc0e86bc126d7ea179","src\/CascadeDeleteServiceProvider.php":"23b570b748a1ba891ee54e967846cd75","src\/Commands\/MorphCleanCommand.php":"c13258bc2c7ec8e3a0592ea8af91e986","src\/CascadeDelete.php":"ec628b70ac9e737f9b59a955aeae4b65","tests\/databases\/factories\/UserFactory.php":"9369b081100365bd1e52148c369a7ff0","tests\/databases\/factories\/VideoFactory.php":"1222812096e7eb38ff9fdf9a2074c771","tests\/databases\/factories\/TagFactory.php":"790b78bba05e59bec624e9293430b47c","tests\/databases\/factories\/ImageFactory.php":"43cb6ac4d8072390007b39dca5ff62de","tests\/databases\/factories\/PhotoFactory.php":"0ad5e585977679e8275861b70ba9d275","tests\/databases\/factories\/OptionFactory.php":"f5aa382068a533445d6632f14e6c442f","tests\/Events\/EventTest.php":"2168f3ba007f9b196ec37f51b26ecd2a","tests\/Morph\/CleanTest.php":"032e56b99db96a55017598d60d5cd954","tests\/Morph\/DeleteTest.php":"9e0d14f5077cbfebc743c2af76c97e00","tests\/TestCase.php":"8a9f864f28a898bd942ed0779fc07f84","tests\/CascadeDeleteTest.php":"8efb5ec0dfa8b9376100ecbb2dc50d43","tests\/Commands\/MorphCleanCommandTest.php":"d54496296873e3a5b738b552b878d6b5","tests\/Models\/Option.php":"ea8d695741002c56548fdea2a53fbf9a","tests\/Models\/Image.php":"72c4ce019cc4e2743533b0c20112c032","tests\/Models\/BadModel2.php":"0062c5c706c5d8882cbd56914bf7c06f","tests\/Models\/Tag.php":"397f1103034241ff35816ab286ff7619","tests\/Models\/User.php":"90cc4ea16f5f95c4b937017b7615a5ce","tests\/Models\/Video.php":"f275df1fb4131100221a20ea17110122","tests\/Models\/BadModel.php":"eaa647d330748854adc0a1ce9dc2a605","tests\/Models\/Photo.php":"7669765afdb2cfb881e14ad874946493"}}

src/Morph.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ protected function getCascadeDeleteModels()
8686

8787
return array_map(
8888
function ($modelName) {
89-
return new $modelName;
89+
return new $modelName();
9090
},
9191
$this->getModelsNameWithCascadeDeleteTrait()
9292
);

tests/CascadeDeleteTest.php

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

88
class CascadeDeleteTest extends TestCase
99
{
10-
public function testBootCascadeDelete()
10+
public function test_boot_cascade_delete()
1111
{
1212
factory(User::class, 2)
1313
->create()
@@ -22,7 +22,7 @@ public function testBootCascadeDelete()
2222
$this->assertEquals(1, Image::count());
2323
}
2424

25-
public function testDeleteMorphResidual()
25+
public function test_delete_morph_residual()
2626
{
2727
factory(User::class, 2)
2828
->create()
@@ -34,7 +34,7 @@ public function testDeleteMorphResidual()
3434

3535
User::where('id', 1)->delete();
3636

37-
(new User)->deleteMorphResidual();
37+
(new User())->deleteMorphResidual();
3838

3939
$this->assertEquals(1, Image::count());
4040
}

tests/Commands/MorphCleanCommandTest.php

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

1010
class MorphCleanCommandTest extends TestCase
1111
{
12-
public function testMorphCleanCommand()
12+
public function test_morph_clean_command()
1313
{
1414
factory(User::class, 2)
1515
->create()
@@ -34,7 +34,7 @@ public function testMorphCleanCommand()
3434
$this->assertNotNull(User::where('id', 2)->first()->image);
3535
}
3636

37-
public function testMorphCleanCommandWithDryRun()
37+
public function test_morph_clean_command_with_dry_run()
3838
{
3939
factory(User::class, 2)
4040
->create()

tests/Events/EventTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
class EventTest extends TestCase
1313
{
14-
public function testRelationMorphFromModelWasCleaned()
14+
public function test_relation_morph_from_model_was_cleaned()
1515
{
1616
Event::fake();
1717

@@ -26,7 +26,7 @@ public function testRelationMorphFromModelWasCleaned()
2626
$this->assertEquals(2, Image::count());
2727
$this->assertNotNull(User::first()->image);
2828

29-
(new Morph)->cleanResidualByModel(new User());
29+
(new Morph())->cleanResidualByModel(new User());
3030

3131
Event::assertDispatched(RelationMorphFromModelWasCleaned::class, 1);
3232
Event::assertDispatched(

tests/Morph/CleanTest.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313

1414
class CleanTest extends TestCase
1515
{
16-
public function testLoadModels()
16+
public function test_load_models()
1717
{
18-
$this->assertEquals(5, count((new MorphMock)->callGetCascadeDeleteModels()));
18+
$this->assertEquals(5, count((new MorphMock())->callGetCascadeDeleteModels()));
1919
}
2020

21-
public function testCleanResidualMorphRelationsFromModelMorphOneWithoutLoad()
21+
public function test_clean_residual_morph_relations_from_model_morph_one_without_load()
2222
{
2323
factory(User::class, 2)
2424
->create()
@@ -31,14 +31,14 @@ public function testCleanResidualMorphRelationsFromModelMorphOneWithoutLoad()
3131
$this->assertEquals(2, Image::count());
3232
$this->assertNotNull(User::first()->image);
3333

34-
$numRowsDeleted = (new Morph)->cleanResidualByModel(new User());
34+
$numRowsDeleted = (new Morph())->cleanResidualByModel(new User());
3535

3636
$this->assertEquals(1, $numRowsDeleted);
3737
$this->assertEquals(1, Image::count());
3838
$this->assertNotNull(User::where('id', 1)->first()->image);
3939
}
4040

41-
public function testCleanResidualMorphRelationsFromModelMorphOne()
41+
public function test_clean_residual_morph_relations_from_model_morph_one()
4242
{
4343
factory(User::class, 2)
4444
->create()
@@ -51,14 +51,14 @@ public function testCleanResidualMorphRelationsFromModelMorphOne()
5151
$this->assertEquals(2, Image::count());
5252
$this->assertNotNull(User::first()->image);
5353

54-
$numRowsDeleted = (new Morph)->cleanResidualByModel(new User());
54+
$numRowsDeleted = (new Morph())->cleanResidualByModel(new User());
5555

5656
$this->assertEquals(1, $numRowsDeleted);
5757
$this->assertEquals(1, Image::count());
5858
$this->assertNotNull(User::where('id', 2)->first()->image);
5959
}
6060

61-
public function testCleanResidualMorphRelationsFromModelMorphMany()
61+
public function test_clean_residual_morph_relations_from_model_morph_many()
6262
{
6363
factory(Photo::class, 2)
6464
->create()
@@ -71,14 +71,14 @@ public function testCleanResidualMorphRelationsFromModelMorphMany()
7171
$this->assertEquals(4, Option::count());
7272
$this->assertEquals(2, Photo::first()->options()->count());
7373

74-
$numRowsDeleted = (new Morph)->cleanResidualByModel(new Photo());
74+
$numRowsDeleted = (new Morph())->cleanResidualByModel(new Photo());
7575

7676
$this->assertEquals(2, $numRowsDeleted);
7777
$this->assertEquals(2, Option::count());
7878
$this->assertNotNull(2, Photo::where('id', 1)->first()->options()->count());
7979
}
8080

81-
public function testCleanResidualMorphRelationsFromModelMorphToMany()
81+
public function test_clean_residual_morph_relations_from_model_morph_to_many()
8282
{
8383
factory(Tag::class, 2)->create();
8484

@@ -92,14 +92,14 @@ public function testCleanResidualMorphRelationsFromModelMorphToMany()
9292

9393
$this->assertEquals(4, DB::table('taggables')->count());
9494

95-
$numRowsDeleted = (new Morph)->cleanResidualByModel(new Video());
95+
$numRowsDeleted = (new Morph())->cleanResidualByModel(new Video());
9696

9797
$this->assertEquals(2, $numRowsDeleted);
9898
$this->assertEquals(2, DB::table('taggables')->count());
9999
$this->assertEquals(2, Video::where('id', 1)->first()->tags()->count());
100100
}
101101

102-
public function testCleanResidualMorphRelations()
102+
public function test_clean_residual_morph_relations()
103103
{
104104
factory(Tag::class, 2)->create();
105105

@@ -113,7 +113,7 @@ public function testCleanResidualMorphRelations()
113113

114114
$this->assertEquals(4, DB::table('taggables')->count());
115115

116-
(new Morph)->cleanResidualAllModels();
116+
(new Morph())->cleanResidualAllModels();
117117

118118
$this->assertEquals(2, DB::table('taggables')->count());
119119
$this->assertEquals(2, Video::where('id', 2)->first()->tags()->count());

tests/Morph/DeleteTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
class DeleteTest extends TestCase
1515
{
16-
public function test_delete_morph_relations_from_event_model_MorphOne()
16+
public function test_delete_morph_relations_from_event_model__morph_one()
1717
{
1818
factory(User::class, 2)
1919
->create()
@@ -29,7 +29,7 @@ public function test_delete_morph_relations_from_event_model_MorphOne()
2929
$this->assertEquals(1, Image::count());
3030
}
3131

32-
public function test_delete_morph_relations_from_record_model_MorphOne()
32+
public function test_delete_morph_relations_from_record_model__morph_one()
3333
{
3434
factory(User::class, 2)
3535
->create()
@@ -40,13 +40,13 @@ public function test_delete_morph_relations_from_record_model_MorphOne()
4040
$this->assertEquals(2, Image::count());
4141
$this->assertNotNull(User::first()->image);
4242

43-
(new Morph)->delete(User::first());
43+
(new Morph())->delete(User::first());
4444

4545
$this->assertEquals(1, Image::count());
4646
$this->assertNull(User::first()->image);
4747
}
4848

49-
public function test_delete_morph_relations_from_record_model_MorphMany()
49+
public function test_delete_morph_relations_from_record_model__morph_many()
5050
{
5151
factory(Photo::class, 2)
5252
->create()
@@ -57,13 +57,13 @@ public function test_delete_morph_relations_from_record_model_MorphMany()
5757
$this->assertEquals(4, Option::count());
5858
$this->assertEquals(2, Photo::first()->options()->count());
5959

60-
(new Morph)->delete(Photo::first());
60+
(new Morph())->delete(Photo::first());
6161

6262
$this->assertEquals(2, Option::count());
6363
$this->assertEquals(0, Photo::first()->options()->count());
6464
}
6565

66-
public function test_delete_morph_relations_from_record_model_MorphToMany()
66+
public function test_delete_morph_relations_from_record_model__morph_to_many()
6767
{
6868
factory(Tag::class, 2)->create();
6969

@@ -77,7 +77,7 @@ public function test_delete_morph_relations_from_record_model_MorphToMany()
7777
$this->assertEquals(2, Video::skip(1)->first()->tags()->count());
7878
$this->assertEquals(4, DB::table('taggables')->count());
7979

80-
(new Morph)->delete(Video::first());
80+
(new Morph())->delete(Video::first());
8181

8282
$this->assertEquals(0, Video::first()->tags()->count());
8383
$this->assertEquals(2, Video::skip(1)->first()->tags()->count());

tests/TestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ protected function getEnvironmentSetUp($app)
4545
// Setup default database to use sqlite :memory:
4646
$app['config']->set('database.default', 'testbench');
4747
$app['config']->set('database.connections.testbench', [
48-
'driver' => 'sqlite',
48+
'driver' => 'sqlite',
4949
'database' => ':memory:',
50-
'prefix' => '',
50+
'prefix' => '',
5151
]);
5252
$app['config']->set('morph.models_paths', __DIR__.'/Models');
5353
}

0 commit comments

Comments
 (0)