| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 1.0109 |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | 2 | protected function getWatermark($image) |
|
| 18 | { |
||
| 19 | 2 | $storagePath = Storage::disk('local')->getDriver()->getAdapter()->getPathPrefix(); |
|
| 20 | 2 | $watermarkPath = $storagePath . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'watermark.png'; |
|
| 21 | 2 | $watermark = Image::make($watermarkPath); |
|
| 22 | |||
| 23 | 2 | $watermark->resize($image->getWidth() / 2.5, null, function ($constraint) { |
|
| 24 | $constraint->aspectRatio(); |
||
| 25 | $constraint->upsize(); |
||
| 26 | 2 | }); |
|
| 27 | |||
| 28 | 2 | return $watermark; |
|
| 29 | } |
||
| 31 |