Code Duplication    Length = 17-17 lines in 2 locations

src/Mouf/Database/TDBM/Controllers/TdbmController.php 1 location

@@ 62-78 (lines=17) @@
59
            $this->composerFile = $this->moufManager->getVariable('tdbmDefaultComposerFile');
60
        }
61
62
        if ($this->daoNamespace == null && $this->beanNamespace == null) {
63
            $classNameMapper = ClassNameMapper::createFromComposerFile(__DIR__.'/../../../../../../../../composer.json');
64
65
            $autoloadNamespaces = $classNameMapper->getManagedNamespaces();
66
            if ($autoloadNamespaces) {
67
                $this->autoloadDetected = true;
68
                $rootNamespace = $autoloadNamespaces[0];
69
                $this->daoNamespace = $rootNamespace.'Dao';
70
                $this->beanNamespace = $rootNamespace.'Dao\\Bean';
71
            } else {
72
                $this->autoloadDetected = false;
73
                $this->daoNamespace = 'YourApplication\\Dao';
74
                $this->beanNamespace = 'YourApplication\\Dao\\Bean';
75
            }
76
        } else {
77
            $this->autoloadDetected = true;
78
        }
79
80
        $this->content->addFile(__DIR__.'/../../../../views/tdbmGenerate.php', $this);
81
        $this->template->toHtml();

src/Mouf/Database/TDBM/Controllers/TdbmInstallController.php 1 location

@@ 111-127 (lines=17) @@
108
        $this->daoNamespace = $this->moufManager->getVariable('tdbmDefaultDaoNamespace_tdbmService');
109
        $this->beanNamespace = $this->moufManager->getVariable('tdbmDefaultBeanNamespace_tdbmService');
110
111
        if ($this->daoNamespace == null && $this->beanNamespace == null) {
112
            $classNameMapper = ClassNameMapper::createFromComposerFile(__DIR__.'/../../../../../../../../composer.json');
113
114
            $autoloadNamespaces = $classNameMapper->getManagedNamespaces();
115
            if ($autoloadNamespaces) {
116
                $this->autoloadDetected = true;
117
                $rootNamespace = $autoloadNamespaces[0];
118
                $this->daoNamespace = $rootNamespace.'Model\\Dao';
119
                $this->beanNamespace = $rootNamespace.'Model\\Bean';
120
            } else {
121
                $this->autoloadDetected = false;
122
                $this->daoNamespace = 'YourApplication\\Model\\Dao';
123
                $this->beanNamespace = 'YourApplication\\Model\\Bean';
124
            }
125
        } else {
126
            $this->autoloadDetected = true;
127
        }
128
        $this->defaultPath = true;
129
        $this->storePath = '';
130