`$equalsData` should be an array (or your code will throw errors). Can you use type-hinting? Also I think your code will fail if `$equalsData` is not present (aka optional).