| Conditions | 5 |
| Paths | 6 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public function __construct($source, $destinationPath = null) |
||
| 31 | { |
||
| 32 | if($source instanceof Model && $source instanceof UploadTarget) { |
||
| 33 | $this->sourcePath = $source->upload_source_path; |
||
| 34 | $this->destinationPath = $destinationPath ?: $source->upload_destination_path; |
||
| 35 | $this->target = $source; |
||
| 36 | } else { |
||
| 37 | $this->sourcePath = $source; |
||
| 38 | $this->destinationPath = $destinationPath; |
||
| 39 | } |
||
| 40 | |||
| 41 | $this->destinationPath = str_start($this->destinationPath, "/"); |
||
| 42 | |||
| 43 | if (starts_with($this->sourcePath, "s3://")) { |
||
| 44 | app('aws')->createClient('s3')->registerStreamWrapper(); |
||
| 45 | } |
||
| 46 | } |
||
| 47 | |||
| 71 | } |