@@ -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 );
0 commit comments