|
|
|
|
@ -161,19 +161,19 @@ enum EShapeType: int { |
|
|
|
|
if ($this === EShapeType::Image && !is_string($value) && !($value instanceof FileShaped && $value->getShapeType() === EShapeType::Image)) { |
|
|
|
|
throw new ValidationException('Non-image item provided for Image slot'); |
|
|
|
|
} |
|
|
|
|
if ($this === EShapeType::ListOfImages && (!is_array($value) || count(array_filter($value, fn ($item) => !is_string($item) && !($value instanceof FileShaped && $value->getShapeType() === EShapeType::Image))) > 0)) { |
|
|
|
|
if ($this === EShapeType::ListOfImages && (!is_array($value) || count(array_filter($value, fn ($item) => !is_string($item) && !($item instanceof FileShaped && $item->getShapeType() === EShapeType::Image))) > 0)) { |
|
|
|
|
throw new ValidationException('Non-image list item provided for ListOfImages slot'); |
|
|
|
|
} |
|
|
|
|
if ($this === EShapeType::Audio && !is_string($value) && !($value instanceof FileShaped && $value->getShapeType() === EShapeType::Audio)) { |
|
|
|
|
throw new ValidationException('Non-audio item provided for Audio slot'); |
|
|
|
|
} |
|
|
|
|
if ($this === EShapeType::ListOfAudios && (!is_array($value) || count(array_filter($value, fn ($item) => !is_string($item) && !($value instanceof FileShaped && $value->getShapeType() === EShapeType::Audio))) > 0)) { |
|
|
|
|
if ($this === EShapeType::ListOfAudios && (!is_array($value) || count(array_filter($value, fn ($item) => !is_string($item) && !($item instanceof FileShaped && $item->getShapeType() === EShapeType::Audio))) > 0)) { |
|
|
|
|
throw new ValidationException('Non-audio list item provided for ListOfAudio slot'); |
|
|
|
|
} |
|
|
|
|
if ($this === EShapeType::Video && !is_string($value) && !($value instanceof FileShaped && $value->getShapeType() === EShapeType::Video)) { |
|
|
|
|
throw new ValidationException('Non-video item provided for Video slot'); |
|
|
|
|
} |
|
|
|
|
if ($this === EShapeType::ListOfVideos && (!is_array($value) || count(array_filter($value, fn ($item) => !is_string($item) && !($value instanceof FileShaped && $value->getShapeType() === EShapeType::Video))) > 0)) { |
|
|
|
|
if ($this === EShapeType::ListOfVideos && (!is_array($value) || count(array_filter($value, fn ($item) => !is_string($item) && !($item instanceof FileShaped && $item->getShapeType() === EShapeType::Video))) > 0)) { |
|
|
|
|
throw new ValidationException('Non-video list item provided for ListOfVideos slot'); |
|
|
|
|
} |
|
|
|
|
if ($this === EShapeType::File && !is_string($value)) { |
|
|
|
|
|