Conditions | 3 |
Paths | 3 |
Total Lines | 23 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
33 | public function sweep() |
||
34 | { |
||
35 | $line = explode("\n", file_get_contents($this->file)); |
||
|
|||
36 | $line = $line[$this->line] ?? ''; |
||
37 | if ($line) { |
||
38 | $terms = call_user_func_array( |
||
39 | 'array_merge', |
||
40 | array_map( |
||
41 | function ($u) { |
||
42 | return ["localize('{$u->term}')", 'localize("' . $u->term . '")']; |
||
43 | }, |
||
44 | $this->terms()->get()->all() |
||
45 | ) |
||
46 | ); |
||
47 | $matched = array_filter(array_map(function ($u) use ($line) { |
||
48 | return strpos($line, $u); |
||
49 | }, $terms), 'strlen'); |
||
50 | |||
51 | if (!empty($matched)) { |
||
52 | return; |
||
53 | } |
||
54 | } |
||
55 | $this->delete(); |
||
56 | } |
||
58 |
Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.