Code Duplication    Length = 5-6 lines in 2 locations

src/Modules/Localize/Localize.php 2 locations

@@ 205-209 (lines=5) @@
202
        } else {
203
            $fileName = $this->getConfig()->resourceFileName . "." . $this->getConfig()->resourceFileType;
204
            $file = $folder . $fileName;
205
            if (is_file($file)) {
206
                $output = json_decode(file_get_contents($file), JSON_FORCE_OBJECT);
207
            } else {
208
                throw new \Tight\Exception\ModuleException("Resource file <strong>" . $file . "</strong> not found");
209
            }
210
        }
211
        return $output;
212
    }
@@ 237-242 (lines=6) @@
234
        $output = null;
235
        if ($this->resourceFileType === LocalizeConfig::FILETYPE_XML) {
236
            $file = \Tight\Utils::addTrailingSlash($this->getConfig()->resourceFolder) . $this->getConfig()->resourceFileName . "." . $this->resourceFileType;
237
            if (is_file($file)) {
238
                $xmlContent = file_get_contents($file);
239
                $output = new \SimpleXMLElement($xmlContent);
240
            } else {
241
                throw new \Tight\Exception\ModuleException("Resource file <strong>" . $file . "</strong> does not exists");
242
            }
243
        }
244
        return $output;
245
    }