Code Duplication    Length = 7-8 lines in 3 locations

micro/auth/DbAcl.php 3 locations

@@ 37-43 (lines=7) @@
34
        parent::__construct($params);
35
36
        $tables = $this->container->db->listTables();
37
        if (empty($tables['acl_role'])) {
38
            $this->container->db->createTable('acl_role', [
39
                '`id` int(10) unsigned NOT NULL AUTO_INCREMENT',
40
                '`name` varchar(255) NOT NULL',
41
                'PRIMARY KEY (`id`)'
42
            ], 'ENGINE=MyISAM DEFAULT CHARSET=utf8');
43
        }
44
        if (empty($tables['acl_perm'])) {
45
            $this->container->db->createTable('acl_perm', [
46
                '`id` int(10) unsigned NOT NULL AUTO_INCREMENT',
@@ 44-50 (lines=7) @@
41
                'PRIMARY KEY (`id`)'
42
            ], 'ENGINE=MyISAM DEFAULT CHARSET=utf8');
43
        }
44
        if (empty($tables['acl_perm'])) {
45
            $this->container->db->createTable('acl_perm', [
46
                '`id` int(10) unsigned NOT NULL AUTO_INCREMENT',
47
                '`name` varchar(255) NOT NULL',
48
                'PRIMARY KEY (`id`)'
49
            ], 'ENGINE=MyISAM DEFAULT CHARSET=utf8');
50
        }
51
        if (empty($tables['acl_role_perm'])) {
52
            $this->container->db->createTable('acl_role_perm', [
53
                '`id` int(10) unsigned NOT NULL AUTO_INCREMENT',
@@ 51-58 (lines=8) @@
48
                'PRIMARY KEY (`id`)'
49
            ], 'ENGINE=MyISAM DEFAULT CHARSET=utf8');
50
        }
51
        if (empty($tables['acl_role_perm'])) {
52
            $this->container->db->createTable('acl_role_perm', [
53
                '`id` int(10) unsigned NOT NULL AUTO_INCREMENT',
54
                '`role` int(11) unsigned DEFAULT NOT NULL',
55
                '`perm` int(11) unsigned DEFAULT NOT NULL',
56
                'PRIMARY KEY (`id`)'
57
            ], 'ENGINE=MyISAM DEFAULT CHARSET=utf8');
58
        }
59
    }
60
61
    /**