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