| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 41 | public function upload(Module $module) |
||
| 42 | { |
||
| 43 | $randPrefix = mt_rand(1, 9999); |
||
| 44 | $module->getModuleImage()->move( |
||
|
|
|||
| 45 | $this->getUploadRootDir(), |
||
| 46 | $randPrefix . '-' . $module->getModuleImage()->getClientOriginalName() |
||
| 47 | ); |
||
| 48 | $module->setPathImage($this->getUploadDir() . '/' . $randPrefix . '-' . $module->getModuleImage()->getClientOriginalName()); |
||
| 49 | $module->setNameImage($randPrefix . '-' . $module->getModuleImage()->getClientOriginalName()); |
||
| 50 | $module->setModuleImage(null); |
||
| 51 | |||
| 52 | return; |
||
| 53 | } |
||
| 54 | } |
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.