This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE.
gregsparrow opened this issue · comments
Aleksandr Kalugin commented
Gaufrette/src/Gaufrette/Adapter/Local.php
Line 64 in 0cf2aeb
This function returns the number of bytes that were written to the file, or FALSE on failure.
This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE. Use the === operator for testing the return value of this function.
$writedBytes = @file_put_contents($path, $content);
if ($writedBytes === FALSE) {
throw StorageFailure::unexpectedFailure('write', ['key' => $key]);
}
return $writedBytes;
Nicolas MURE commented
Thank you for pointing this out @gregsparrow 👍
Fixed in #561 .