|
@@ -91,7 +91,7 @@ discard block |
|
|
block discarded – undo |
|
91
|
91
|
// translate($message, int $count, array $params, string $lang = null) |
|
92
|
92
|
// translate($message, array $params, string $lang = null) |
|
93
|
93
|
|
|
94
|
|
- $message = (string)$message; |
|
|
94
|
+ $message = (string) $message; |
|
95
|
95
|
|
|
96
|
96
|
$this->recordTranslate->save($message); |
|
97
|
97
|
|
|
@@ -99,7 +99,7 @@ discard block |
|
|
block discarded – undo |
|
99
|
99
|
|
|
100
|
100
|
// If wrong input arguments passed, return message key |
|
101
|
101
|
if (!is_int($count) || !is_array($params) || !is_string($lang)) { |
|
102
|
|
- Arrays::invoke($this->onTranslate, $this, $message, $message, $lang, (int)strval($count), (array)$params); |
|
|
102
|
+ Arrays::invoke($this->onTranslate, $this, $message, $message, $lang, (int) strval($count), (array) $params); |
|
103
|
103
|
return $message; // @ maybe throw exception? |
|
104
|
104
|
} |
|
105
|
105
|
|
|
@@ -172,7 +172,7 @@ discard block |
|
|
block discarded – undo |
|
172
|
172
|
$match = str_replace(['{', '}', ' '], '', trim($match)); |
|
173
|
173
|
$foundCountArray = explode(',', $match); |
|
174
|
174
|
foreach ($foundCountArray as $foundCount) { |
|
175
|
|
- if ($count === (int)$foundCount) { |
|
|
175
|
+ if ($count === (int) $foundCount) { |
|
176
|
176
|
return $translationForm; |
|
177
|
177
|
} |
|
178
|
178
|
} |
|
@@ -187,8 +187,8 @@ discard block |
|
|
block discarded – undo |
|
187
|
187
|
$rangeArray = explode(',', $range); |
|
188
|
188
|
$fromRaw = str_replace(' ', '', $rangeArray[0]); |
|
189
|
189
|
$toRaw = str_replace(' ', '', $rangeArray[1]); |
|
190
|
|
- $from = $fromRaw === '-Inf' ? PHP_INT_MIN : (int)$fromRaw; |
|
191
|
|
- $to = ($toRaw === 'Inf' || $toRaw === '+Inf') ? PHP_INT_MAX : (int)$toRaw; |
|
|
190
|
+ $from = $fromRaw === '-Inf' ? PHP_INT_MIN : (int) $fromRaw; |
|
|
191
|
+ $to = ($toRaw === 'Inf' || $toRaw === '+Inf') ? PHP_INT_MAX : (int) $toRaw; |
|
192
|
192
|
if (($startChar === '[' && $endChar === ']' && $from <= $count && $count <= $to) || |
|
193
|
193
|
($startChar === ']' && $endChar === ']' && $from < $count && $count <= $to) || |
|
194
|
194
|
($startChar === ']' && $endChar === '[' && $from < $count && $count < $to) || |