Open pawaclawczyk opened 11 years ago
$rsb
->from(array('firstName', 'lastName'))
->within($person)
->using(function ($firstName, $lastName) { return sprintf("%s %s", $firstName, $lastName); })
->on(array('firstName', 'lastName'))
->to('fullName')
->within($contact);
->from('phoneNumber')
->within($person)
->to('phoneNumber')
->within($contact)
->build()
Below indentation is more legible:
$rsb
->from(array('firstName', 'lastName'))->within($person)
->using(function ($firstName, $lastName) { return sprintf("%s %s", $firstName, $lastName); })
->on(array('firstName', 'lastName'))
->to('fullName')->within($contact);
->from('phoneNumber')->within($person)
->to('phoneNumber')->within($contact)
->build()
Proposition of API to build set of rules using in transformation