@@ -8,15 +8,13 @@ |
||
| 8 | 8 | /** |
| 9 | 9 | * Class to get gettext strings from json. |
| 10 | 10 | */ |
| 11 | -class Json extends Extractor implements ExtractorInterface |
|
| 12 | -{ |
|
| 11 | +class Json extends Extractor implements ExtractorInterface { |
|
| 13 | 12 | use MultidimensionalArrayTrait; |
| 14 | 13 | |
| 15 | 14 | /** |
| 16 | 15 | * {@inheritdoc} |
| 17 | 16 | */ |
| 18 | - public static function fromString($string, Translations $translations, array $options = []) |
|
| 19 | - { |
|
| 17 | + public static function fromString($string, Translations $translations, array $options = []) { |
|
| 20 | 18 | $messages = json_decode($string, true); |
| 21 | 19 | |
| 22 | 20 | if (is_array($messages)) { |
@@ -9,15 +9,13 @@ |
||
| 9 | 9 | /** |
| 10 | 10 | * Class to get gettext strings from yaml. |
| 11 | 11 | */ |
| 12 | -class Yaml extends Extractor implements ExtractorInterface |
|
| 13 | -{ |
|
| 12 | +class Yaml extends Extractor implements ExtractorInterface { |
|
| 14 | 13 | use MultidimensionalArrayTrait; |
| 15 | 14 | |
| 16 | 15 | /** |
| 17 | 16 | * {@inheritdoc} |
| 18 | 17 | */ |
| 19 | - public static function fromString($string, Translations $translations, array $options = []) |
|
| 20 | - { |
|
| 18 | + public static function fromString($string, Translations $translations, array $options = []) { |
|
| 21 | 19 | $messages = YamlParser::parse($string); |
| 22 | 20 | |
| 23 | 21 | if (is_array($messages)) { |
@@ -4,8 +4,7 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Gettext\Translations; |
| 6 | 6 | |
| 7 | -interface ExtractorMultiInterface |
|
| 8 | -{ |
|
| 7 | +interface ExtractorMultiInterface { |
|
| 9 | 8 | /** |
| 10 | 9 | * Parses a string and append the translations found in the Translations instance. |
| 11 | 10 | * Allows scanning for multiple domains at a time (each Translation has to have a different domain) |
@@ -5,8 +5,7 @@ discard block |
||
| 5 | 5 | /** |
| 6 | 6 | * Class to manage a translation string. |
| 7 | 7 | */ |
| 8 | -class Translation |
|
| 9 | -{ |
|
| 8 | +class Translation { |
|
| 10 | 9 | protected $id; |
| 11 | 10 | protected $context; |
| 12 | 11 | protected $original; |
@@ -27,8 +26,7 @@ discard block |
||
| 27 | 26 | * |
| 28 | 27 | * @return string |
| 29 | 28 | */ |
| 30 | - public static function generateId($context, $original) |
|
| 31 | - { |
|
| 29 | + public static function generateId($context, $original) { |
|
| 32 | 30 | return "{$context}\004{$original}"; |
| 33 | 31 | } |
| 34 | 32 | |
@@ -42,8 +40,7 @@ discard block |
||
| 42 | 40 | * @param string $plural The original plural string |
| 43 | 41 | * @return static New Translation instance |
| 44 | 42 | */ |
| 45 | - public static function create($context, $original, $plural = '') |
|
| 46 | - { |
|
| 43 | + public static function create($context, $original, $plural = '') { |
|
| 47 | 44 | return new static($context, $original, $plural); |
| 48 | 45 | } |
| 49 | 46 | |
@@ -54,8 +51,7 @@ discard block |
||
| 54 | 51 | * @param string $original The original string |
| 55 | 52 | * @param string $plural The original plural string |
| 56 | 53 | */ |
| 57 | - public function __construct($context, $original, $plural = '') |
|
| 58 | - { |
|
| 54 | + public function __construct($context, $original, $plural = '') { |
|
| 59 | 55 | $this->context = (string) $context; |
| 60 | 56 | $this->original = (string) $original; |
| 61 | 57 | |
@@ -70,8 +66,7 @@ discard block |
||
| 70 | 66 | * |
| 71 | 67 | * @return Translation |
| 72 | 68 | */ |
| 73 | - public function getClone($context = null, $original = null) |
|
| 74 | - { |
|
| 69 | + public function getClone($context = null, $original = null) { |
|
| 75 | 70 | $new = clone $this; |
| 76 | 71 | |
| 77 | 72 | if ($context !== null) { |
@@ -92,8 +87,7 @@ discard block |
||
| 92 | 87 | * |
| 93 | 88 | * @param string $id |
| 94 | 89 | */ |
| 95 | - public function setId($id) |
|
| 96 | - { |
|
| 90 | + public function setId($id) { |
|
| 97 | 91 | $this->id = $id; |
| 98 | 92 | } |
| 99 | 93 | |
@@ -103,8 +97,7 @@ discard block |
||
| 103 | 97 | * |
| 104 | 98 | * @return string |
| 105 | 99 | */ |
| 106 | - public function getId() |
|
| 107 | - { |
|
| 100 | + public function getId() { |
|
| 108 | 101 | if ($this->id === null) { |
| 109 | 102 | return static::generateId($this->context, $this->original); |
| 110 | 103 | } |
@@ -119,8 +112,7 @@ discard block |
||
| 119 | 112 | * |
| 120 | 113 | * @return bool |
| 121 | 114 | */ |
| 122 | - public function is($context, $original = '') |
|
| 123 | - { |
|
| 115 | + public function is($context, $original = '') { |
|
| 124 | 116 | return (($this->context === $context) && ($this->original === $original)) ? true : false; |
| 125 | 117 | } |
| 126 | 118 | |
@@ -131,8 +123,7 @@ discard block |
||
| 131 | 123 | * |
| 132 | 124 | * @return self |
| 133 | 125 | */ |
| 134 | - public function setDisabled($disabled) |
|
| 135 | - { |
|
| 126 | + public function setDisabled($disabled) { |
|
| 136 | 127 | $this->disabled = (bool) $disabled; |
| 137 | 128 | |
| 138 | 129 | return $this; |
@@ -143,8 +134,7 @@ discard block |
||
| 143 | 134 | * |
| 144 | 135 | * @return bool |
| 145 | 136 | */ |
| 146 | - public function isDisabled() |
|
| 147 | - { |
|
| 137 | + public function isDisabled() { |
|
| 148 | 138 | return $this->disabled; |
| 149 | 139 | } |
| 150 | 140 | |
@@ -153,8 +143,7 @@ discard block |
||
| 153 | 143 | * |
| 154 | 144 | * @return string |
| 155 | 145 | */ |
| 156 | - public function getOriginal() |
|
| 157 | - { |
|
| 146 | + public function getOriginal() { |
|
| 158 | 147 | return $this->original; |
| 159 | 148 | } |
| 160 | 149 | |
@@ -163,8 +152,7 @@ discard block |
||
| 163 | 152 | * |
| 164 | 153 | * @return bool |
| 165 | 154 | */ |
| 166 | - public function hasOriginal() |
|
| 167 | - { |
|
| 155 | + public function hasOriginal() { |
|
| 168 | 156 | return ($this->original !== '') ? true : false; |
| 169 | 157 | } |
| 170 | 158 | |
@@ -175,8 +163,7 @@ discard block |
||
| 175 | 163 | * |
| 176 | 164 | * @return self |
| 177 | 165 | */ |
| 178 | - public function setTranslation($translation) |
|
| 179 | - { |
|
| 166 | + public function setTranslation($translation) { |
|
| 180 | 167 | $this->translation = (string) $translation; |
| 181 | 168 | |
| 182 | 169 | return $this; |
@@ -187,8 +174,7 @@ discard block |
||
| 187 | 174 | * |
| 188 | 175 | * @return string |
| 189 | 176 | */ |
| 190 | - public function getTranslation() |
|
| 191 | - { |
|
| 177 | + public function getTranslation() { |
|
| 192 | 178 | return $this->translation; |
| 193 | 179 | } |
| 194 | 180 | |
@@ -197,8 +183,7 @@ discard block |
||
| 197 | 183 | * |
| 198 | 184 | * @return bool |
| 199 | 185 | */ |
| 200 | - public function hasTranslation() |
|
| 201 | - { |
|
| 186 | + public function hasTranslation() { |
|
| 202 | 187 | return ($this->translation !== '') ? true : false; |
| 203 | 188 | } |
| 204 | 189 | |
@@ -209,8 +194,7 @@ discard block |
||
| 209 | 194 | * |
| 210 | 195 | * @return self |
| 211 | 196 | */ |
| 212 | - public function setPlural($plural) |
|
| 213 | - { |
|
| 197 | + public function setPlural($plural) { |
|
| 214 | 198 | $this->plural = (string) $plural; |
| 215 | 199 | |
| 216 | 200 | return $this; |
@@ -221,8 +205,7 @@ discard block |
||
| 221 | 205 | * |
| 222 | 206 | * @return string |
| 223 | 207 | */ |
| 224 | - public function getPlural() |
|
| 225 | - { |
|
| 208 | + public function getPlural() { |
|
| 226 | 209 | return $this->plural; |
| 227 | 210 | } |
| 228 | 211 | |
@@ -231,8 +214,7 @@ discard block |
||
| 231 | 214 | * |
| 232 | 215 | * @return bool |
| 233 | 216 | */ |
| 234 | - public function hasPlural() |
|
| 235 | - { |
|
| 217 | + public function hasPlural() { |
|
| 236 | 218 | return ($this->plural !== '') ? true : false; |
| 237 | 219 | } |
| 238 | 220 | |
@@ -243,8 +225,7 @@ discard block |
||
| 243 | 225 | * |
| 244 | 226 | * @return self |
| 245 | 227 | */ |
| 246 | - public function setPluralTranslations(array $plural) |
|
| 247 | - { |
|
| 228 | + public function setPluralTranslations(array $plural) { |
|
| 248 | 229 | $this->pluralTranslation = $plural; |
| 249 | 230 | |
| 250 | 231 | return $this; |
@@ -257,8 +238,7 @@ discard block |
||
| 257 | 238 | * |
| 258 | 239 | * @return array |
| 259 | 240 | */ |
| 260 | - public function getPluralTranslations($size = null) |
|
| 261 | - { |
|
| 241 | + public function getPluralTranslations($size = null) { |
|
| 262 | 242 | if ($size === null) { |
| 263 | 243 | return $this->pluralTranslation; |
| 264 | 244 | } |
@@ -283,8 +263,7 @@ discard block |
||
| 283 | 263 | * |
| 284 | 264 | * @return bool |
| 285 | 265 | */ |
| 286 | - public function hasPluralTranslations($checkContent = false) |
|
| 287 | - { |
|
| 266 | + public function hasPluralTranslations($checkContent = false) { |
|
| 288 | 267 | if ($checkContent) { |
| 289 | 268 | return implode('', $this->pluralTranslation) !== ''; |
| 290 | 269 | } |
@@ -297,8 +276,7 @@ discard block |
||
| 297 | 276 | * |
| 298 | 277 | * @return self |
| 299 | 278 | */ |
| 300 | - public function deletePluralTranslation() |
|
| 301 | - { |
|
| 279 | + public function deletePluralTranslation() { |
|
| 302 | 280 | $this->pluralTranslation = []; |
| 303 | 281 | |
| 304 | 282 | return $this; |
@@ -309,8 +287,7 @@ discard block |
||
| 309 | 287 | * |
| 310 | 288 | * @return string |
| 311 | 289 | */ |
| 312 | - public function getContext() |
|
| 313 | - { |
|
| 290 | + public function getContext() { |
|
| 314 | 291 | return $this->context; |
| 315 | 292 | } |
| 316 | 293 | |
@@ -319,8 +296,7 @@ discard block |
||
| 319 | 296 | * |
| 320 | 297 | * @return bool |
| 321 | 298 | */ |
| 322 | - public function hasContext() |
|
| 323 | - { |
|
| 299 | + public function hasContext() { |
|
| 324 | 300 | return (isset($this->context) && ($this->context !== '')) ? true : false; |
| 325 | 301 | } |
| 326 | 302 | |
@@ -332,8 +308,7 @@ discard block |
||
| 332 | 308 | * |
| 333 | 309 | * @return self |
| 334 | 310 | */ |
| 335 | - public function addReference($filename, $line = null) |
|
| 336 | - { |
|
| 311 | + public function addReference($filename, $line = null) { |
|
| 337 | 312 | $key = "{$filename}:{$line}"; |
| 338 | 313 | $this->references[$key] = [$filename, $line]; |
| 339 | 314 | |
@@ -345,8 +320,7 @@ discard block |
||
| 345 | 320 | * |
| 346 | 321 | * @return bool |
| 347 | 322 | */ |
| 348 | - public function hasReferences() |
|
| 349 | - { |
|
| 323 | + public function hasReferences() { |
|
| 350 | 324 | return !empty($this->references); |
| 351 | 325 | } |
| 352 | 326 | |
@@ -355,8 +329,7 @@ discard block |
||
| 355 | 329 | * |
| 356 | 330 | * @return array |
| 357 | 331 | */ |
| 358 | - public function getReferences() |
|
| 359 | - { |
|
| 332 | + public function getReferences() { |
|
| 360 | 333 | return array_values($this->references); |
| 361 | 334 | } |
| 362 | 335 | |
@@ -365,8 +338,7 @@ discard block |
||
| 365 | 338 | * |
| 366 | 339 | * @return self |
| 367 | 340 | */ |
| 368 | - public function deleteReferences() |
|
| 369 | - { |
|
| 341 | + public function deleteReferences() { |
|
| 370 | 342 | $this->references = []; |
| 371 | 343 | |
| 372 | 344 | return $this; |
@@ -379,8 +351,7 @@ discard block |
||
| 379 | 351 | * |
| 380 | 352 | * @return self |
| 381 | 353 | */ |
| 382 | - public function addComment($comment) |
|
| 383 | - { |
|
| 354 | + public function addComment($comment) { |
|
| 384 | 355 | if (!in_array($comment, $this->comments, true)) { |
| 385 | 356 | $this->comments[] = $comment; |
| 386 | 357 | } |
@@ -393,8 +364,7 @@ discard block |
||
| 393 | 364 | * |
| 394 | 365 | * @return bool |
| 395 | 366 | */ |
| 396 | - public function hasComments() |
|
| 397 | - { |
|
| 367 | + public function hasComments() { |
|
| 398 | 368 | return isset($this->comments[0]); |
| 399 | 369 | } |
| 400 | 370 | |
@@ -403,8 +373,7 @@ discard block |
||
| 403 | 373 | * |
| 404 | 374 | * @return array |
| 405 | 375 | */ |
| 406 | - public function getComments() |
|
| 407 | - { |
|
| 376 | + public function getComments() { |
|
| 408 | 377 | return $this->comments; |
| 409 | 378 | } |
| 410 | 379 | |
@@ -413,8 +382,7 @@ discard block |
||
| 413 | 382 | * |
| 414 | 383 | * @return self |
| 415 | 384 | */ |
| 416 | - public function deleteComments() |
|
| 417 | - { |
|
| 385 | + public function deleteComments() { |
|
| 418 | 386 | $this->comments = []; |
| 419 | 387 | |
| 420 | 388 | return $this; |
@@ -427,8 +395,7 @@ discard block |
||
| 427 | 395 | * |
| 428 | 396 | * @return self |
| 429 | 397 | */ |
| 430 | - public function addExtractedComment($comment) |
|
| 431 | - { |
|
| 398 | + public function addExtractedComment($comment) { |
|
| 432 | 399 | if (!in_array($comment, $this->extractedComments, true)) { |
| 433 | 400 | $this->extractedComments[] = $comment; |
| 434 | 401 | } |
@@ -441,8 +408,7 @@ discard block |
||
| 441 | 408 | * |
| 442 | 409 | * @return bool |
| 443 | 410 | */ |
| 444 | - public function hasExtractedComments() |
|
| 445 | - { |
|
| 411 | + public function hasExtractedComments() { |
|
| 446 | 412 | return isset($this->extractedComments[0]); |
| 447 | 413 | } |
| 448 | 414 | |
@@ -451,8 +417,7 @@ discard block |
||
| 451 | 417 | * |
| 452 | 418 | * @return array |
| 453 | 419 | */ |
| 454 | - public function getExtractedComments() |
|
| 455 | - { |
|
| 420 | + public function getExtractedComments() { |
|
| 456 | 421 | return $this->extractedComments; |
| 457 | 422 | } |
| 458 | 423 | |
@@ -461,8 +426,7 @@ discard block |
||
| 461 | 426 | * |
| 462 | 427 | * @return self |
| 463 | 428 | */ |
| 464 | - public function deleteExtractedComments() |
|
| 465 | - { |
|
| 429 | + public function deleteExtractedComments() { |
|
| 466 | 430 | $this->extractedComments = []; |
| 467 | 431 | |
| 468 | 432 | return $this; |
@@ -475,8 +439,7 @@ discard block |
||
| 475 | 439 | * |
| 476 | 440 | * @return self |
| 477 | 441 | */ |
| 478 | - public function addFlag($flag) |
|
| 479 | - { |
|
| 442 | + public function addFlag($flag) { |
|
| 480 | 443 | if (!in_array($flag, $this->flags, true)) { |
| 481 | 444 | $this->flags[] = $flag; |
| 482 | 445 | } |
@@ -489,8 +452,7 @@ discard block |
||
| 489 | 452 | * |
| 490 | 453 | * @return bool |
| 491 | 454 | */ |
| 492 | - public function hasFlags() |
|
| 493 | - { |
|
| 455 | + public function hasFlags() { |
|
| 494 | 456 | return isset($this->flags[0]); |
| 495 | 457 | } |
| 496 | 458 | |
@@ -499,8 +461,7 @@ discard block |
||
| 499 | 461 | * |
| 500 | 462 | * @return array |
| 501 | 463 | */ |
| 502 | - public function getFlags() |
|
| 503 | - { |
|
| 464 | + public function getFlags() { |
|
| 504 | 465 | return $this->flags; |
| 505 | 466 | } |
| 506 | 467 | |
@@ -509,8 +470,7 @@ discard block |
||
| 509 | 470 | * |
| 510 | 471 | * @return self |
| 511 | 472 | */ |
| 512 | - public function deleteFlags() |
|
| 513 | - { |
|
| 473 | + public function deleteFlags() { |
|
| 514 | 474 | $this->flags = []; |
| 515 | 475 | |
| 516 | 476 | return $this; |
@@ -524,8 +484,7 @@ discard block |
||
| 524 | 484 | * |
| 525 | 485 | * @return self |
| 526 | 486 | */ |
| 527 | - public function mergeWith(Translation $translation, $options = Merge::DEFAULTS) |
|
| 528 | - { |
|
| 487 | + public function mergeWith(Translation $translation, $options = Merge::DEFAULTS) { |
|
| 529 | 488 | Merge::mergeTranslation($translation, $this, $options); |
| 530 | 489 | Merge::mergeReferences($translation, $this, $options); |
| 531 | 490 | Merge::mergeComments($translation, $this, $options); |
@@ -2,8 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | namespace Illuminate\Support; |
| 4 | 4 | |
| 5 | -class HigherOrderTapProxy |
|
| 6 | -{ |
|
| 5 | +class HigherOrderTapProxy { |
|
| 7 | 6 | /** |
| 8 | 7 | * The target being tapped. |
| 9 | 8 | * |
@@ -17,8 +16,7 @@ discard block |
||
| 17 | 16 | * @param mixed $target |
| 18 | 17 | * @return void |
| 19 | 18 | */ |
| 20 | - public function __construct($target) |
|
| 21 | - { |
|
| 19 | + public function __construct($target) { |
|
| 22 | 20 | $this->target = $target; |
| 23 | 21 | } |
| 24 | 22 | |
@@ -29,8 +27,7 @@ discard block |
||
| 29 | 27 | * @param array $parameters |
| 30 | 28 | * @return mixed |
| 31 | 29 | */ |
| 32 | - public function __call($method, $parameters) |
|
| 33 | - { |
|
| 30 | + public function __call($method, $parameters) { |
|
| 34 | 31 | $this->target->{$method}(...$parameters); |
| 35 | 32 | |
| 36 | 33 | return $this->target; |
@@ -31,15 +31,13 @@ |
||
| 31 | 31 | * @see \Illuminate\Session\SessionManager |
| 32 | 32 | * @see \Illuminate\Session\Store |
| 33 | 33 | */ |
| 34 | -class Session extends Facade |
|
| 35 | -{ |
|
| 34 | +class Session extends Facade { |
|
| 36 | 35 | /** |
| 37 | 36 | * Get the registered name of the component. |
| 38 | 37 | * |
| 39 | 38 | * @return string |
| 40 | 39 | */ |
| 41 | - protected static function getFacadeAccessor() |
|
| 42 | - { |
|
| 40 | + protected static function getFacadeAccessor() { |
|
| 43 | 41 | return 'session'; |
| 44 | 42 | } |
| 45 | 43 | } |
@@ -45,15 +45,13 @@ |
||
| 45 | 45 | * |
| 46 | 46 | * @see \Illuminate\Routing\Router |
| 47 | 47 | */ |
| 48 | -class Route extends Facade |
|
| 49 | -{ |
|
| 48 | +class Route extends Facade { |
|
| 50 | 49 | /** |
| 51 | 50 | * Get the registered name of the component. |
| 52 | 51 | * |
| 53 | 52 | * @return string |
| 54 | 53 | */ |
| 55 | - protected static function getFacadeAccessor() |
|
| 56 | - { |
|
| 54 | + protected static function getFacadeAccessor() { |
|
| 57 | 55 | return 'router'; |
| 58 | 56 | } |
| 59 | 57 | } |
@@ -10,15 +10,13 @@ |
||
| 10 | 10 | * @see \Illuminate\Redis\RedisManager |
| 11 | 11 | * @see \Illuminate\Contracts\Redis\Factory |
| 12 | 12 | */ |
| 13 | -class Redis extends Facade |
|
| 14 | -{ |
|
| 13 | +class Redis extends Facade { |
|
| 15 | 14 | /** |
| 16 | 15 | * Get the registered name of the component. |
| 17 | 16 | * |
| 18 | 17 | * @return string |
| 19 | 18 | */ |
| 20 | - protected static function getFacadeAccessor() |
|
| 21 | - { |
|
| 19 | + protected static function getFacadeAccessor() { |
|
| 22 | 20 | return 'redis'; |
| 23 | 21 | } |
| 24 | 22 | } |
@@ -26,15 +26,13 @@ |
||
| 26 | 26 | * @see \Illuminate\Cache\CacheManager |
| 27 | 27 | * @see \Illuminate\Cache\Repository |
| 28 | 28 | */ |
| 29 | -class Cache extends Facade |
|
| 30 | -{ |
|
| 29 | +class Cache extends Facade { |
|
| 31 | 30 | /** |
| 32 | 31 | * Get the registered name of the component. |
| 33 | 32 | * |
| 34 | 33 | * @return string |
| 35 | 34 | */ |
| 36 | - protected static function getFacadeAccessor() |
|
| 37 | - { |
|
| 35 | + protected static function getFacadeAccessor() { |
|
| 38 | 36 | return 'cache'; |
| 39 | 37 | } |
| 40 | 38 | } |