Conditions | 1 |
Paths | 1 |
Total Lines | 7 |
Code Lines | 4 |
Lines | 7 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
21 | View Code Duplication | public function createDatabase() |
|
22 | { |
||
23 | $database = preg_replace('~^/~', '', $this->getDbDriver()->getUri()->getPath()); |
||
24 | |||
25 | $this->getDbDriver()->execute("CREATE SCHEMA IF NOT EXISTS `$database` DEFAULT CHARACTER SET utf8 ;"); |
||
26 | $this->getDbDriver()->execute("USE `$database`"); |
||
27 | } |
||
28 | |||
47 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.