@@ -7,13 +7,13 @@ |
||
| 7 | 7 | */ |
| 8 | 8 | interface TokenProviderInterface |
| 9 | 9 | { |
| 10 | - /** |
|
| 11 | - * Generate and return a token |
|
| 12 | - * |
|
| 13 | - * @param string $source Source language |
|
| 14 | - * @param string $target Target language |
|
| 15 | - * @param string $text Text to translate |
|
| 16 | - * @return mixed A token |
|
| 17 | - */ |
|
| 18 | - public function generateToken($source, $target, $text); |
|
| 10 | + /** |
|
| 11 | + * Generate and return a token |
|
| 12 | + * |
|
| 13 | + * @param string $source Source language |
|
| 14 | + * @param string $target Target language |
|
| 15 | + * @param string $text Text to translate |
|
| 16 | + * @return mixed A token |
|
| 17 | + */ |
|
| 18 | + public function generateToken($source, $target, $text); |
|
| 19 | 19 | } |
@@ -7,10 +7,10 @@ |
||
| 7 | 7 | */ |
| 8 | 8 | class SampleTokenGenerator implements TokenProviderInterface |
| 9 | 9 | { |
| 10 | - /** |
|
| 11 | - * Generate a fake token just as an example |
|
| 12 | - */ |
|
| 13 | - public function generateToken($source, $target, $text) { |
|
| 14 | - return sprintf('%d.%d', rand(10000, 99999), rand(10000, 99999)); |
|
| 15 | - } |
|
| 10 | + /** |
|
| 11 | + * Generate a fake token just as an example |
|
| 12 | + */ |
|
| 13 | + public function generateToken($source, $target, $text) { |
|
| 14 | + return sprintf('%d.%d', rand(10000, 99999), rand(10000, 99999)); |
|
| 15 | + } |
|
| 16 | 16 | } |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | * @param string $source Source language |
| 19 | 19 | * @param string $target Target language |
| 20 | 20 | * @param string $text Text to translate |
| 21 | - * @return mixed A token |
|
| 21 | + * @return string A token |
|
| 22 | 22 | */ |
| 23 | 23 | public function generateToken($source, $target, $text) |
| 24 | 24 | { |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | * Process token data by applying multiple operations |
| 89 | 89 | * |
| 90 | 90 | * @param $a |
| 91 | - * @param $b |
|
| 91 | + * @param string $b |
|
| 92 | 92 | * @return int |
| 93 | 93 | */ |
| 94 | 94 | private function RL($a, $b) |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | * |
| 133 | 133 | * @param string $str |
| 134 | 134 | * @param int $index |
| 135 | - * @return null|number |
|
| 135 | + * @return string |
|
| 136 | 136 | */ |
| 137 | 137 | private function charCodeAt($str, $index) |
| 138 | 138 | { |
@@ -234,9 +234,9 @@ |
||
| 234 | 234 | throw new InvalidArgumentException("Invalid argument provided"); |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | - if($isArray){ |
|
| 237 | + if ($isArray) { |
|
| 238 | 238 | $tkdata = implode('', $data); |
| 239 | - }else{ |
|
| 239 | + } else { |
|
| 240 | 240 | $tkdata = $data; |
| 241 | 241 | } |
| 242 | 242 | |
@@ -236,7 +236,7 @@ |
||
| 236 | 236 | |
| 237 | 237 | if($isArray){ |
| 238 | 238 | $tkdata = implode('', $data); |
| 239 | - }else{ |
|
| 239 | + } else{ |
|
| 240 | 240 | $tkdata = $data; |
| 241 | 241 | } |
| 242 | 242 | |