Skip to content

Commit 93e6576

Browse files
authored
Merge pull request #7 from cesargb/analysis-qojaQP
Apply fixes from StyleCI
2 parents a4d780c + f5337e6 commit 93e6576

File tree

4 files changed

+9
-14
lines changed

4 files changed

+9
-14
lines changed

src/Commands/Rotate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
use Illuminate\Console\Command;
77
use Cesargb\File\Rotate\Events\RotateHasFailed;
88
use Cesargb\File\Rotate\Handlers\RotativeHandler;
9+
use Cesargb\File\Rotate\Helpers\Log as LogHelper;
910
use Cesargb\File\Rotate\Events\RotateWasSuccessful;
1011
use Cesargb\File\Rotate\Events\RotateIsNotNecessary;
11-
use Cesargb\File\Rotate\Helpers\Log as LogHelper;
1212

1313
class Rotate extends Command
1414
{

src/Commands/RotateFile.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
use Event;
66
use Illuminate\Console\Command;
77
use Cesargb\File\Rotate\Events\RotateHasFailed;
8+
use Cesargb\File\Rotate\Handlers\RotativeHandler;
89
use Cesargb\File\Rotate\Events\RotateWasSuccessful;
910
use Cesargb\File\Rotate\Events\RotateIsNotNecessary;
10-
use Cesargb\File\Rotate\Handlers\RotativeHandler;
11-
use Cesargb\File\Rotate\Helpers\Log as LogHelper;
1211

1312
class RotateFile extends Command
1413
{

src/Handlers/AbstractHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ protected function close()
9090

9191
protected function moveData($fileSource, $fileDestination)
9292
{
93-
$fdSource = fopen($fileSource, "r+");
93+
$fdSource = fopen($fileSource, 'r+');
9494

95-
if (! $fdSource ) {
95+
if (! $fdSource) {
9696
return false;
9797
}
9898

@@ -108,7 +108,7 @@ protected function moveData($fileSource, $fileDestination)
108108
return false;
109109
}
110110

111-
if (! ftruncate($fdSource, 0)){
111+
if (! ftruncate($fdSource, 0)) {
112112
fclose($fdSource);
113113

114114
unlink($fileDestination);

tests/Commands/RotateFileTest.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,13 @@
22

33
namespace Cesargb\File\Rotate\Test\Commands;
44

5-
use Monolog\Handler\StreamHandler;
6-
use Cesargb\File\Rotate\Test\TestCase;
75
use Illuminate\Support\Facades\Event;
6+
use Cesargb\File\Rotate\Test\TestCase;
87
use Illuminate\Support\Facades\Artisan;
9-
use Cesargb\File\Rotate\Helpers\Log as LogHelper;
108
use Cesargb\File\Rotate\Events\RotateWasSuccessful;
11-
use Cesargb\File\Rotate\Events\RotateIsNotNecessary;
129

1310
class RotateFileTest extends TestCase
1411
{
15-
1612
public function setUp()
1713
{
1814
parent::setUp();
@@ -28,7 +24,7 @@ public function it_can_rotate_file()
2824
$file2 = $this->tmpDir.'/file2';
2925

3026
$resultCode = Artisan::call('rotate:files', [
31-
'--file' => [ $file1, $file2 ],
27+
'--file' => [$file1, $file2],
3228
]);
3329

3430
Event::assertDispatched(RotateWasSuccessful::class, 2);
@@ -47,7 +43,7 @@ public function it_can_rotate_file_archive()
4743
$file2 = $this->tmpDir.'/file2';
4844

4945
$resultCode = Artisan::call('rotate:files', [
50-
'--file' => [ $file1, $file2 ],
46+
'--file' => [$file1, $file2],
5147
'--dir' => $this->tmpDir.'/archive',
5248
]);
5349

@@ -69,7 +65,7 @@ public function it_can_rotate_file_max()
6965
file_put_contents($file, 'test');
7066

7167
$resultCode = Artisan::call('rotate:files', [
72-
'--file' => [ $file ],
68+
'--file' => [$file],
7369
'--max-files' => 3,
7470
]);
7571

0 commit comments

Comments
 (0)