vid-queue/app/Models/Input.php

26 lines
418 B
PHP
Raw Normal View History

2022-03-05 19:51:04 -06:00
<?php
namespace App\Models;
use App\Exceptions\Quit;
class Input
{
public ?array $files;
public ?string $url;
public function assertValid(): void
{
throw_if(
empty($this->files) && empty($this->url),
Quit::class,
'Must have either a valid file or URL'
);
}
public function hasURL(): bool
{
return !empty($this->url);
}
}