This commit is contained in:
		
							parent
							
								
									557c6e5ee3
								
							
						
					
					
						commit
						8772e50122
					
				| @ -20,6 +20,10 @@ class FileRequest | |||||||
|      * @var Metadata |      * @var Metadata | ||||||
|      */ |      */ | ||||||
|     private $metadata; |     private $metadata; | ||||||
|  |     /** | ||||||
|  |      * @var ImageEditOptions | ||||||
|  |      */ | ||||||
|  |     private $imageEditOptions; | ||||||
| 
 | 
 | ||||||
|     public function __construct(string $url, string $fallbackUrl = null) |     public function __construct(string $url, string $fallbackUrl = null) | ||||||
|     { |     { | ||||||
| @ -28,6 +32,7 @@ class FileRequest | |||||||
| 
 | 
 | ||||||
|         $this->fileOptions = new FileOptions(); |         $this->fileOptions = new FileOptions(); | ||||||
|         $this->metadata = new Metadata(); |         $this->metadata = new Metadata(); | ||||||
|  |         $this->imageEditOptions = new ImageEditOptions(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     public function url(string $url) |     public function url(string $url) | ||||||
| @ -68,6 +73,18 @@ class FileRequest | |||||||
|         return $this->metadata; |         return $this->metadata; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     public function imageEditOptions(ImageEditOptions $imageEditOptions) | ||||||
|  |     { | ||||||
|  |         $this->imageEditOptions = $imageEditOptions; | ||||||
|  | 
 | ||||||
|  |         return $this; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public function getImageEditOptions(): ImageEditOptions | ||||||
|  |     { | ||||||
|  |         return $this->imageEditOptions; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     public function getUrl(): string |     public function getUrl(): string | ||||||
|     { |     { | ||||||
|         return $this->url; |         return $this->url; | ||||||
| @ -84,7 +101,8 @@ class FileRequest | |||||||
|             'url' => $this->url, |             'url' => $this->url, | ||||||
|             'fallbackUrl' => $this->fallbackUrl, |             'fallbackUrl' => $this->fallbackUrl, | ||||||
|             'fileOptions' => $this->fileOptions->toArray(), |             'fileOptions' => $this->fileOptions->toArray(), | ||||||
|             'metadata' => $this->metadata->toArray() |             'metadata' => $this->metadata->toArray(), | ||||||
|  |             'imageEditOptions' => $this->imageEditOptions->toArray() | ||||||
|         ]); |         ]); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | |||||||
							
								
								
									
										48
									
								
								src/ImageEditOptions.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								src/ImageEditOptions.php
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,48 @@ | |||||||
|  | <?php | ||||||
|  | 
 | ||||||
|  | namespace Nwb\MultiDownloaderClient; | ||||||
|  | 
 | ||||||
|  | class ImageEditOptions | ||||||
|  | { | ||||||
|  |     /** | ||||||
|  |      * @var int | ||||||
|  |      */ | ||||||
|  |     private $width; | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * @var int | ||||||
|  |      */ | ||||||
|  |     private $height; | ||||||
|  | 
 | ||||||
|  |     public function width(int $width) | ||||||
|  |     { | ||||||
|  |         $this->width = $width; | ||||||
|  | 
 | ||||||
|  |         return $this; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public function getWidth(): int | ||||||
|  |     { | ||||||
|  |         return $this->width; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public function height(int $height) | ||||||
|  |     { | ||||||
|  |         $this->height = $height; | ||||||
|  | 
 | ||||||
|  |         return $this; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public function getHeight(): int | ||||||
|  |     { | ||||||
|  |         return $this->height; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     public function toArray(): array | ||||||
|  |     { | ||||||
|  |         return array_filter([ | ||||||
|  |             'width' => $this->width, | ||||||
|  |             'height' => $this->height | ||||||
|  |         ]); | ||||||
|  |     } | ||||||
|  | } | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user