1414
1515namespace Flyfinder ;
1616
17+ use Flyfinder \Specification \SpecificationInterface ;
1718use Generator ;
1819use League \Flysystem \FilesystemInterface ;
1920use League \Flysystem \PluginInterface ;
20- use Flyfinder \Specification \SpecificationInterface ;
2121
2222/**
2323 * Flysystem plugin to add file finding capabilities to the filesystem entity.
@@ -31,21 +31,16 @@ class Finder implements PluginInterface
3131
3232 /**
3333 * Get the method name.
34- *
35- * @return string
3634 */
37- public function getMethod () : string
35+ public function getMethod (): string
3836 {
3937 return 'find ' ;
4038 }
4139
4240 /**
4341 * Set the Filesystem object.
44- *
45- * @param FilesystemInterface $filesystem
46- * @return void
4742 */
48- public function setFilesystem (FilesystemInterface $ filesystem )
43+ public function setFilesystem (FilesystemInterface $ filesystem ): void
4944 {
5045 $ this ->filesystem = $ filesystem ;
5146 }
@@ -55,11 +50,8 @@ public function setFilesystem(FilesystemInterface $filesystem)
5550 *
5651 * Note that only found *files* are yielded at this level,
5752 * which go back to the caller.
58- *
59- * @param SpecificationInterface $specification
60- * @return Generator
6153 */
62- public function handle (SpecificationInterface $ specification ) : Generator
54+ public function handle (SpecificationInterface $ specification ): Generator
6355 {
6456 foreach ($ this ->yieldFilesInPath ($ specification , '' ) as $ path ) {
6557 if (isset ($ path ['type ' ]) && $ path ['type ' ] === 'file ' ) {
@@ -75,19 +67,16 @@ public function handle(SpecificationInterface $specification) : Generator
7567 * since they have to be recursed into. Yielded directories
7668 * will not make their way back to the caller, as they are filtered out
7769 * by {@link handle()}.
78- *
79- * @param SpecificationInterface $specification
80- * @param string $path
81- * @return Generator
8270 */
83- private function yieldFilesInPath (SpecificationInterface $ specification , string $ path ) : Generator
71+ private function yieldFilesInPath (SpecificationInterface $ specification , string $ path ): Generator
8472 {
8573 $ listContents = $ this ->filesystem ->listContents ($ path );
8674 foreach ($ listContents as $ location ) {
8775 if ($ specification ->isSatisfiedBy ($ location )) {
8876 yield $ location ;
8977 }
90- if ($ location ['type ' ] == 'dir ' ) {
78+
79+ if ($ location ['type ' ] === 'dir ' ) {
9180 foreach ($ this ->yieldFilesInPath ($ specification , $ location ['path ' ]) as $ returnedLocation ) {
9281 yield $ returnedLocation ;
9382 }
0 commit comments