Skip to content
Snippets Groups Projects
Commit 404f2084 authored by Tyler Antonio's avatar Tyler Antonio
Browse files

Split condition on multiple lines and added strict comparison

parent e142bd05
No related branches found
No related tags found
No related merge requests found
......@@ -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.');
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment