Skip to content

Commit 60214e3

Browse files
author
Adam Tomat
committed
Fix PHP error
1 parent 2d33ac4 commit 60214e3

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/FileSystemDocumentProvider.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ class FileSystemDocumentProvider implements DocumentProvider
1414
protected $fileExtension;
1515
protected $documentParser;
1616

17-
public function __construct(array $paths, string $fileExtension, DocumentParser $parser = null)
17+
public function __construct(array $paths, string $fileExtension, ?DocumentParser $parser = null)
1818
{
1919
$this->paths = $paths;
2020
$this->fileExtension = $fileExtension;
2121
$this->documentParser = $parser;
2222
}
2323

24-
public function allDocumentIds() : array
24+
public function allDocumentIds(): array
2525
{
2626
if (empty($this->paths)) {
2727
return [];
@@ -43,7 +43,7 @@ public function allDocumentIds() : array
4343
})->values()->toArray();
4444
}
4545

46-
public function getDocument(string $id) : Document
46+
public function getDocument(string $id): Document
4747
{
4848
if (empty($this->paths)) {
4949
throw new DocumentNotFoundException;
@@ -67,15 +67,15 @@ public function getDocument(string $id) : Document
6767
return $this->documentParser ? $this->documentParser->parse($doc) : $doc;
6868
}
6969

70-
protected function getFolderPathFromId(string $id) : string
70+
protected function getFolderPathFromId(string $id): string
7171
{
7272
$parts = explode('/', $id);
7373
array_pop($parts);
7474

7575
return $this->convertIdToPathRegex(implode('/', $parts));
7676
}
7777

78-
protected function convertIdToPathRegex(string $id) : string
78+
protected function convertIdToPathRegex(string $id): string
7979
{
8080
$parts = array_map(function ($part) {
8181
return '([0-9]+\-)?' . str_replace('-', '\-', $part);

src/FileSystemPatternProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class FileSystemPatternProvider implements PatternProvider, TemplateProvider
1818

1919
protected $patternPaths = [];
2020

21-
public function __construct(array $paths, $fileExtension, DataParser $dataParser = null)
21+
public function __construct(array $paths, $fileExtension, ?DataParser $dataParser = null)
2222
{
2323
$this->paths = $paths;
2424
$this->fileExtension = $fileExtension;

0 commit comments

Comments
 (0)