| Conditions | 4 |
| Paths | 4 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | public function run(string $path): array |
||
| 28 | { |
||
| 29 | Storage::disk($this->data->disk)->makeDirectory($path); |
||
| 30 | |||
| 31 | $img = $this->img(); |
||
| 32 | $name = SetFileNameAction::make($this->cover, $this->data->namingMethod, $this->data->lang)->generate(); |
||
| 33 | $saveTo = "$path/$name"; |
||
| 34 | |||
| 35 | $result = $img->resize($saveTo, $this->data->style); |
||
| 36 | |||
| 37 | if ($result) { |
||
|
|
|||
| 38 | $this->output['cover'] = $name; |
||
| 39 | |||
| 40 | if ($this->data->type != LaruploadFileType::IMAGE) { |
||
| 41 | $this->output['dominant_color'] = $this->data->withDominantColor ? $img->getDominantColor() : null; |
||
| 42 | } |
||
| 43 | } |
||
| 44 | |||
| 45 | return $this->output; |
||
| 46 | } |
||
| 58 |