-
Notifications
You must be signed in to change notification settings - Fork 56
Utils::getArity fails on callables in array format #7
Utils::getArity fails on callables in array format #7
Conversation
@@ -24,6 +25,7 @@ public function callablesWithVaryingArity() | |||
}, 2], | |||
'invokable' => [new Dispatch(), 5], | |||
'interface' => [new MiddlewarePipe(), 2], // 2 REQUIRED arguments! | |||
'callable' => [array(new NormalHandler(), 'handle'), 3] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, use short array syntax
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Force of habit I suppose.
Two notes:
Thanks for the patch, @tklever ! |
Utils::getArity fails on callables in array format
- Added StaticHandler test asset with a static method. - Added arity data providers for: - `['classname', 'methodname']` - `'classname::methodname'` - Last provider required another addition to the code to properly check arity of that static method.
@weierophinney No Problem, thank YOU for your continued hard work on all things Zend (and PSR7 and Middleware, etc., etc., etc.) I pushed this against develop vs. master because I saw it as an enhancement (we're supporting an additional callback format) vs. a bug (we support this and it's broken). I can certainly see cases to be made for either direction, but I'm glad it was good enough to get merged. |
This patch allows Utils::getArity to correctly return the arity on callables passed in array format
i.e.