mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 01:57:13 +00:00
Adds sort to order expected keys
Without this sort the order of argument name and type matter. But we accually don't care about the order. Only name and type are allowed but the order doesn't matter.
This commit is contained in:
@@ -218,6 +218,7 @@ final class Method extends BaseTag implements Factory\StaticMethod
|
||||
$argument['type'] = new Void_();
|
||||
}
|
||||
$keys = array_keys($argument);
|
||||
sort($keys);
|
||||
if ($keys !== [ 'name', 'type' ]) {
|
||||
throw new \InvalidArgumentException(
|
||||
'Arguments can only have the "name" and "type" fields, found: ' . var_export($keys, true)
|
||||
|
||||
Reference in New Issue
Block a user