Format the destroy failed message.

@param string $number  The model id.
@param string $message The Exception message.

@return string
344004
public function destroyFailedMessage($number, $message = null)
    {
        if (Lang::has('resource-controller.destroyfailed')) {
            return trans(
                'resource-controller.destroyfailed', [
                    'number' => $number,
                    'message' => $message
                ]
            );
        }

        return 'Operation failed while destroying the record '.$number.' with message: '.$message;
    }
938534
public static function assertNumberFormat($number)
    {
        if (is_float($number)) {
            throw new \InvalidArgumentException(sprintf('The provided value "%s" must be a string, not a float.', $number));
        }
        if (!is_numeric($number)) {
            throw new \InvalidArgumentException(sprintf('The provided value "%s" is not a numeric value.', $number));
        }
    }
126596
public function digits($message = null)
    {
        $this->setRule(__FUNCTION__, function($val)
                       {
                           return (strlen($val) === 0 || ctype_digit((string) $val));
                       }, $message);
        return $this;
    }
4788
protected function fail($message = null, $validation = null)
    {
        $this->trigger('json-fail', $this, $message, $validation);
        $this->trigger('response-fail', $this, $message, $validation);

        $json = array('error' => true);

        if($message) {
            $json['message'] = $message;
        }

        if($validation) {
            $json['validation'] = $validation;
        }

        $body = json_encode($json, JSON_PRETTY_PRINT);

        $this->response
            ->set('headers', 'Content-Type', 'text/json')
            ->set('body', $body);

        return $body;
    }
931073
protected function formatMessage($message, $value)
    {
        $type = class_exists($this->type) ? get_class($value) : gettype($value);

        return sprintf($message, $this->type, $type);
    }
294754
public static function spellNumber($number)
    {
        $a = new \NumberFormatter(Yii::$app->language, \NumberFormatter::SPELLOUT);

        return $a->format($number);
    }
1073220
private function createExceptionMessage($message)
    {
        $parameters = $this->parameters;

        if ($parameters->scheme === 'unix') {
            return "$message [$parameters->scheme:$parameters->path]";
        }

        if (filter_var($parameters->host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
            return "$message [$parameters->scheme://[$parameters->host]:$parameters->port]";
        }

        return "$message [$parameters->scheme://$parameters->host:$parameters->port]";
    }
910446
protected void fail(String message) {
        failed = true;
        messageVector.add(new ValidationMessage(lastElementId, message));
    }
1142080
public static function php_number_format($number)
    {

        preg_match('/[.,](\d+)$/', $number, $matches);

        $num_decimals = strlen($matches[1]);

        return preg_replace('/[.,]/', '', $number) / pow(10, $num_decimals);
    }
386062
public function format($message) {
        $offset = 0;
        $output = '';
        $tagRegex = '[a-z][a-z0-9_=;-]*';
        preg_match_all("#<(($tagRegex) | /($tagRegex)?)>#isx", $message, $matches, PREG_OFFSET_CAPTURE);
        foreach ($matches[0] as $i => $match) {
            $pos = $match[1];
            $text = $match[0];

            if (0 != $pos && '\\' == $message[$pos - 1]) {
                continue;
            }

            $output .= $this->applyCurrentStyle(substr($message, $offset, $pos - $offset));
            $offset = $pos + strlen($text);

            if ($open = '/' != $text[1]) {
                $tag = $matches[1][$i][0];
            }
            else {
                $tag = isset($matches[3][$i][0]) ? $matches[3][$i][0] : '';
            }

            if (!$open && !$tag) {
                // </>
                $this->styleStack->pop();
            }
            elseif (false === $style = $this->createStyleFromString(strtolower($tag))) {
                $output .= $this->applyCurrentStyle($text);
            }
            elseif ($open) {
                $this->styleStack->push($style);
            }
            else {
                $this->styleStack->pop($style);
            }
        }

        $output .= $this->applyCurrentStyle(substr($message, $offset));

        return str_replace('\\<', '<', $output);
    }
920516
public function format($number, ArrayObject $row = null): string
    {
        $locale = $this->params['locale'];
        //$formatterId = md5($locale);
        $formatterId = $locale . (string) $this->params['pattern'];
        if (!array_key_exists($formatterId, $this->formatters)) {
            $this->loadFormatterId($formatterId);
        }

        if (!is_numeric($number)) {
            $this->throwNumberFormatterException($this->formatters[$formatterId], $number);
        }

        return $this->formatters[$formatterId]->format($number);
    }
1315814
public static function createMessage(string $message): string
    {
        $lastErrorMessage = error_get_last();
        if ($lastErrorMessage !== null) {
            $message .= "; ".$lastErrorMessage["message"];
        }
        return $message;
    }
795581
public static function unFormat($number)
    {
        $number = str_replace('.', 'D', $number);
        $number = str_replace(',', '', $number);
        $number = str_replace('D', '.', $number);

        return $number;
    }
757260
public static function formatColumnName($number)
    {
        for ($char = ''; $number >= 0; $number = (int) ($number / 26) - 1) {
            $char = \chr($number % 26 + 0x41) . $char;
        }

        return $char;
    }
178572
public static function c($message, $number, $args = [], $domain = 'core', $locale = 'en_EN')
    {
        return self::getInstance()->translator->transChoice($message, $number, $args, $domain, $locale);
    }
100300
public static function encode($number)
    {
        if (!is_numeric($number)) {
            throw new \RuntimeException("Specified number '{$number}' is not numeric");
        }

        if (!$number) {
            return 0;
        }

        $response = array();
        while ($number) {
            $remainder = $number % 32;
            $number = (int) ($number/32);
            $response[] = static::$symbols[$remainder];
        }

        return implode('', array_reverse($response));
    }
790906
protected void throwMessage(int number, String message)
			throws ParserException, LexException
	{
		throw new ParserException(number, message, lastToken().location, reader.getTokensRead());
	}