| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 5 | ||
| Bugs | 1 | Features | 3 |
| 1 | <?php |
||
| 18 | public function load(V2Location $location) { |
||
| 19 | if (!($unitRows = DBStaticUnit::getUnitListByV2Location($location))) { |
||
| 20 | return; |
||
| 21 | } |
||
| 22 | |||
| 23 | $model = \classSupernova::$gc->unitModel; |
||
| 24 | foreach ($unitRows as $dbId => $unitRow) { |
||
| 25 | $unit = $model->fromArray($unitRow); |
||
|
|
|||
| 26 | $this->attach($unit, intval($unit->snId)); |
||
| 27 | } |
||
| 28 | } |
||
| 29 | |||
| 46 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: