| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 47 | public function useCaseUpdate($obj) |
||
| 48 | { |
||
| 49 | //Update l'avancement de la usecase lors de changements sur une usecase |
||
| 50 | $avancementTotal = 0; |
||
| 51 | $usecase = Usecase::findFirst("code='" . $obj->getCodeUseCase() . "'"); |
||
| 52 | $taches = Tache::find("codeUseCase LIKE '" . $obj->getCodeUseCase() . "'"); |
||
| 53 | foreach ($taches as $tache) { |
||
| 54 | $avancementTotal += $tache->getAvancement(); |
||
| 55 | } |
||
| 56 | $avancementTotal = $avancementTotal / count($taches); |
||
| 57 | $usecase->setAvancement($avancementTotal); |
||
| 58 | $usecase->save(); |
||
| 59 | } |
||
| 60 | } |
||
| 62 |
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.