-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
I am getting the following exception when using the min: and max: validation rules:
ErrorException (E_DEPRECATED)
str_getcsv(): the $escape parameter must be provided as its default value will change
My system:
Hyperf 3.1.52
PHP 8.4
Ubuntu 24.04
Test controller to reproduce:
<?php
declare(strict_types=1);
namespace App\Controller;
use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpServer\Contract\RequestInterface;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\RequestMapping;
use Hyperf\Validation\Contract\ValidatorFactoryInterface;
#[Controller(prefix: '/test')]
class ValidationController
{
#[Inject]
protected ValidatorFactoryInterface $validatorFactory;
/**
* Validation test
*/
#[RequestMapping(path: "validation", methods: ["GET"])]
public function testValidation(RequestInterface $request)
{
$value = 'test';
$validator = $this->validatorFactory->make(
['value' => $value],
[
'value' => [
'min:3',
'max:64',
],
],
);
if ($validator->fails()) {
return [
'success' => false,
'message' => $validator->errors()->first('name'),
];
}
return [
'success' => true,
'message' => "Validation passed"
];
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working