|
@@ -80,12 +80,12 @@ discard block |
|
|
block discarded – undo |
|
80
|
80
|
// translate($message, int $count, array $params, string $lang = null) |
|
81
|
81
|
// translate($message, array $params, string $lang = null) |
|
82
|
82
|
|
|
83
|
|
- $message = (string)$message; |
|
|
83
|
+ $message = (string) $message; |
|
84
|
84
|
list($count, $params, $lang) = array_values($this->parseParameters($parameters)); |
|
85
|
85
|
|
|
86
|
86
|
// If wrong input arguments passed, return message key |
|
87
|
87
|
if (!is_int($count) || !is_array($params) || !is_string($lang)) { |
|
88
|
|
- Arrays::invoke($this->onTranslate, $this, $message, $message, $lang, (int)strval($count), (array)$params); |
|
|
88
|
+ Arrays::invoke($this->onTranslate, $this, $message, $message, $lang, (int) strval($count), (array) $params); |
|
89
|
89
|
return $message; // @ maybe throw exception? |
|
90
|
90
|
} |
|
91
|
91
|
|
|
@@ -145,7 +145,7 @@ discard block |
|
|
block discarded – undo |
|
145
|
145
|
$match = str_replace(['{', '}', ' '], '', trim($match)); |
|
146
|
146
|
$foundCountArray = explode(',', $match); |
|
147
|
147
|
foreach ($foundCountArray as $foundCount) { |
|
148
|
|
- if ($count === (int)$foundCount) { |
|
|
148
|
+ if ($count === (int) $foundCount) { |
|
149
|
149
|
return $translationForm; |
|
150
|
150
|
} |
|
151
|
151
|
} |
|
@@ -160,8 +160,8 @@ discard block |
|
|
block discarded – undo |
|
160
|
160
|
$rangeArray = explode(',', $range); |
|
161
|
161
|
$fromRaw = str_replace(' ', '', $rangeArray[0]); |
|
162
|
162
|
$toRaw = str_replace(' ', '', $rangeArray[1]); |
|
163
|
|
- $from = $fromRaw === '-Inf' ? PHP_INT_MIN : (int)$fromRaw; |
|
164
|
|
- $to = ($toRaw === 'Inf' || $toRaw === '+Inf') ? PHP_INT_MAX : (int)$toRaw; |
|
|
163
|
+ $from = $fromRaw === '-Inf' ? PHP_INT_MIN : (int) $fromRaw; |
|
|
164
|
+ $to = ($toRaw === 'Inf' || $toRaw === '+Inf') ? PHP_INT_MAX : (int) $toRaw; |
|
165
|
165
|
if ( |
|
166
|
166
|
($startChar === '[' && $endChar === ']' && $from <= $count && $count <= $to) || |
|
167
|
167
|
($startChar === ']' && $endChar === ']' && $from < $count && $count <= $to) || |