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

@@ 136-142 (lines=7) @@
133
            @mkdir($realPath, 0755, true);
134
            umask($umask);
135
136
            if (!is_dir($realPath)) {
137
                $this->setError(
138
                    Message::get(Message::STR_MKDIR_FAIL, $realPath),
139
                    Message::STR_MKDIR_FAIL
140
                );
141
                return false;
142
            }
143
        }
144
        return true;
145
    }