[5.x] Fix Filesystem AbstractAdapter put method return #11032
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I learned about this the hard way. I spent over an hour trying to figure out why a custom media importer I had built was failing on the step only to find out
$assetContainer->disk()->put()
returns null instead of the normal true/false on success/fail.Example of what I am trying to solve:
You'd expect if the file is created
$success
would be true, but it is not. It is null.This is true of all other methods in the AbstractAdapter so I believe this being left out is just a typo/bug.
One could make an argument this should target 6.x since it changes a return type, but since null was always being returned there should be no logic dependent upon it.