Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
6 | function run() |
||
7 | { |
||
8 | $teams = \App\Lib\DsManager\Models\Orm\Team::all()->toArray(); |
||
9 | $halfTheTeams = count($teams) / 2; |
||
10 | $chunks = array_chunk($teams, $halfTheTeams); |
||
11 | $teamsSlice1 = $chunks[0]; |
||
12 | $teamsSlice2 = $chunks[1]; |
||
13 | for ($i = 0; $i < $halfTheTeams; $i++) { |
||
14 | \App\Lib\DsManager\Models\Orm\Match::create( |
||
15 | [ |
||
16 | 'home_team_id' => $teamsSlice1[$i]['id'], |
||
17 | 'away_team_id' => $teamsSlice2[$i]['id'] |
||
18 | ] |
||
19 | ); |
||
20 | } |
||
21 | } |
||
22 | } |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.