| Conditions | 5 |
| Paths | 5 |
| Total Lines | 27 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 38 | public function upgradeFromRepo() |
||
| 39 | { |
||
| 40 | $apiGames = GlobalApi::games(); |
||
| 41 | |||
| 42 | foreach ($apiGames as $gameData) { |
||
| 43 | $game = Game::find($gameData['code']) ?? new Game(); |
||
| 44 | |||
| 45 | $game->fill($gameData); |
||
|
|
|||
| 46 | |||
| 47 | if (!$game->save()) { |
||
| 48 | return false; |
||
| 49 | } |
||
| 50 | |||
| 51 | if (!empty($gameData['mods'])) { |
||
| 52 | foreach ($gameData['mods'] as $gameModData) { |
||
| 53 | $gameMod = GameMod::firstOrCreate([ |
||
| 54 | 'name' => $gameModData['name'], |
||
| 55 | 'game_code' => $gameData['code'], |
||
| 56 | ]); |
||
| 57 | |||
| 58 | $gameMod->fill($gameModData); |
||
| 59 | $gameMod->save(); |
||
| 60 | } |
||
| 61 | } |
||
| 62 | } |
||
| 63 | |||
| 64 | return true; |
||
| 65 | } |
||
| 67 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.