Code Duplication    Length = 12-16 lines in 2 locations

api/midgard/storage.php 1 location

@@ 78-89 (lines=12) @@
75
        return true;
76
    }
77
78
    private static function generate_proxyfile(ClassMetadata $cm)
79
    {
80
        $em = connection::get_em();
81
        $generator = new ProxyGenerator($em->getConfiguration()->getProxyDir(), $em->getConfiguration()->getProxyNamespace());
82
        $generator->setPlaceholder('baseProxyInterface', 'Doctrine\ORM\Proxy\Proxy');
83
        $filename = $generator->getProxyFileName($cm->getName());
84
        if (file_exists($filename)) {
85
            unlink($filename);
86
        }
87
        $generator->generateProxyClass($cm, $filename);
88
    }
89
90
    private static function get_cm($em, $classname)
91
    {
92
        if (!class_exists($classname)) {

src/command/schema.php 1 location

@@ 114-129 (lines=16) @@
111
        $output->writeln('Done');
112
    }
113
114
    private function generate_proxyfiles(array $cms)
115
    {
116
        $em = connection::get_em();
117
        $generator = new ProxyGenerator($em->getConfiguration()->getProxyDir(), $em->getConfiguration()->getProxyNamespace());
118
        $generator->setPlaceholder('baseProxyInterface', 'Doctrine\ORM\Proxy\Proxy');
119
120
        foreach ($cms as $cm) {
121
            $filename = $generator->getProxyFileName($cm->getName());
122
            if (file_exists($filename)) {
123
                unlink($filename);
124
            }
125
            $generator->generateProxyClass($cm, $filename);
126
        }
127
    }
128
129
    private function process_updates(array $to_update, OutputInterface $output, $force)
130
    {
131
        $em = connection::get_em();
132
        $conn = $em->getConnection();