private static function mergeSettings(array $a, array $b, $mergeArrays = false): array
    {
        foreach ($b as $key => $value) {
            if (array_key_exists($key, $a)) {
                if (self::isAssoc($a[$key]) && self::isAssoc($b[$key])) {
                    $a[$key] = self::mergeSettings(
                        $a[$key],
                        $b[$key],
                        $mergeArrays
                    );
                } elseif ($mergeArrays && is_array($a[$key]) && is_array($b[$key])) {
                    $a[$key] = array_values(array_unique(array_merge($a[$key], $b[$key])));
                } else {
                    $a[$key] = $b[$key];
                }
            } else {
                $a[$key] = $value;
            }
        }

        return $a;
    }
private static function mergeSettings(array $a, array $b, $mergeArrays = false): array
    {
        foreach ($b as $key => $value) {
            if (array_key_exists($key, $a)) {
                if (self::isAssoc($a[$key]) && self::isAssoc($b[$key])) {
                    $a[$key] = self::mergeSettings(
                        $a[$key],
                        $b[$key],
                        $mergeArrays
                    );
                } elseif ($mergeArrays && is_array($a[$key]) && is_array($b[$key])) {
                    $a[$key] = array_values(array_unique(array_merge($a[$key], $b[$key])));
                } else {
                    $a[$key] = $b[$key];
                }
            } else {
                $a[$key] = $value;
            }
        }

        return $a;
    }
private static function mergeSettings ( array $ a , array $ b , $ mergeArrays = false ) : array { foreach ( $ b as $ key => $ value ) { if ( array_key_exists ( $ key , $ a ) ) { if ( self :: isAssoc ( $ a [ $ key ] ) && self :: isAssoc ( $ b [ $ key ] ) ) { $ a [ $ key ] = self :: mergeSettings ( $ a [ $ key ] , $ b [ $ key ] , $ mergeArrays ) ; } elseif ( $ mergeArrays && is_array ( $ a [ $ key ] ) && is_array ( $ b [ $ key ] ) ) { $ a [ $ key ] = array_values ( array_unique ( array_merge ( $ a [ $ key ] , $ b [ $ key ] ) ) ) ; } else { $ a [ $ key ] = $ b [ $ key ] ; } } else { $ a [ $ key ] = $ value ; } } return $ a ; }
Recursively merges the two given arrays giving priority to the second

@internal
@since 0.1.0
@param array $a           The array to merge in the second array into.
@param array $b           The array to merge into the first array.
@param bool  $mergeArrays Whether to merge indexed arrays.
@return array
Recursively merges the two given arrays giving priority to the second