public function aroundPlaceOrder(MagentoQuoteModelQuoteManagement $subject, callable $proceed, $cartId, $paymentMethod = null)
Can anyone tell me what “callable” does?
I can’t find it anywhere else in the code and it’s not setup like a variable like the rest inside this method.
2
Answers
It’s the type of the
$proceed
variable, which means your function accepts a callback function.http://php.net/manual/en/language.types.callable.php
Hope it helps!!
Basically, a callable (or callback) it’s like a function that takes another function in argument. So per example.
You would this function like so: