public static function set($storage, $setting, $value)
    {
        if (!is_array($storage) || empty($setting)) {
            throw new ArrayStorageException('Invalid parameters specified');
        }
        $setting = self::parseSetting($setting);
        if (is_array($setting)) {
            $reference = &$storage;
            foreach ($setting as $item) {
                if (!is_array($reference)) {
                    $reference = [];
                }
                $reference = &$reference[$item];
            }
            $reference = $value;
            unset($reference);
            return $storage;
        }
        $storage[$setting] = $value;
        return $storage;
    }
public static function set($storage, $setting, $value)
    {
        if (!is_array($storage) || empty($setting)) {
            throw new ArrayStorageException('Invalid parameters specified');
        }
        $setting = self::parseSetting($setting);
        if (is_array($setting)) {
            $reference = &$storage;
            foreach ($setting as $item) {
                if (!is_array($reference)) {
                    $reference = [];
                }
                $reference = &$reference[$item];
            }
            $reference = $value;
            unset($reference);
            return $storage;
        }
        $storage[$setting] = $value;
        return $storage;
    }
public static function set ( $ storage , $ setting , $ value ) { if ( ! is_array ( $ storage ) || empty ( $ setting ) ) { throw new ArrayStorageException ( 'Invalid parameters specified' ) ; } $ setting = self :: parseSetting ( $ setting ) ; if ( is_array ( $ setting ) ) { $ reference = & $ storage ; foreach ( $ setting as $ item ) { if ( ! is_array ( $ reference ) ) { $ reference = [ ] ; } $ reference = & $ reference [ $ item ] ; } $ reference = $ value ; unset ( $ reference ) ; return $ storage ; } $ storage [ $ setting ] = $ value ; return $ storage ; }
Sets a value in a storage array.

@param array $storage
@param mixed $setting Can be an array, a string,
or a special formatted string
(eg 'app/path/project').
@param mixed $value The value to be stored.

@return array The storage array with new data.
@throws \WebServCo\Framework\Exceptions\ArrayStorageException
Sets a value in a storage array .