Skip to content

Commit 997a796

Browse files
Reverting the adjustments to the getPathProcessor method
1 parent 7eca58e commit 997a796

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/Model/Behavior/UploadBehavior.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -197,24 +197,20 @@ public function afterDelete(EventInterface $event, EntityInterface $entity, Arra
197197
* for a given file upload
198198
*
199199
* @param \Cake\Datasource\EntityInterface $entity an entity
200-
* @param \Psr\Http\Message\UploadedFileInterface|string|null $data the data being submitted for a save or the filename
200+
* @param \Psr\Http\Message\UploadedFileInterface|string $data the data being submitted for a save or the filename
201201
* @param string $field the field for which data will be saved
202202
* @param array $settings the settings for the current field
203203
* @return \Josegonzalez\Upload\File\Path\ProcessorInterface
204204
*/
205205
public function getPathProcessor(
206206
EntityInterface $entity,
207-
string|UploadedFileInterface|null $data,
207+
string|UploadedFileInterface $data,
208208
string $field,
209-
array $settings,
209+
array $settings
210210
): ProcessorInterface {
211211
/** @var class-string<\Josegonzalez\Upload\File\Path\ProcessorInterface> $processorClass */
212212
$processorClass = Hash::get($settings, 'pathProcessor', DefaultProcessor::class);
213213

214-
if ($data === null) {
215-
$data = "";
216-
}
217-
218214
return new $processorClass($this->_table, $entity, $data, $field, $settings);
219215
}
220216

0 commit comments

Comments
 (0)