Code Duplication    Length = 17-19 lines in 2 locations

src/Eccube/Repository/BlockRepository.php 1 location

@@ 193-209 (lines=17) @@
190
     *
191
     * @return array
192
     */
193
    public function getReadTemplateFile($fileName, $isUser = false)
194
    {
195
        $readPaths = array(
196
            $this->appConfig['block_realdir'],
197
            $this->appConfig['block_default_realdir'],
198
        );
199
        foreach ($readPaths as $readPath) {
200
            $filePath = $readPath . '/' . $fileName . '.twig';
201
            $fs = new Filesystem();
202
            if ($fs->exists($filePath)) {
203
                return array(
204
                    'file_name' => $fileName,
205
                    'tpl_data' => file_get_contents($filePath),
206
                );
207
            }
208
        }
209
    }
210
}
211

src/Eccube/Repository/MailTemplateRepository.php 1 location

@@ 89-107 (lines=19) @@
86
     *
87
     * @return array
88
     */
89
    public function getReadTemplateFile($fileName)
90
    {
91
        
92
        $readPaths = array(
93
            $this->appConfig['template_realdir'],
94
            $this->appConfig['template_default_realdir'],
95
        );
96
    
97
        foreach ($readPaths as $readPath) {
98
            $filePath = $readPath . '/' . $fileName;
99
            $fs = new Filesystem();
100
            if ($fs->exists($filePath)) {
101
                return array(
102
                    'file_name' => $fileName,
103
                    'tpl_data' => file_get_contents($filePath),
104
                );
105
            }
106
        }
107
    }
108
}
109