@@ -51,8 +51,12 @@ public function initialize(ProcessState $state): void
51
51
// Configure options
52
52
parent ::initialize ($ state );
53
53
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 );
56
60
}
57
61
58
62
/**
@@ -71,7 +75,9 @@ public function execute(ProcessState $state): void
71
75
return ;
72
76
}
73
77
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 );
75
81
$ state ->setOutput ($ file );
76
82
}
77
83
@@ -94,16 +100,19 @@ public function next(ProcessState $state): bool
94
100
*/
95
101
protected function findMatchingFiles (ProcessState $ state ): void
96
102
{
103
+ /** @var ?string $filePattern */
97
104
$ filePattern = $ this ->getOption ($ state , 'file_pattern ' );
98
105
if ($ filePattern ) {
99
106
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 ();
104
112
}
105
113
}
106
114
} else {
115
+ /** @var array<string>|string|null $input */
107
116
$ input = $ state ->getInput ();
108
117
if (!$ input ) {
109
118
throw new \UnexpectedValueException ('No pattern neither input provided for the Task ' );
0 commit comments