Code Duplication    Length = 7-7 lines in 2 locations

src/Phossa2/Storage/Driver/LocalDriver.php 1 location

@@ 99-105 (lines=7) @@
96
    {
97
        $str = file_get_contents($realPath);
98
99
        if (false === $str) {
100
            $this->setError(
101
                Message::get(Message::STR_OPENSTREAM_FAIL, $realPath),
102
                Message::STR_OPENSTREAM_FAIL
103
            );
104
            return null;
105
        }
106
107
        return $str;
108
    }

src/Phossa2/Storage/Traits/LocalDirTrait.php 1 location

@@ 125-131 (lines=7) @@
122
            @mkdir($realPath, 0755, true);
123
            umask($umask);
124
125
            if (!is_dir($realPath)) {
126
                $this->setError(
127
                    Message::get(Message::STR_MKDIR_FAIL, $realPath),
128
                    Message::STR_MKDIR_FAIL
129
                );
130
                return false;
131
            }
132
        }
133
        return true;
134
    }