Skip to content

Commit 62391d0

Browse files
committed
Fix return type
1 parent 8325d70 commit 62391d0

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/Filesystem/Workspace.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function records() : array
7676
array_push($records, $fileinfo->getFilename());
7777
}
7878
}
79-
79+
8080
return $records;
8181
}
8282

@@ -147,6 +147,6 @@ private function isValidFilename(SplFileInfo $fileinfo) : bool
147147

148148
$pattern = '/^\d{' . DecisionRecord::NUMBER_LENGTH . '}-[a-z\-]+\\' . DecisionRecord::EXTENSION . '$/';
149149

150-
return false !== preg_match($pattern, $fileinfo->getFilename());
150+
return (boolean) preg_match($pattern, $fileinfo->getFilename());
151151
}
152152
}

tests/Filesystem/WorkspaceTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
use PHPUnit\Framework\TestCase;
66
use org\bovigo\vfs\vfsStream;
7-
use RuntimeException;
87
use ADR\Domain\DecisionRecord;
8+
use RuntimeException;
99

1010
class WorkspaceTest extends TestCase
1111
{
@@ -36,6 +36,8 @@ public function testCount()
3636

3737
$vfs->addChild(vfsStream::newFile('0001-foo.md'));
3838
$vfs->addChild(vfsStream::newFile('0002-bar.md'));
39+
$vfs->addChild(vfsStream::newFile('any-file.md'));
40+
$vfs->addChild(vfsStream::newDirectory('any-directory'));
3941

4042
$this->assertEquals(2, $workspace->count());
4143
}

0 commit comments

Comments
 (0)