public static function add(array $subjectArray, $newElementKey, $newElementValue)
    {
        if (!is_null(self::get($subjectArray, $newElementKey))) {
            return $subjectArray;
        }

        self::set($subjectArray, $newElementKey, $newElementValue);

        return $subjectArray;
    }
public static function add(array $subjectArray, $newElementKey, $newElementValue)
    {
        if (!is_null(self::get($subjectArray, $newElementKey))) {
            return $subjectArray;
        }

        self::set($subjectArray, $newElementKey, $newElementValue);

        return $subjectArray;
    }
public static function add ( array $ subjectArray , $ newElementKey , $ newElementValue ) { if ( ! is_null ( self :: get ( $ subjectArray , $ newElementKey ) ) ) { return $ subjectArray ; } self :: set ( $ subjectArray , $ newElementKey , $ newElementValue ) ; return $ subjectArray ; }
Add an element to an array using "dot" notation, if it does NOT exist.

Note: Unlike DotArray::set(), this method does NOT change the
original array. Rather, a new array is returned.

@since 3.0.0

@param array $subjectArray The subject array
@param string $newElementKey The new element's key. Use "dot" notation for nested keys.
@param mixed $newElementValue The new element's value

@return array If the key does not exist, the new array is returned;
else the original array is returned.
Add an element to an array using dot notation if it does NOT exist .