@@ -193,6 +193,9 @@ public function saveFileUpload(UploadedFile $uploaded_file, array $settings): Fi
193193 switch ($ uploaded_file ->getError ()) {
194194 case UPLOAD_ERR_INI_SIZE :
195195 case UPLOAD_ERR_FORM_SIZE :
196+ // @todo Drupal 9 compatibility, needs to be converted to ByteSizeMarkup
197+ // later.
198+ // @phpstan-ignore-next-line
196199 $ maxUploadSize = format_size ($ this ->getMaxUploadSize ($ settings ));
197200 $ response ->addViolation ($ this ->t ('The file @file could not be saved because it exceeds @maxsize, the maximum allowed size for uploads. ' , [
198201 '@file ' => $ uploaded_file ->getClientOriginalName (),
@@ -268,6 +271,9 @@ public function saveFileUpload(UploadedFile $uploaded_file, array $settings): Fi
268271 $ file ->setSize (@filesize ($ temp_file_path ));
269272
270273 // Validate against file_validate() first with the temporary path.
274+ // @todo Drupal 9 compatibility, needs to be converted to file validate
275+ // service later.
276+ // @phpstan-ignore-next-line
271277 $ errors = file_validate ($ file , $ validators );
272278 $ maxResolution = $ settings ['max_resolution ' ] ?? 0 ;
273279 $ minResolution = $ settings ['min_resolution ' ] ?? 0 ;
@@ -499,6 +505,9 @@ protected function prepareFilename(string $filename, array &$validators): string
499505 /** @var \Drupal\file\FileInterface $file */
500506 $ file = $ this ->fileStorage ->create ([]);
501507 $ file ->setFilename ($ filename );
508+ // @todo Drupal 9 compatibility, needs to be converted to file
509+ // validator service later.
510+ // @phpstan-ignore-next-line
502511 $ passes_validation = empty (file_validate_extensions ($ file , $ validators ['file_validate_extensions ' ][0 ]));
503512 }
504513 if (empty ($ validators ['file_validate_extensions ' ][0 ]) || $ passes_validation ) {
0 commit comments