private function addNamedTokens(array $oldTokens, array $addTokens, string $errorType): array
    {
        $dup_keys = array_intersect_key($oldTokens, $addTokens);
        if ($dup_keys) {
            throw new \InvalidArgumentException(
                "Cannot redefine $errorType: " . join(', ', array_keys($dup_keys))
            );
        }

        return $oldTokens + $addTokens;
    }
private function addNamedTokens(array $oldTokens, array $addTokens, string $errorType): array
    {
        $dup_keys = array_intersect_key($oldTokens, $addTokens);
        if ($dup_keys) {
            throw new \InvalidArgumentException(
                "Cannot redefine $errorType: " . join(', ', array_keys($dup_keys))
            );
        }

        return $oldTokens + $addTokens;
    }
private function addNamedTokens ( array $ oldTokens , array $ addTokens , string $ errorType ) : array { $ dup_keys = array_intersect_key ( $ oldTokens , $ addTokens ) ; if ( $ dup_keys ) { throw new \ InvalidArgumentException ( "Cannot redefine $errorType: " . join ( ', ' , array_keys ( $ dup_keys ) ) ) ; } return $ oldTokens + $ addTokens ; }
Extends array of named tokens
@param string[] $oldTokens Existing tokens
@param string[] $addTokens New tokens to add
@param string $errorType Tokens type to insert in error message
@return string[] New merged array of tokens
@throws \InvalidArgumentException In case of name duplication.
@since 1.5.0
Extends array of named tokens