src/Valuestore.php
public function increment(string $name, int $by = 1)
    {
        $currentValue = $this->get($name) ?? 0;

        $newValue = $currentValue + $by;

        $this->put($name, $newValue);

        return $newValue;
    }
public function increment(string $name, int $by = 1)
    {
        $currentValue = $this->get($name) ?? 0;

        $newValue = $currentValue + $by;

        $this->put($name, $newValue);

        return $newValue;
    }
public function increment ( string $ name , int $ by = 1 ) { $ currentValue = $ this -> get ( $ name ) ?? 0 ; $ newValue = $ currentValue + $ by ; $ this -> put ( $ name , $ newValue ) ; return $ newValue ; }
Increment a value from the store.

@param string $name
@param int    $by

@return int|null|string
Increment a value from the store .