| Total Complexity | 5 | 
| Total Lines | 25 | 
| Duplicated Lines | 0 % | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php  | 
            ||
| 5 | class HeightBetweenRule extends MediaItemRule  | 
            ||
| 6 | { | 
            ||
| 7 | public function __construct(  | 
            ||
| 8 | protected int $minHeight = 0,  | 
            ||
| 9 | protected int $maxHeight = 0  | 
            ||
| 10 |     ) { | 
            ||
| 11 | }  | 
            ||
| 12 | |||
| 13 | public function validateMediaItem(): bool  | 
            ||
| 14 |     { | 
            ||
| 15 |         if (! $media = $this->getTemporaryUploadMedia()) { | 
            ||
| 16 | return true;  | 
            ||
| 17 | }  | 
            ||
| 18 | |||
| 19 | $size = getimagesize($media->getPath());  | 
            ||
| 20 | $actualHeight = $size[1];  | 
            ||
| 21 | |||
| 22 | return $actualHeight >= $this->minHeight && $actualHeight <= $this->maxHeight;  | 
            ||
| 23 | }  | 
            ||
| 24 | |||
| 25 | public function message()  | 
            ||
| 30 | ]);  | 
            ||
| 31 | }  | 
            ||
| 32 | }  | 
            ||
| 33 |