Skip to content

Commit

Permalink
minor #6343 Remove an unneeded comparison in FileUploadType (javiereg…
Browse files Browse the repository at this point in the history
…uiluz)

This PR was merged into the 4.x branch.

Discussion
----------

Remove an unneeded comparison in FileUploadType

This fixes:

```
Error: Strict comparison using !== between '' and non-falsy-string will always evaluate to true.
 ------ ------------------------------------------------------------------
  Line   Form/Type/FileUploadType.php
 ------ ------------------------------------------------------------------
  [15](https://github.com/EasyCorp/EasyAdminBundle/actions/runs/9535095150/job/26280406642?pr=6328#step:5:16)1    Strict comparison using !== between '' and non-falsy-string will
         always evaluate to true.
 ------ ------------------------------------------------------------------
```

Commits
-------

ea71c30 Remove an unneeded comparison in FileUploadType
  • Loading branch information
javiereguiluz committed Jun 27, 2024
2 parents 416b4a2 + ea71c30 commit 0f5050a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Form/Type/FileUploadType.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public function configureOptions(OptionsResolver $resolver): void
$value = $this->projectDir.'/'.$value;
}

if (!$isStreamWrapper && '' !== $value && (!is_dir($value) || !is_writable($value))) {
if (!$isStreamWrapper && (!is_dir($value) || !is_writable($value))) {
throw new InvalidArgumentException(sprintf('Invalid upload directory "%s" it does not exist or is not writable.', $value));
}

Expand Down

0 comments on commit 0f5050a

Please sign in to comment.