Conditions | 4 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | 5 | public function filter(array $tables, array $excludes): array |
|
14 | { |
||
15 | 5 | return array_values(array_filter( |
|
16 | 5 | $tables, |
|
17 | 5 | function (string $table) use ($excludes) { |
|
18 | 5 | foreach ($excludes as $regex) { |
|
19 | 5 | $regex = mb_substr($regex, 0, 1) === '/' ? $regex : sprintf('/^%s$/', $regex); |
|
20 | 5 | if (preg_match($regex, $table)) { |
|
21 | 5 | return false; |
|
22 | } |
||
23 | } |
||
24 | 5 | return true; |
|
25 | 5 | } |
|
29 |