KnpLabs / Gaufrette

PHP library that provides a filesystem abstraction layer − will be a feast for your files!

Home Page:http://knplabs.github.io/Gaufrette

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE.

gregsparrow opened this issue · comments

if (!@file_put_contents($path, $content)) {

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;

Thank you for pointing this out @gregsparrow 👍
Fixed in #561 .