private static function hasDuplicates(array $entityPath): bool
    {
        $found = [];
        foreach ($entityPath as $field) {
            $key = $field['field'] . "\0" . $field['class'];
            if (array_key_exists($key, $found)) {
                return true;
            }
            $found[$key] = true;
        }
        return false;
    }
private static function hasDuplicates(array $entityPath): bool
    {
        $found = [];
        foreach ($entityPath as $field) {
            $key = $field['field'] . "\0" . $field['class'];
            if (array_key_exists($key, $found)) {
                return true;
            }
            $found[$key] = true;
        }
        return false;
    }
private static function hasDuplicates ( array $ entityPath ) : bool { $ found = [ ] ; foreach ( $ entityPath as $ field ) { $ key = $ field [ 'field' ] . "\0" . $ field [ 'class' ] ; if ( array_key_exists ( $ key , $ found ) ) { return true ; } $ found [ $ key ] = true ; } return false ; }
Check if any fields appear in an entity path multiple times, to avoid weird loops.
@param array $entityPath
@return bool
Check if any fields appear in an entity path multiple times to avoid weird loops .