public static function def($array, $key, $value, $delimiter = '.')
    {
        if (static::has($array, $key, $delimiter)) {
            return $array;
        }

        return static::set($array, $key, $value, $delimiter);
    }
public static function def($array, $key, $value, $delimiter = '.')
    {
        if (static::has($array, $key, $delimiter)) {
            return $array;
        }

        return static::set($array, $key, $value, $delimiter);
    }
public static function def ( $ array , $ key , $ value , $ delimiter = '.' ) { if ( static :: has ( $ array , $ key , $ delimiter ) ) { return $ array ; } return static :: set ( $ array , $ key , $ value , $ delimiter ) ; }
Set a default value to array or object if not exists. Key can be a path separated by dots.

@param array|object $array     Object or array to set default value.
@param string       $key       Key path name.
@param mixed        $value     Value to set if not exists.
@param string       $delimiter Separator to split paths.

@return  array|object
@throws \InvalidArgumentException

@since 4.0
Set a default value to array or object if not exists . Key can be a path separated by dots .