Code Duplication    Length = 13-14 lines in 2 locations

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

@@ 95-108 (lines=14) @@
92
    /**
93
     * {@inheritDoc}
94
     */
95
    protected function readFile(/*# string */ $realPath)
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
    }
109
110
    /**
111
     * {@inheritDoc}

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

@@ 122-134 (lines=13) @@
119
     * @return bool
120
     * @access protected
121
     */
122
    protected function removeDir(
123
        /*# string */ $realPath,
124
        /*# bool */ $keep = false
125
    )/*# : bool */ {
126
        if ($keep || @rmdir($realPath)) {
127
            return true;
128
        } else {
129
            return $this->setError(
130
                Message::get(Message::STR_DELETE_FAIL, $realPath),
131
                Message::STR_DELETE_FAIL
132
            );
133
        }
134
    }
135
136
    /**
137
     * {@inheritDoc}