| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 51 | protected function createMedia() |
||
| 52 | { |
||
| 53 | if (($this->getFile() instanceof SymfonyFile) === false) { |
||
| 54 | throw new Exception(self::NO_FILE_DEFINED); |
||
| 55 | } |
||
| 56 | 5 | if (($this->subject instanceof HasMedia) === false) { |
|
| 57 | throw new Exception(self::NO_SUBJECT_DEFINED); |
||
| 58 | 5 | } |
|
| 59 | 5 | $media = new Media(); |
|
| 60 | $media->setModel($this->getSubject()); |
||
| 61 | |||
| 62 | 3 | return $media; |
|
| 63 | } |
||
| 81 |