From 404f20843fe16c2304e1f793e625a0ac85477fd7 Mon Sep 17 00:00:00 2001 From: Tyler Antonio <tantonio@ualberta.ca> Date: Fri, 20 Jan 2017 10:22:29 -0700 Subject: [PATCH] Split condition on multiple lines and added strict comparison --- lib/SimpleSAML/Utils/Config/Metadata.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/SimpleSAML/Utils/Config/Metadata.php b/lib/SimpleSAML/Utils/Config/Metadata.php index 9b586790a..2bf4b480a 100644 --- a/lib/SimpleSAML/Utils/Config/Metadata.php +++ b/lib/SimpleSAML/Utils/Config/Metadata.php @@ -117,7 +117,10 @@ class Metadata // check attributes is an associative array if (isset($contact['attributes'])) { - if (empty($contact['attributes']) || !is_array($contact['attributes']) || count(array_filter(array_keys($contact['attributes']), 'is_string')) == 0) { + if (empty($contact['attributes']) + || !is_array($contact['attributes']) + || count(array_filter(array_keys($contact['attributes']), 'is_string')) === 0 + ) { throw new \InvalidArgumentException('"attributes" must be an array and cannot be empty.'); } } -- GitLab