<?php
namespace CodersLab\Lms\Modules\Materials\Application\Service\Quiz;
use Symfony\Component\HttpFoundation\Response;
final class QuizException extends \Exception
{
public static function apiError(array $response): QuizException
{
return new static('Api error:' . json_encode($response), Response::HTTP_INTERNAL_SERVER_ERROR);
}
public static function missingProperty(string $property): QuizException
{
return new static(sprintf('Missing property "%s"', $property), Response::HTTP_INTERNAL_SERVER_ERROR);
}
}