@@ -51,8 +51,12 @@ public function initialize(ProcessState $state): void
5151 // Configure options
5252 parent ::initialize ($ state );
5353
54- $ this ->sourceFS = $ this ->storages ->get ($ this ->getOption ($ state , 'source_filesystem ' ));
55- $ this ->destinationFS = $ this ->storages ->get ($ this ->getOption ($ state , 'destination_filesystem ' ));
54+ /** @var string $sourceFilesystemOption */
55+ $ sourceFilesystemOption = $ this ->getOption ($ state , 'source_filesystem ' );
56+ $ this ->sourceFS = $ this ->storages ->get ($ sourceFilesystemOption );
57+ /** @var string $destinationFilesystemOption */
58+ $ destinationFilesystemOption = $ this ->getOption ($ state , 'destination_filesystem ' );
59+ $ this ->destinationFS = $ this ->storages ->get ($ destinationFilesystemOption );
5660 }
5761
5862 /**
@@ -71,7 +75,9 @@ public function execute(ProcessState $state): void
7175 return ;
7276 }
7377
74- $ this ->doFileCopy ($ state , $ file , $ this ->getOption ($ state , 'remove_source ' ));
78+ /** @var bool $removeSourceOption */
79+ $ removeSourceOption = $ this ->getOption ($ state , 'remove_source ' );
80+ $ this ->doFileCopy ($ state , $ file , $ removeSourceOption );
7581 $ state ->setOutput ($ file );
7682 }
7783
@@ -94,16 +100,19 @@ public function next(ProcessState $state): bool
94100 */
95101 protected function findMatchingFiles (ProcessState $ state ): void
96102 {
103+ /** @var ?string $filePattern */
97104 $ filePattern = $ this ->getOption ($ state , 'file_pattern ' );
98105 if ($ filePattern ) {
99106 foreach ($ this ->sourceFS ->listContents ('/ ' ) as $ file ) {
100- if ('file ' === $ file ['type ' ]
101- && preg_match ($ filePattern , (string ) $ file ['path ' ])
102- && !\in_array ($ file ['path ' ], $ this ->matchingFiles , true )) {
103- $ this ->matchingFiles [] = $ file ['path ' ];
107+ if ('file ' === $ file ->type ()
108+ && preg_match ($ filePattern , $ file ->path ())
109+ && !\in_array ($ file ->path (), $ this ->matchingFiles , true )
110+ ) {
111+ $ this ->matchingFiles [] = $ file ->path ();
104112 }
105113 }
106114 } else {
115+ /** @var array<string>|string|null $input */
107116 $ input = $ state ->getInput ();
108117 if (!$ input ) {
109118 throw new \UnexpectedValueException ('No pattern neither input provided for the Task ' );
0 commit comments