users icon indicating copy to clipboard operation
users copied to clipboard

Deprecation warning in RegisterBehavior

Open LordSimal opened this issue 8 months ago • 0 comments

This code

    public function buildValidator(\Cake\Event\EventInterface $event, Validator $validator, $name)
    {
        if ($name === 'default') {
            return $this->_emailValidator($validator, $this->validateEmail);
        }

        return $validator;
    }

inside the RegisterBehavior triggers the following warning:

deprecated: 16384 :: Since 5.2.0: Returning a value from event listeners is deprecated. Use `$event->setResult()` instead in `Model.buildValidator` of `AlfredStaffMembers\Model\Table\StaffMembersTable`

CakePHP 5.2.4 CakeDC/Users: 15.0.2

LordSimal avatar Jun 11 '25 07:06 LordSimal