diff --git a/.php-cs-fixer.cache b/.php-cs-fixer.cache new file mode 100644 index 0000000..aa9e1fb --- /dev/null +++ b/.php-cs-fixer.cache @@ -0,0 +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\/Rotate.php":"a80c46b6c7bdef3dbd56d6ce7191292b","src\/Events\/RotateHasFailed.php":"d69d8e711ef6550a7275dfb5b32a9b55","src\/Events\/RotateWasSuccessful.php":"e88e3678428be57b05f43980b1217439","src\/Helpers\/Log.php":"0ff3c8c85f712c0aae31b38a26903b63","src\/RotateServiceProvider.php":"64408a85d6e71922059c1df2a9ad6a28","src\/Commands\/RotateCommand.php":"aaa17e708aad06d4756d30ef4d5aacb3","src\/Commands\/RotateFileCommand.php":"80df2e82ffa8663fc8fc1fe02d69c75b","tests\/Handlers\/RotativeHandlerTest.php":"961edbe17000a8980c0085a9a5c2a422","tests\/ScheduleTest.php":"d7502bf8a56866679c8fb71047111cc7","tests\/RotateTest.php":"58a70c0e6f1437df00dddd6d3d32d797","tests\/TestCase.php":"84fda5f256b496c1a15543433943287b","tests\/Commands\/RotateFileTest.php":"45bd41bc810e8bc099eaa60137183b98"}} \ No newline at end of file diff --git a/src/Rotate.php b/src/Rotate.php index 87ed9a3..a94d506 100644 --- a/src/Rotate.php +++ b/src/Rotate.php @@ -40,7 +40,7 @@ private function buildRotateDefault(array $options = []): Rotation event(new RotateHasFailed('', $error)); }, ], - $options + $options )); } } diff --git a/tests/Commands/RotateFileTest.php b/tests/Commands/RotateFileTest.php index 1dea52e..f9c5953 100644 --- a/tests/Commands/RotateFileTest.php +++ b/tests/Commands/RotateFileTest.php @@ -18,7 +18,7 @@ public function setUp(): void } /** @test **/ - public function itCanRotateFile() + public function it_can_rotate_file() { $file1 = $this->tmpDir.'/file1'; $file2 = $this->tmpDir.'/file2'; diff --git a/tests/Handlers/RotativeHandlerTest.php b/tests/Handlers/RotativeHandlerTest.php index cbf4db5..765c003 100644 --- a/tests/Handlers/RotativeHandlerTest.php +++ b/tests/Handlers/RotativeHandlerTest.php @@ -16,7 +16,7 @@ public function setUp(): void $this->app['config']->set('rotate.log_max_files', 5); } - public function testItCanRotateLogs() + public function test_it_can_rotate_logs() { $this->writeLog(); @@ -30,7 +30,7 @@ public function testItCanRotateLogs() $this->assertFileExists(app()->storagePath().'/logs/laravel.log.1.gz'); } - public function testItCanRotateLogsWithoutcompress() + public function test_it_can_rotate_logs_withoutcompress() { $this->writeLog(); @@ -46,7 +46,7 @@ public function testItCanRotateLogsWithoutcompress() $this->assertFileExists(app()->storagePath().'/logs/laravel.log.1'); } - public function testItCanRotateLogsWithMaxfiles() + public function test_it_can_rotate_logs_with_maxfiles() { Event::fake(); diff --git a/tests/RotateTest.php b/tests/RotateTest.php index cab571d..121fca3 100644 --- a/tests/RotateTest.php +++ b/tests/RotateTest.php @@ -11,7 +11,7 @@ class RotateTest extends TestCase { - public function testNoRotateIfFileLogsNotExits() + public function test_no_rotate_if_file_logs_not_exits() { $resultCode = Artisan::call('rotate:logs'); @@ -22,7 +22,7 @@ public function testNoRotateIfFileLogsNotExits() $this->assertFileDoesNotExist(app()->storagePath().'/logs/laravel.log.1.gz'); } - public function testNoRotateIfFileLogsIsEmpty() + public function test_no_rotate_if_file_logs_is_empty() { touch(app()->storagePath().'/logs/laravel.log'); @@ -35,7 +35,7 @@ public function testNoRotateIfFileLogsIsEmpty() $this->assertFileDoesNotExist(app()->storagePath().'/logs/laravel.log.1.gz'); } - public function testItNotRotateLogsDaily() + public function test_it_not_rotate_logs_daily() { $this->app['config']->set('logging.default', 'daily'); @@ -58,7 +58,7 @@ public function testItNotRotateLogsDaily() } } - public function testItCanRotateLogsCustomStreamFile() + public function test_it_can_rotate_logs_custom_stream_file() { $this->app['config']->set('logging.channels.custom', [ 'driver' => 'monolog', @@ -84,7 +84,7 @@ public function testItCanRotateLogsCustomStreamFile() unlink(app()->storagePath().'/logs/custom.log.1.gz'); } - public function testItNotRotateLogsCustomStreamStd() + public function test_it_not_rotate_logs_custom_stream_std() { $this->app['config']->set('logging.channels.custom', [ 'driver' => 'monolog', @@ -104,7 +104,7 @@ public function testItNotRotateLogsCustomStreamStd() $this->assertEquals($resultCode, 0); } - public function testItCanWriteLogAfterRotate() + public function test_it_can_write_log_after_rotate() { $this->writeLog(); @@ -122,7 +122,7 @@ public function testItCanWriteLogAfterRotate() //$this->assertGreaterThan(0, filesize(app()->storagePath().'/logs/laravel.log')); } - public function testRotateForeingFiles() + public function test_rotate_foreing_files() { $file = storage_path('logs/foreing_file.log'); diff --git a/tests/ScheduleTest.php b/tests/ScheduleTest.php index 0e27994..8ac6802 100644 --- a/tests/ScheduleTest.php +++ b/tests/ScheduleTest.php @@ -6,7 +6,7 @@ class ScheduleTest extends TestCase { - public function testHasSchedule() + public function test_has_schedule() { $this->assertTrue($this->scheduleRegistered()); }