@param array &$base
@param int|string $key
@param DiffOp $diffOp

@throws PatcherException
761382
private function applyOperation( array &$base, $key, DiffOp $diffOp ) {
		if ( $diffOp instanceof DiffOpAdd ) {
			$this->applyDiffOpAdd( $base, $key, $diffOp );
		}
		elseif ( $diffOp instanceof DiffOpChange ) {
			$this->applyDiffOpChange( $base, $key, $diffOp );
		}
		elseif ( $diffOp instanceof DiffOpRemove ) {
			$this->applyDiffOpRemove( $base, $key, $diffOp );
		}
		elseif ( $diffOp instanceof Diff ) {
			$this->applyDiff( $base, $key, $diffOp );
		}
		else {
			$this->handleError( 'Unknown diff operation cannot be applied to map element' );
		}
	}
557699
public function increase(string $key, $diff = 1)
    {
        if (is_int($diff)) {
            return $this->handle->hIncrBy($this->name, $key, $diff);
        }
        return $this->handle->hIncrByFloat($this->name, $key, $diff);
    }
1265864
protected function sforget($key)
    {
        $keys = is_array($key) ? $key : [$key];

        foreach ($keys as $key) {
            $this->cache->forget($this->skey($key));
        }

        $this->cache->forget($this->skey('*'));
    }
323439
public function decrement($key, $step)
    {
        $value = $this->getValueByKey($key, false);
        $this->alter($key, $value - $step);
    }
917748
public function setDataByKey($key, $data)
    {
        $data = $this->hydrateIfJsonToArray($data);
        $this->data[$key] = $data;
    }
1350667
public function increase(string $key, float $diff = 1): float
    {
        return $this->handle->zIncrBy($this->name, $diff, $key);
    }
1137890
public static function toTail(array &$values, $key) {
    $key = (array) $key;

    $keys = array_keys($values);
    $keys = array_diff($keys, $key);
    $keys = array_merge($keys, $key);

    static::order($values, $keys);
  }
499336
public function increment($key, $step = 1)
    {
        if (!$this->enabled)
            return false;

        $has_replaced = $has_set = false;
        try {
            // Store the cache object
            $nKey = $this->key($key);
            $has_replaced = @$this->getConnection()->add($nKey, $step, 0);
            if (!$has_replaced) {
                $has_set = @$this->getConnection()->increment($nKey, $step);
            }

        } catch (Exception $e) {
            throw new CacheException($e->getMessage(), $e->getCode());
        }

        $this->Logger->debug("". (($has_replaced || $has_set) ? "Successfully" : "Failed to") . " increment key '{$key}'\n");
//        $this->Logger->debug($data);

        return $has_replaced ? $step : $has_set;
    }
671221
public static function inc($key, $step = 1) {
        try {
            self::getCache()->inc($key, $step);
            self::release();
        } catch (\RuntimeException $e) {
            self::release();
            throw $e;
        } catch (\Error $e) {
            self::release();
            throw $e;
        }
    }
1084751
def _create_diff_action(diff, diff_key, key, value):

    '''
    
    '''

    if diff_key not in diff.keys():
        diff[diff_key] = {}
    diff[diff_key][key] = value
937807
public function setDirty($key= '') {
        if (empty($key)) {
            foreach (array_keys($this->_fieldMeta) as $fIdx => $fieldKey) {
                $this->setDirty($fieldKey);
            }
        }
        else {
            $key = $this->getField($key, true);
            if ($key !== false) {
                $this->_dirty[$key] = $key;
                if (isset($this->_validated[$key])) unset($this->_validated[$key]);
            }
        }
    }
1271854
public function apply()
	{
		foreach ($this->patches as $patch)
		{
			// Separate the input into lines
			$lines = self::splitLines($patch['udiff']);

			// Loop for each header
			while (self::findHeader($lines, $src, $dst))
			{
				$done = false;

				if ($patch['strip'] === null)
				{
					$src = $patch['root'] . preg_replace('#^([^/]*/)*#', '', $src);
					$dst = $patch['root'] . preg_replace('#^([^/]*/)*#', '', $dst);
				}
				else
				{
					$src = $patch['root'] . preg_replace('#^([^/]*/){' . (int) $patch['strip'] . '}#', '', $src);
					$dst = $patch['root'] . preg_replace('#^([^/]*/){' . (int) $patch['strip'] . '}#', '', $dst);
				}

				// Loop for each hunk of differences
				while (self::findHunk($lines, $src_line, $src_size, $dst_line, $dst_size))
				{
					$done = true;

					// Apply the hunk of differences
					$this->applyHunk($lines, $src, $dst, $src_line, $src_size, $dst_line, $dst_size);
				}

				// If no modifications were found, throw an exception
				if (!$done)
				{
					throw new \RuntimeException('Invalid Diff');
				}
			}
		}

		// Initialize the counter
		$done = 0;

		// Patch each destination file
		foreach ($this->destinations as $file => $content)
		{
			$content = implode("\n", $content);

			if (File::write($file, $content))
			{
				if (isset($this->sources[$file]))
				{
					$this->sources[$file] = $content;
				}

				$done++;
			}
		}

		// Remove each removed file
		foreach ($this->removals as $file)
		{
			if (File::delete($file))
			{
				if (isset($this->sources[$file]))
				{
					unset($this->sources[$file]);
				}

				$done++;
			}
		}

		// Clear the destinations cache
		$this->destinations = array();

		// Clear the removals
		$this->removals = array();

		// Clear the patches
		$this->patches = array();

		return $done;
	}
33042
private static function setKeyAndMethod($driver, $key, $method): void
    {
        $driver->setKey($key);
        if ($method !== null) {
            $driver->setMethod($method);
        }
    }
266509
function setKey($key)
    {
        parent::setKey($key);

        if (!$this->explicit_key_length) {
            $length = strlen($key);
            switch (true) {
                case $length <= 16:
                    $this->key_length = 16;
                    break;
                case $length <= 24:
                    $this->key_length = 24;
                    break;
                default:
                    $this->key_length = 32;
            }
            $this->_setEngine();
        }
    }
1331656
static function accumulatorStop( $key, $recursive = false )
    {
        if ( !eZDebug::isDebugEnabled() )
            return;
        $stopTime = microtime( true );
        $debug = eZDebug::instance();
        $key = $key === false ? 'Default Debug-Accumulator' : $key;
        if ( ! array_key_exists( $key, $debug->TimeAccumulatorList ) )
        {
            eZDebug::writeWarning( "Accumulator '$key' does not exist, run eZDebug::accumulatorStart first", __METHOD__ );
            return;
        }
        $accumulator = $debug->TimeAccumulatorList[$key];
        if ( $recursive )
        {
            if ( isset( $accumulator['recursive_counter'] ) )
            {
                if ( $accumulator['recursive_counter'] > 0 )
                {
                    $accumulator['recursive_counter']--;
                    return;
                }
            }
        }
        $diffTime = $stopTime - $accumulator['temp_time'];
        $accumulator['time'] = $accumulator['time'] + $diffTime;
        ++$accumulator['count'];
        $debug->TimeAccumulatorList[$key] = $accumulator;
    }
182173
private function patchMapOrList( array $base, Diff $diff ): array {
		if ( $diff->looksAssociative() ) {
			return $this->patch( $base, $diff );
		}

		return $this->listPatcher->patch( $base, $diff );
	}
982235
function setdefault($key, $default=null) {
		return $this->offsetExists($key) ? $this[$key] : $this[$key] = $default;
	}