PushPermissions::up()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 23
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 13
nc 1
nop 0
dl 0
loc 23
rs 9.8333
c 0
b 0
f 0
1
<?php
2
3
use Phinx\Migration\AbstractMigration;
0 ignored issues
show
Bug introduced by
The type Phinx\Migration\AbstractMigration was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
4
5
class PushPermissions extends AbstractMigration
6
{
7
    /**
8
     * Migrate Up.
9
     */
10
    public function up()
11
    {
12
        $data = [
13
            [
14
                'roleId' => 2,
15
                'module' => 'push',
16
                'privilege' => 'Management'
17
            ],
18
            [
19
                'roleId' => 2,
20
                'module' => 'push',
21
                'privilege' => 'Subscribe'
22
            ],
23
            [
24
                'roleId' => 3,
25
                'module' => 'push',
26
                'privilege' => 'Subscribe'
27
            ],
28
        ];
29
30
        $privileges = $this->table('acl_privileges');
31
        $privileges->insert($data)
32
            ->save();
33
    }
34
35
    /**
36
     * Migrate Down.
37
     */
38
    public function down()
39
    {
40
        $this->execute('DELETE FROM acl_privileges WHERE module = "push"');
41
    }
42
}
43