| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | public function addImage(UploadedFile $imageFile, $processing_style_routine = NULL, $filename = NULL) |
||
| 24 | { |
||
| 25 | $this->hasImage() |
||
| 26 | ? $attacherImage = $this->getImage() |
||
| 27 | : $attacherImage = $this->createAttacherImageModel(); |
||
| 28 | |||
| 29 | $attacherImage->setAttributesFromFile($imageFile, $filename); |
||
| 30 | $attacherImage->setProcessingStyleRoutine($processing_style_routine); |
||
| 31 | |||
| 32 | return $this->image()->save($attacherImage); |
||
| 33 | } |
||
| 34 | |||
| 76 | } |
This check looks for methods that are used by a trait but not required by it.
To illustrate, let’s look at the following code example
The trait
Idableprovides a methodequalsIdthat in turn relies on the methodgetId(). If this method does not exist on a class mixing in this trait, the method will fail.Adding the
getId()as an abstract method to the trait will make sure it is available.