Skip to content

Commit 0b47832

Browse files
Merge pull request #13 from spatie/analysis-qgLxME
Apply fixes from StyleCI
2 parents 851c7d3 + f53e5d4 commit 0b47832

File tree

6 files changed

+20
-20
lines changed

6 files changed

+20
-20
lines changed

src/Filesystem.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
interface Filesystem
66
{
77
public function path(string $filename): string;
8+
89
public function has(string $filename): bool;
10+
911
public function read(string $filename): bool;
12+
1013
public function put(string $filename, string $contents);
1114
}

src/Snapshot.php

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

33
namespace Spatie\Snapshots;
44

5-
use ReflectionClass;
65
use Spatie\Snapshots\Filesystems\LocalFilesystem;
76

87
class Snapshot
@@ -69,4 +68,3 @@ public function create($actual)
6968
$this->filesystem->put($this->filename(), $this->driver->serialize($actual));
7069
}
7170
}
72-

tests/Integration/ComparesSnapshotFiles.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ protected function copyDirectory(string $sourcePath, string $destinationPath)
5353
$sourceDirectory = opendir($sourcePath);
5454

5555
while (($file = readdir($sourceDirectory)) !== false) {
56-
5756
if (in_array($file, ['.', '..'])) {
5857
continue;
5958
}

tests/Integration/MatchesSnapshotTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace Spatie\Snapshots\Test\Integration;
44

5+
use PHPUnit\Framework\ExpectationFailedException;
56
use PHPUnit\Framework\TestCase;
6-
use Spatie\Snapshots\MatchesSnapshots;
77
use PHPUnit_Framework_MockObject_MockObject;
8-
use PHPUnit\Framework\ExpectationFailedException;
8+
use Spatie\Snapshots\MatchesSnapshots;
99

1010
class MatchesSnapshotTest extends TestCase
1111
{

tests/Unit/Drivers/VarDriverTest.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ public function it_can_serialize_an_integer()
2020
{
2121
$driver = new VarDriver();
2222

23-
$this->assertEquals("<?php return 1;".PHP_EOL, $driver->serialize(1));
23+
$this->assertEquals('<?php return 1;'.PHP_EOL, $driver->serialize(1));
2424
}
2525

2626
/** @test */
2727
public function it_can_serialize_a_float()
2828
{
2929
$driver = new VarDriver();
3030

31-
$this->assertEquals("<?php return 1.5;".PHP_EOL, $driver->serialize(1.5));
31+
$this->assertEquals('<?php return 1.5;'.PHP_EOL, $driver->serialize(1.5));
3232
}
3333

3434
/** @test */
@@ -37,28 +37,28 @@ public function it_can_serialize_an_array()
3737
$driver = new VarDriver();
3838

3939
$expected = implode(PHP_EOL, [
40-
"<?php return array (",
40+
'<?php return array (',
4141
" 'foo' => ",
42-
" array (",
42+
' array (',
4343
" 'bar' => 'baz',",
44-
" ),",
45-
");",
46-
"",
44+
' ),',
45+
');',
46+
'',
4747
]);
4848

4949
$this->assertEquals($expected, $driver->serialize(['foo' => ['bar' => 'baz']]));
50-
}
50+
}
5151

5252
/** @test */
5353
public function it_can_serialize_an_object()
5454
{
5555
$driver = new VarDriver();
5656

5757
$expected = implode(PHP_EOL, [
58-
"<?php return stdClass::__set_state(array(",
58+
'<?php return stdClass::__set_state(array(',
5959
" 'foo' => 'bar',",
60-
"));",
61-
"",
60+
'));',
61+
'',
6262
]);
6363

6464
$this->assertEquals($expected, $driver->serialize((object) ['foo' => 'bar']));
@@ -70,10 +70,10 @@ public function it_can_serialize_a_class()
7070
$driver = new VarDriver();
7171

7272
$expected = implode(PHP_EOL, [
73-
"<?php return Spatie\\Snapshots\\Test\\Unit\\Drivers\\Dummy::__set_state(array(",
73+
'<?php return Spatie\\Snapshots\\Test\\Unit\\Drivers\\Dummy::__set_state(array(',
7474
" 'foo' => 'bar',",
75-
"));",
76-
"",
75+
'));',
76+
'',
7777
]);
7878

7979
$this->assertEquals($expected, $driver->serialize(new Dummy()));

tests/Unit/SnapshotTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function it_has_a_filename_based_on_its_id_and_its_drivers_extension()
4040
->willReturn('.php');
4141

4242
$snapshot = new Snapshot('abc', $this->filesystem, $this->driver);
43-
43+
4444
$this->assertEquals('abc.php', $snapshot->filename());
4545
}
4646
}

0 commit comments

Comments
 (0)