Code Duplication    Length = 7-8 lines in 2 locations

src/base/Cache.php 1 location

@@ 50-57 (lines=8) @@
47
     * @param string $path
48
     * @throws ConfigException
49
     */
50
    private function saveTextToFile($data, $path)
51
    {
52
        GeneratorHelper::createDir(dirname($path));
53
        if (false === file_put_contents($path, $data)) {
54
            throw new ConfigException(_('No se tienen los permisos suficientes para escribir en el fichero ')
55
                . $path);
56
        }
57
    }
58
59
    /**
60
     * Método que extrae el texto de un fichero

src/base/extension/AssetsParser.php 1 location

@@ 179-185 (lines=7) @@
176
     * @param string $content
177
     * @throws ConfigException
178
     */
179
    private function storeContents($path, $content = "")
180
    {
181
        GeneratorHelper::createDir(dirname($path));
182
        if ("" !== $content && false === file_put_contents($path, $content)) {
183
            throw new ConfigException(_('No se tienen permisos para escribir en ' . $path));
184
        }
185
    }
186
187
    /**
188
     * Método que imprime el resultado de la generación de los assets