How can I use the parameter of the second()
method when calling the first()
?
class SomeClass {
public function first($first_value)
{
Event::listen($first_value, function($event) {
$second_value; <-- how to get that?
});
return $this;
}
public function second($second_value)
{
// how to set the value for ->first() ?
}
}
->first('App\Event\SomeEvent')->second(10);
Aucun commentaire:
Enregistrer un commentaire