Conditions | 2 |
Paths | 2 |
Total Lines | 108 |
Code Lines | 78 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
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:
If many parameters/temporary variables are present:
1 | <?php |
||
11 | public function run(): void |
||
12 | { |
||
13 | //Action when run the seed |
||
14 | |||
15 | $data = [ |
||
16 | 0 => [ |
||
17 | 'permission_id' => 1, |
||
18 | 'role_id' => 1, |
||
19 | ], |
||
20 | 1 => [ |
||
21 | 'permission_id' => 2, |
||
22 | 'role_id' => 1, |
||
23 | ], |
||
24 | 2 => [ |
||
25 | 'permission_id' => 3, |
||
26 | 'role_id' => 1, |
||
27 | ], |
||
28 | 3 => [ |
||
29 | 'permission_id' => 4, |
||
30 | 'role_id' => 1, |
||
31 | ], |
||
32 | 4 => [ |
||
33 | 'permission_id' => 5, |
||
34 | 'role_id' => 1, |
||
35 | ], |
||
36 | 5 => [ |
||
37 | 'permission_id' => 6, |
||
38 | 'role_id' => 1, |
||
39 | ], |
||
40 | 6 => [ |
||
41 | 'permission_id' => 7, |
||
42 | 'role_id' => 1, |
||
43 | ], |
||
44 | 7 => [ |
||
45 | 'permission_id' => 8, |
||
46 | 'role_id' => 1, |
||
47 | ], |
||
48 | 8 => [ |
||
49 | 'permission_id' => 9, |
||
50 | 'role_id' => 1, |
||
51 | ], |
||
52 | 9 => [ |
||
53 | 'permission_id' => 10, |
||
54 | 'role_id' => 1, |
||
55 | ], |
||
56 | 10 => [ |
||
57 | 'permission_id' => 11, |
||
58 | 'role_id' => 1, |
||
59 | ], |
||
60 | 11 => [ |
||
61 | 'permission_id' => 12, |
||
62 | 'role_id' => 1, |
||
63 | ], |
||
64 | 12 => [ |
||
65 | 'permission_id' => 13, |
||
66 | 'role_id' => 1, |
||
67 | ], |
||
68 | 13 => [ |
||
69 | 'permission_id' => 14, |
||
70 | 'role_id' => 1, |
||
71 | ], |
||
72 | 14 => [ |
||
73 | 'permission_id' => 15, |
||
74 | 'role_id' => 1, |
||
75 | ], |
||
76 | 15 => [ |
||
77 | 'permission_id' => 16, |
||
78 | 'role_id' => 1, |
||
79 | ], |
||
80 | 16 => [ |
||
81 | 'permission_id' => 17, |
||
82 | 'role_id' => 1, |
||
83 | ], |
||
84 | 17 => [ |
||
85 | 'permission_id' => 18, |
||
86 | 'role_id' => 1, |
||
87 | ], |
||
88 | 18 => [ |
||
89 | 'permission_id' => 19, |
||
90 | 'role_id' => 1, |
||
91 | ], |
||
92 | 19 => [ |
||
93 | 'permission_id' => 20, |
||
94 | 'role_id' => 1, |
||
95 | ], |
||
96 | 20 => [ |
||
97 | 'permission_id' => 21, |
||
98 | 'role_id' => 1, |
||
99 | ], |
||
100 | 21 => [ |
||
101 | 'permission_id' => 22, |
||
102 | 'role_id' => 1, |
||
103 | ], |
||
104 | 22 => [ |
||
105 | 'permission_id' => 23, |
||
106 | 'role_id' => 1, |
||
107 | ], |
||
108 | 23 => [ |
||
109 | 'permission_id' => 24, |
||
110 | 'role_id' => 1, |
||
111 | ], |
||
112 | 24 => [ |
||
113 | 'permission_id' => 25, |
||
114 | 'role_id' => 1, |
||
115 | ], |
||
116 | ]; |
||
117 | foreach ($data as $row) { |
||
118 | $this->insert($row)->into('permissions_roles'); |
||
119 | } |
||
122 | } |