| @@ 126-131 (lines=6) @@ | ||
| 123 | return $this; |
|
| 124 | } |
|
| 125 | ||
| 126 | if (!is_numeric($position)) { |
|
| 127 | throw new InvalidArgumentException(sprintf( |
|
| 128 | 'Position must be an integer, received %s', |
|
| 129 | is_object($position) ? get_class($position) : gettype($position) |
|
| 130 | )); |
|
| 131 | } |
|
| 132 | ||
| 133 | $this->position = (int)$position; |
|
| 134 | return $this; |
|
| @@ 457-462 (lines=6) @@ | ||
| 454 | { |
|
| 455 | if ($lang === null) { |
|
| 456 | $lang = $this->translator()->getLocale(); |
|
| 457 | } elseif (!in_array($lang, $this->translator()->availableLocales())) { |
|
| 458 | throw new InvalidArgumentException(sprintf( |
|
| 459 | 'Invalid language, received %s', |
|
| 460 | (is_object($lang) ? get_class($lang) : gettype($lang)) |
|
| 461 | )); |
|
| 462 | } |
|
| 463 | ||
| 464 | if (!$this->objType() || !$this->id()) { |
|
| 465 | return $this->createRouteObject(); |
|