Install   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 1
c 3
b 0
f 0
lcom 0
cbo 4
dl 0
loc 27
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A install() 0 16 1
1
<?php
2
3
namespace kujaff\VersionsBundle\Service\Install;
4
5
use kujaff\VersionsBundle\Model\Install as BaseInstall;
6
use kujaff\VersionsBundle\Entity\Version;
7
use kujaff\VersionsBundle\Model\DoctrineHelper;
8
use kujaff\VersionsBundle\Model\BundleNameFromClassName;
9
use Symfony\Component\DependencyInjection\ContainerAware;
10
11
class Install extends ContainerAware implements BaseInstall
0 ignored issues
show
Deprecated Code introduced by
The class Symfony\Component\Depend...njection\ContainerAware has been deprecated with message: since version 2.8, to be removed in 3.0. Use the ContainerAwareTrait instead.

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
12
{
13
    use DoctrineHelper;
14
    use BundleNameFromClassName;
15
16
    /**
17
     * Install in 1.0.0
18
     *
19
     * @return Version
20
     */
21
    public function install()
0 ignored issues
show
Coding Style Best Practice introduced by
Please use __construct() instead of a PHP4-style constructor that is named after the class.
Loading history...
22
    {
23
        $this->dropTables(array('versions_bundles'));
24
        $this->executeSQL('
25
            CREATE TABLE `versions_bundles` (
26
                `id` int(11) NOT NULL AUTO_INCREMENT,
27
                `name` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
28
                `installationDate` datetime NOT NULL,
29
                `installedVersion` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
30
                `updateDate` datetime DEFAULT NULL,
31
                PRIMARY KEY (`id`)
32
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
33
        ');
34
35
        return new Version('1.0.0');
36
    }
37
}
38