Code Duplication    Length = 11-13 lines in 2 locations

src/Eccube/Command/InstallerCommand.php 1 location

@@ 210-220 (lines=11) @@
207
            throw new \LogicException(sprintf('Database Url %s is invalid.', $databaseUrl));
208
        }
209
        $platform = $conn->getDatabasePlatform()->getName();
210
        switch ($platform) {
211
            case 'sqlite':
212
                $sql = 'SELECT sqlite_version() AS server_version';
213
                break;
214
            case 'mysql':
215
                $sql = 'SELECT version() AS server_version';
216
                break;
217
            case 'postgresql':
218
            default:
219
                $sql = 'SHOW server_version';
220
        }
221
        $stmt = $conn->executeQuery($sql);
222
        $version = $stmt->fetchColumn();
223

src/Eccube/Controller/Install/InstallController.php 1 location

@@ 1011-1023 (lines=13) @@
1008
        $rsm->addScalarResult('server_version', 'server_version');
1009
1010
        $platform = $em->getConnection()->getDatabasePlatform()->getName();
1011
        switch ($platform) {
1012
            case 'sqlite':
1013
                $sql = 'SELECT sqlite_version() AS server_version';
1014
                break;
1015
1016
            case 'mysql':
1017
                $sql = 'SELECT version() AS server_version';
1018
                break;
1019
1020
            case 'postgresql':
1021
            default:
1022
                $sql = 'SHOW server_version';
1023
        }
1024
1025
        $version = $em->createNativeQuery($sql, $rsm)
1026
            ->getSingleScalarResult();