| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2.0078 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 32 | 1 | public function storeImage(string $key = 'image'): ?string |
|
| 33 | { |
||
| 34 | 1 | if (!$this->hasFile($key)) { |
|
| 35 | return null; |
||
| 36 | } |
||
| 37 | |||
| 38 | 1 | $file = $this->file($key); |
|
| 39 | |||
| 40 | 1 | $file->storeAs( |
|
| 41 | 1 | Denomination::IMAGE_PATH, |
|
| 42 | 1 | $filename = ($this->input('value') . '.' . $file->getClientOriginalExtension()) |
|
| 43 | ); |
||
| 44 | |||
| 45 | 1 | return $filename; |
|
| 46 | } |
||
| 48 |