Skip to content

Commit 68fbc4a

Browse files
committed
satisfy scrutinizer
1 parent 4be8402 commit 68fbc4a

File tree

8 files changed

+36
-36
lines changed

8 files changed

+36
-36
lines changed

src/Specification/AndSpecification.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
/**
1818
* Class AndSpecification
1919
*/
20-
final class AndSpecification extends CompositeSpecification implements SpecificationInterface
20+
final class AndSpecification extends CompositeSpecification
2121
{
2222
/**
2323
* @var SpecificationInterface

src/Specification/IsHidden.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ class IsHidden extends CompositeSpecification
2727
*/
2828
public function isSatisfiedBy(array $value): bool
2929
{
30-
return isset($value['basename']) && substr($value['basename'], 0, 1) === '.' ? true : false;
30+
return (isset($value['basename']) && substr($value['basename'], 0, 1) === '.');
3131
}
3232
}

tests/unit/FinderTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
namespace Flyfinder;
1414

15+
use Flyfinder\Specification\IsHidden;
16+
use League\Flysystem\Filesystem;
1517
use Mockery as m;
1618
use PHPUnit\Framework\TestCase;
1719

@@ -52,8 +54,8 @@ public function testGetMethod()
5254
*/
5355
public function testIfCorrectFilesAreBeingYielded()
5456
{
55-
$isHidden = m::mock('Flyfinder\Specification\IsHidden');
56-
$filesystem = m::mock('League\Flysystem\Filesystem');
57+
$isHidden = m::mock(IsHidden::class);
58+
$filesystem = m::mock(Filesystem::class);
5759

5860
$listContents1 = [
5961
0 => [

tests/unit/Specification/AndSpecificationTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
*/
2222
class AndSpecificationTest extends TestCase
2323
{
24-
/** @var HasExtension */
24+
/** @var m\MockInterface|HasExtension */
2525
private $hasExtension;
2626

27-
/** @var IsHidden */
27+
/** @var m\MockInterface|IsHidden */
2828
private $isHidden;
2929

3030
/** @var AndSpecification */
@@ -35,8 +35,8 @@ class AndSpecificationTest extends TestCase
3535
*/
3636
public function setUp()
3737
{
38-
$this->hasExtension = m::mock('Flyfinder\Specification\HasExtension');
39-
$this->isHidden = m::mock('Flyfinder\Specification\IsHidden');
38+
$this->hasExtension = m::mock(HasExtension::class);
39+
$this->isHidden = m::mock(IsHidden::class);
4040
$this->fixture = new AndSpecification($this->hasExtension, $this->isHidden);
4141
}
4242

tests/unit/Specification/CompositeSpecificationTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@
2121
*/
2222
class CompositeSpecificationTest extends TestCase
2323
{
24-
/** @var HasExtension */
24+
/** @var m\MockInterface|HasExtension */
2525
private $hasExtension;
2626

27-
/** @var m::MockObject|CompositeSpecification */
27+
/** @var CompositeSpecification */
2828
private $fixture;
2929

3030
/**
3131
* Initializes the fixture for this test.
3232
*/
3333
public function setUp()
3434
{
35-
$this->hasExtension = m::mock('Flyfinder\Specification\HasExtension');
36-
$this->fixture = $this->getMockForAbstractClass('Flyfinder\Specification\CompositeSpecification');
35+
$this->hasExtension = m::mock(HasExtension::class);
36+
$this->fixture = $this->getMockForAbstractClass(CompositeSpecification::class);
3737
}
3838

3939
public function tearDown()
@@ -43,36 +43,36 @@ public function tearDown()
4343

4444
/**
4545
* @covers ::andSpecification
46-
* @uses Flyfinder\Specification\AndSpecification
46+
* @uses \Flyfinder\Specification\AndSpecification
4747
*/
4848
public function testAndSpecification()
4949
{
5050
$this->assertInstanceOf(
51-
'Flyfinder\Specification\AndSpecification',
51+
AndSpecification::class,
5252
$this->fixture->andSpecification($this->hasExtension)
5353
);
5454
}
5555

5656
/**
5757
* @covers ::orSpecification
58-
* @uses Flyfinder\Specification\OrSpecification
58+
* @uses \Flyfinder\Specification\OrSpecification
5959
*/
6060
public function testOrSpecification()
6161
{
6262
$this->assertInstanceOf(
63-
'Flyfinder\Specification\OrSpecification',
63+
OrSpecification::class,
6464
$this->fixture->orSpecification($this->hasExtension)
6565
);
6666
}
6767

6868
/**
6969
* @covers ::notSpecification
70-
* @uses Flyfinder\Specification\NotSpecification
70+
* @uses \Flyfinder\Specification\NotSpecification
7171
*/
7272
public function testNotSpecification()
7373
{
7474
$this->assertInstanceOf(
75-
'Flyfinder\Specification\NotSpecification',
75+
NotSpecification::class,
7676
$this->fixture->notSpecification()
7777
);
7878
}

tests/unit/Specification/InPathTest.php

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function tearDown()
3535
* @covers ::__construct
3636
* @covers ::isSatisfiedBy
3737
* @dataProvider validDirnames
38-
* @uses Flyfinder\Path
38+
* @uses \Flyfinder\Path
3939
*/
4040
public function testExactMatch()
4141
{
@@ -60,9 +60,9 @@ private function useWildcardPath()
6060
* @covers ::__construct
6161
* @covers ::isSatisfiedBy
6262
* @dataProvider validDirnames
63-
* @uses Flyfinder\Path
63+
* @uses \Flyfinder\Path
6464
*/
65-
public function testIfSpecificationIsSatisfied($dirname)
65+
public function testIfSpecificationIsSatisfied(string $dirname)
6666
{
6767
$this->useWildcardPath();
6868
$this->assertTrue($this->fixture->isSatisfiedBy(['dirname' => $dirname]));
@@ -72,9 +72,9 @@ public function testIfSpecificationIsSatisfied($dirname)
7272
* @covers ::__construct
7373
* @covers ::isSatisfiedBy
7474
* @dataProvider validDirnames
75-
* @uses Flyfinder\Path
75+
* @uses \Flyfinder\Path
7676
*/
77-
public function testWithSingleDotSpec($dirname)
77+
public function testWithSingleDotSpec(string $dirname)
7878
{
7979
$spec = new InPath(new Path('.'));
8080
$this->assertTrue($spec->isSatisfiedBy(['dirname' => $dirname]));
@@ -84,9 +84,9 @@ public function testWithSingleDotSpec($dirname)
8484
* @covers ::__construct
8585
* @covers ::isSatisfiedBy
8686
* @dataProvider validDirnames
87-
* @uses Flyfinder\Path
87+
* @uses \Flyfinder\Path
8888
*/
89-
public function testWithCurrentDirSpec($dirname)
89+
public function testWithCurrentDirSpec(string $dirname)
9090
{
9191
$spec = new InPath(new Path('./'));
9292
$this->assertTrue($spec->isSatisfiedBy(['dirname' => $dirname]));
@@ -112,20 +112,18 @@ public function validDirnames()
112112
* @covers ::__construct
113113
* @covers ::isSatisfiedBy
114114
* @dataProvider invalidDirnames
115-
* @uses Flyfinder\Path
115+
* @uses \Flyfinder\Path
116116
*/
117-
public function testIfSpecificationIsNotSatisfied($dirname)
117+
public function testIfSpecificationIsNotSatisfied(string $dirname)
118118
{
119119
$this->useWildcardPath();
120120
$this->assertFalse($this->fixture->isSatisfiedBy(['dirname' => $dirname]));
121121
}
122122

123123
/**
124124
* Data provider for testIfSpecificationIsNotSatisfied. Contains a few invalid directory names
125-
*
126-
* @return array
127125
*/
128-
public function invalidDirnames()
126+
public function invalidDirnames(): array
129127
{
130128
return [
131129
['/hiddendir/n'],

tests/unit/Specification/NotSpecificationTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*/
2222
class NotSpecificationTest extends TestCase
2323
{
24-
/** @var HasExtension */
24+
/** @var m\MockInterface|HasExtension */
2525
private $hasExtension;
2626

2727
/** @var NotSpecification */
@@ -32,7 +32,7 @@ class NotSpecificationTest extends TestCase
3232
*/
3333
public function setUp()
3434
{
35-
$this->hasExtension = m::mock('Flyfinder\Specification\HasExtension');
35+
$this->hasExtension = m::mock(HasExtension::class);
3636
$this->fixture = new NotSpecification($this->hasExtension);
3737
}
3838

tests/unit/Specification/OrSpecificationTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
*/
2222
class OrSpecificationTest extends TestCase
2323
{
24-
/** @var HasExtension */
24+
/** @var m\MockInterface|HasExtension */
2525
private $hasExtension;
2626

27-
/** @var IsHidden */
27+
/** @var m\MockInterface|IsHidden */
2828
private $isHidden;
2929

3030
/** @var OrSpecification */
@@ -35,8 +35,8 @@ class OrSpecificationTest extends TestCase
3535
*/
3636
public function setUp()
3737
{
38-
$this->hasExtension = m::mock('Flyfinder\Specification\HasExtension');
39-
$this->isHidden = m::mock('Flyfinder\Specification\IsHidden');
38+
$this->hasExtension = m::mock(HasExtension::class);
39+
$this->isHidden = m::mock(IsHidden::class);
4040
$this->fixture = new OrSpecification($this->hasExtension, $this->isHidden);
4141
}
4242

0 commit comments

Comments
 (0)