|
60 | 60 | use function array_merge; |
61 | 61 | use function func_num_args; |
62 | 62 | use function in_array; |
| 63 | +use function is_int; |
63 | 64 | use function is_object; |
64 | 65 | use function sprintf; |
65 | 66 | use function strtoupper; |
@@ -510,13 +511,33 @@ public function overrideOutputFormat(string $outputFormat = null): self |
510 | 511 | /** |
511 | 512 | * Set MetaModel and render settings. |
512 | 513 | * |
513 | | - * @param string $intMetaModel The MetaModel to use. |
514 | | - * @param string $intView The render settings to use (if 0, the default will be used). |
| 514 | + * @param string|int $intMetaModel The MetaModel to use. |
| 515 | + * @param string|int $intView The render settings to use (if 0, the default will be used). |
515 | 516 | * |
516 | 517 | * @return ItemList |
517 | 518 | */ |
518 | | - public function setMetaModel(string $intMetaModel, string $intView): self |
| 519 | + public function setMetaModel(string|int $intMetaModel, string|int $intView): self |
519 | 520 | { |
| 521 | + if (is_int($intMetaModel)) { |
| 522 | + $intMetaModel = (string) $intMetaModel; |
| 523 | + // @codingStandardsIgnoreStart Silencing errors is discouraged |
| 524 | + @trigger_error( |
| 525 | + 'Parameter $intMetaModel in "' . __CLASS__ . '::' .__METHOD__. '" has been changed from int to string.', |
| 526 | + E_USER_DEPRECATED |
| 527 | + ); |
| 528 | + // @codingStandardsIgnoreEnd |
| 529 | + } |
| 530 | + |
| 531 | + if (is_int($intView)) { |
| 532 | + $intView = (string) $intView; |
| 533 | + // @codingStandardsIgnoreStart Silencing errors is discouraged |
| 534 | + @trigger_error( |
| 535 | + 'Parameter $intView in "' . __CLASS__ . '::' .__METHOD__. '" has been changed from int to string.', |
| 536 | + E_USER_DEPRECATED |
| 537 | + ); |
| 538 | + // @codingStandardsIgnoreEnd |
| 539 | + } |
| 540 | + |
520 | 541 | $this->intMetaModel = $intMetaModel; |
521 | 542 | $this->intView = $intView; |
522 | 543 |
|
@@ -663,14 +684,24 @@ protected function prepareView(): void |
663 | 684 | /** |
664 | 685 | * Set the filter setting to use. |
665 | 686 | * |
666 | | - * @param string $intFilter The filter setting id to use. |
| 687 | + * @param string|int $intFilter The filter setting id to use. |
667 | 688 | * |
668 | 689 | * @return $this |
669 | 690 | * |
670 | 691 | * @throws RuntimeException When the filter settings can not be found. |
671 | 692 | */ |
672 | | - public function setFilterSettings(string $intFilter): self |
| 693 | + public function setFilterSettings(string|int $intFilter): self |
673 | 694 | { |
| 695 | + if (is_int($intFilter)) { |
| 696 | + $intFilter = (string) $intFilter; |
| 697 | + // @codingStandardsIgnoreStart Silencing errors is discouraged |
| 698 | + @trigger_error( |
| 699 | + 'Parameter $intFilter in "' . __CLASS__ . '::' .__METHOD__. '" has been changed from int to string.', |
| 700 | + E_USER_DEPRECATED |
| 701 | + ); |
| 702 | + // @codingStandardsIgnoreEnd |
| 703 | + } |
| 704 | + |
674 | 705 | $this->objFilterSettings = $this->getFilterFactory()->createCollection($intFilter); |
675 | 706 |
|
676 | 707 | return $this; |
|
0 commit comments