From c5545d151969b66f87cda3feee98d12b45638bed Mon Sep 17 00:00:00 2001 From: Jaapio Date: Mon, 11 Sep 2017 19:56:35 +0200 Subject: [PATCH] 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. --- src/DocBlock/Tags/Method.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/DocBlock/Tags/Method.php b/src/DocBlock/Tags/Method.php index d3c1cd1..15998ed 100644 --- a/src/DocBlock/Tags/Method.php +++ b/src/DocBlock/Tags/Method.php @@ -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)