Upgrade to Laravel 9 (#4413)
Co-authored-by: DaneEveritt <dane@daneeveritt.com>
This commit is contained in:
parent
95e15d2c8a
commit
cbcf62086f
573 changed files with 4387 additions and 9411 deletions
|
@ -4,22 +4,20 @@ namespace Pterodactyl\Traits\Services;
|
|||
|
||||
use BadMethodCallException;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Contracts\Validation\Factory;
|
||||
use Illuminate\Contracts\Validation\Factory as ValidationFactory;
|
||||
use Pterodactyl\Exceptions\Service\Egg\Variable\BadValidationRuleException;
|
||||
|
||||
trait ValidatesValidationRules
|
||||
{
|
||||
abstract protected function getValidator(): Factory;
|
||||
abstract protected function getValidator(): ValidationFactory;
|
||||
|
||||
/**
|
||||
* Validate that the rules being provided are valid for Laravel and can
|
||||
* be resolved.
|
||||
*
|
||||
* @param array|string $rules
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Service\Egg\Variable\BadValidationRuleException
|
||||
*/
|
||||
public function validateRules($rules)
|
||||
public function validateRules(array|string $rules): void
|
||||
{
|
||||
try {
|
||||
$this->getValidator()->make(['__TEST' => 'test'], ['__TEST' => $rules])->fails();
|
||||
|
|
Reference in a new issue