Convert the operation in progresses from int to string.

@param array $progresses the progresses

@return array
328627
private function stringifyOperations(array $progresses): array
    {
        foreach ($progresses as &$progress) {
            $progress[0] = static::OP_INT2STR_MAP[$progress[0]];
        }
        unset($progress);

        return $progresses;
    }
284008
private function calculateRawProgresses(array $dist): array
    {
        $m = \count($dist) - 1;
        $n = \count($dist[0]) - 1;

        $progresses = $trace = [];

        for (
            $x = $m, $y = $n;
            $x !== 0 && $y !== 0;
            [$x, $y] = $trace
        ) {
            switch ($dist[$x][$y]) {
                case $dist[$x - 1][$y] + $this->costMap[self::OP_DEL]:
                    $trace = [$x - 1, $y, self::OP_DEL];
                    break;
                case $dist[$x][$y - 1] + $this->costMap[self::OP_INS]:
                    $trace = [$x, $y - 1, self::OP_INS];
                    break;
                case $dist[$x - 1][$y - 1] + $this->costMap[self::OP_REP]:
                    $trace = [$x - 1, $y - 1, self::OP_REP];
                    break;
                default:
                    $trace = [$x - 1, $y - 1, self::OP_CPY];
                    break;
            }

            $progresses[] = [$x, $y, $trace[2]];
        }

        for (; $x > 0; --$x) {
            $progresses[] = [$x, 0, self::OP_DEL];
        }

        for (; $y > 0; --$y) {
            $progresses[] = [0, $y, self::OP_INS];
        }

        return $progresses;
    }
733884
protected function getProgress(): string
    {
        return sprintf(
            ' %' . $this->numTestsWidth . 'd / %' . $this->numTestsWidth . 'd (%3s%%)',
            $this->casesProcessed,
            $this->totalCases,
            floor(($this->totalCases ? $this->casesProcessed / $this->totalCases : 0) * 100)
        );
    }
1100318
public function progress() : int
    {
        return $this->comparing() ?
        $this->group->comparedUser->progress :
        $this->group->fromUser->progress;
    }
1143659
public function process(array $items)
    {
        $total = count($items);
        for ($i = 1; $i < $total; $i++) {
            for ($j = 0; $j < $total - $i; $j++) {
                if (!$items[$j]->getDate() || !$items[$j + 1]->getDate()) {
                    continue;
                }
                if ($items[$j]->getDate()->getTimestamp() > $items[$j + 1]->getDate()->getTimestamp()) {
                    continue;
                }
                $aux = $items[$j + 1];
                $items[$j + 1] = $items[$j];
                $items[$j] = $aux;
            }
        }

        return $items;
    }
1239053
protected function arrayToKey(array $array)
    {
        if ($this->isSequential($array)) {
            return $this->sequentialArrayToKey($array);
        }

        $parts = [];

        $keys = array_keys($array);
        sort($keys);

        foreach ($keys as $key) {
            $parts[] = $key;
            $parts[] = $this->castArrayValue($array[$key]);
        }

        return implode('_', $parts);
    }
640184
static public function toLowerCaseKey(array $array)
	{
	    $res = [];
	    if ($array) {
	        foreach ($array as $k  => $v) {
	            if (is_array($v)) {
	                $v = static::toLowerCaseKey($v);
	            }
	            $res[strtolower($k)] = $v;
	        }
	    }
	    return $res;
	}
380596
public function toArray($set = [], $convert = true) {

		$methods = get_class_methods($this);
		$array 	 = [];

		if(true === is_string($set)) {
			$set = [$set];
		}

		$set 	= array_flip($set);
		$amount = count($set);

		foreach($methods as $method) {
			
			$chunks = explode('get', $method);

			if(count($chunks) == 2) {

				$key = (true === $convert) ? strtolower($chunks[1]) : $chunks[1];

				if($amount === 0 || ($amount > 0 && true === isset($set[$key]))) {

					$value = call_user_func_array([$this, $method], []);

					if($value instanceof Container) {
						$value = $value -> all();
					}

					if(0 === strlen(trim($key)) && ($value === null || 0 === strlen(trim($value)))) {
						continue;
					}

					$array[$key] = $value;
				}
			}
		}
		
		return json_decode(json_encode($array), true);
	}
1198563
public function getProgress()
    {
        $progress = new Progress();
        $progress->percent = $this->__get('progress_percent');
        $progress->step = $this->__get('progress_step');
        $progress->stepName = $this->__get('progress_name');
        $progress->totalSteps = $this->__get('progress_steps');
        $progress->leftOverSeconds = $this->__get('progress_remaining');
        return $progress;
    }
70074
private function parseEnumNotation($notation)
    {
        if (is_string($notation)) {
            $notation = json_decode(trim($notation, '<>'));

            if (json_last_error()) {
                return;
            }
        }

        return $notation;
    }
352972
protected function incrementHeaders(array $headers)
    {
        $incrementedHeaders = [];
        foreach (array_count_values($headers) as $header => $count) {
            if ($count > 1) {
                $incrementedHeaders[] = $header;
                for ($i = 1; $i < $count; $i++) {
                    $incrementedHeaders[] = $header . $i;
                }
            } else {
                $incrementedHeaders[] = $header;
            }
        }

        return $incrementedHeaders;
    }
785107
public function writeProgress($taskId, Progress $progress)
    {
        return $this->write($taskId, [
            'progress_percent'      => $progress->percent,
            'progress_step'         => $progress->step,
            'progress_name'         => $progress->stepName,
            'progress_steps'        => $progress->totalSteps,
            'progress_remaining'    => $progress->leftOverSeconds
        ]);
    }
292359
public static function prepareParameters(array $parameters)
    {
        $toConvert = [ 'amount', 'price' ];

        if (self::needsAmountConversion($parameters)) {
            if ($converter = Stripe::getAmountConverter()) {
                foreach ($toConvert as $to) {
                    if (isset($parameters[$to])) {
                        $parameters[$to] = forward_static_call_array(
                            $converter, [ $parameters[$to] ]
                        );
                    }
                }
            }
        }

        $parameters = array_map(function ($parameter) {
            return is_bool($parameter) ? ($parameter === true ? 'true' : 'false') : $parameter;
        }, $parameters);

        return preg_replace('/\%5B\d+\%5D/', '%5B%5D', http_build_query($parameters));;
    }
399526
function progress( $step )
    {
        $totalSteps = 0;
        foreach ( $this->StepTable as $tableStep )
        {
            if ( !isset( $tableStep['count_step'] ) or
                 $tableStep['count_step'] )
                ++$totalSteps;
        }

        $currentStep = 0;
        foreach ( $this->StepTable as $key => $tableStep )
        {
            if ( $step['class'] == $tableStep['class'] )
            {
                break;
            }
            else if ( !isset( $tableStep['count_step'] ) or
                      $tableStep['count_step'] )
                ++$currentStep;
        }

        return (int) ( $currentStep * 100 / ( $totalSteps - 1 ) );
    }
452417
public static function ToString($Conditions) {
      $Result = '';

      foreach ($Conditions as $Condition) {
         if (!is_array($Condition) || count($Condition) < 2)
            continue; // skip ill-formatted conditions.

         if (strlen($Result) > 0)
            $Result .= "\n";

         $Result .= "{$Condition[0]},{$Condition[1]}";
         if (count($Condition) >= 3) {
            $Result .= $Condition[2];
         }
      }
      return $Result;
   }
186387
protected function convertFromMinutes($minutes)
    {
        $seconds = $minutes * 60;

        $secondsInAMinute = 60;
        $secondsInAnHour  = 60 * $secondsInAMinute;
        $secondsInADay    = 24 * $secondsInAnHour;

        // extract days
        $days = floor($seconds / $secondsInADay);

        // extract hours
        $hourSeconds = $seconds % $secondsInADay;
        $hours       = floor($hourSeconds / $secondsInAnHour);

        // extract minutes
        $minuteSeconds = $hourSeconds % $secondsInAnHour;
        $minutes       = floor($minuteSeconds / $secondsInAMinute);

        // return the final string
        $output = '';

        if ($days > 0) {
            $output .= $days . ' ' . $this->pluralize('day', $days);
        }

        if ($hours > 0) {
            $output .= $hours . ' ' . $this->pluralize('hour', $hours);
        }

        $output .= $minutes . ' ' . $this->pluralize('minute', $minutes);

        return $output;
    }
1003344
public static function prepareRingRequest(Transaction $trans)
    {
        // Clear out the transaction state when initiating.
        $trans->exception = null;
        $request = self::createRingRequest($trans->request);

        // Emit progress events if any progress listeners are registered.
        if ($trans->request->getEmitter()->hasListeners('progress')) {
            $emitter = $trans->request->getEmitter();
            $request['client']['progress'] = function ($a, $b, $c, $d) use ($trans, $emitter) {
                $emitter->emit('progress', new ProgressEvent($trans, $a, $b, $c, $d));
            };
        }

        return $request;
    }