Completed
Branch feature/currentUserRefactoring (c13c1d)
by Schlaefer
09:08
created

SmiliesSeed::run()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 94

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 94
rs 8.1309
c 0
b 0
f 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
use Migrations\AbstractSeed;
3
4
/**
5
 * Smilies seed.
6
 */
7
class SmiliesSeed extends AbstractSeed
8
{
9
    /**
10
     * Run Method.
11
     *
12
     * Write your database seeder using this method.
13
     *
14
     * More information on writing seeds is available here:
15
     * http://docs.phinx.org/en/latest/seeding.html
16
     *
17
     * @return void
18
     */
19
    public function run()
20
    {
21
        $data =
22
          [
23
            [
24
                'id' => 1,
25
                'sort' => 1,
26
                'icon' => 'happy',
27
            ],
28
            [
29
                'id' => 2,
30
                'sort' => 2,
31
                'icon' => 'grin',
32
            ],
33
            [
34
                'id' => 3,
35
                'sort' => 3,
36
                'icon' => 'wink',
37
            ],
38
            [
39
                'id' => 4,
40
                'sort' => 4,
41
                'icon' => 'saint',
42
            ],
43
            [
44
                'id' => 5,
45
                'sort' => 5,
46
                'icon' => 'squint',
47
            ],
48
            [
49
                'id' => 6,
50
                'sort' => 6,
51
                'icon' => 'sunglasses',
52
            ],
53
            [
54
                'id' => 7,
55
                'sort' => 7,
56
                'icon' => 'heart-empty-1',
57
            ],
58
            [
59
                'id' => 8,
60
                'sort' => 8,
61
                'icon' => 'thumbsup',
62
            ],
63
            [
64
                'id' => 9,
65
                'sort' => 9,
66
                'icon' => 'coffee',
67
            ],
68
            [
69
                'id' => 10,
70
                'sort' => 10,
71
                'icon' => 'tongue',
72
            ],
73
            [
74
                'id' => 11,
75
                'sort' => 11,
76
                'icon' => 'devil',
77
            ],
78
            [
79
                'id' => 12,
80
                'sort' => 12,
81
                'icon' => 'sleep',
82
            ],
83
            [
84
                'id' => 13,
85
                'sort' => 13,
86
                'icon' => 'surprised',
87
            ],
88
            [
89
                'id' => 14,
90
                'sort' => 14,
91
                'icon' => 'displeased',
92
            ],
93
            [
94
                'id' => 15,
95
                'sort' => 15,
96
                'icon' => 'unhappy',
97
            ],
98
            [
99
                'id' => 16,
100
                'sort' => 16,
101
                'icon' => 'cry',
102
            ],
103
            [
104
                'id' => 17,
105
                'sort' => 17,
106
                'icon' => 'angry',
107
            ]
108
          ];
109
110
        $table = $this->table('smilies');
111
        $table->insert($data)->save();
112
    }
113
}
114