Validate on one of two fields

Cake 3.3.7

I am trying too have at least one phone number but I cannot make a validation rule.
What’s wrong with this code :
$validator
->add(‘mobile_phone_number’, ‘length’, [
‘rule’ => [‘minLength’, 10],
‘message’ => ‘Please …’
])
->requirePresence(‘mobile_phone_number’, [
‘on’ => function ($context) {
return empty($context[‘data’][‘landline_phone_number’]
);
}])
;
$validator
->add(‘landline_phone_number’, ‘length’, [
‘rule’ => [‘minLength’, 10],
‘message’ => ‘please …’
])
->requirePresence(‘landline_phone_number’, [
‘on’ => function ($context) {
return empty($context[‘data’][‘mobile_phone_number’]
);
}])
;

Here’s code that I have in production for this. This is v3.8, can’t remember if this is one of the areas that’s changed since 3.3.

$validator
    ->requirePresence('home_phone', 'create', __('You must provide at least one phone number.'))
    ->notEmpty('home_phone', __('You must provide at least one phone number.'), function ($context) {
        return empty($context['data']['work_phone']) && empty($context['data']['mobile_phone']);
    });

Thank you.
I’ll try this one tomorrow (not at home).