Skip to content

Commit 67ea594

Browse files
committed
[skip ci] Update type hints for JsUtils and view parameters
Refactored method signatures in BaseGui, BaseComponent, and BaseHtml to use nullable and mixed type hints for JsUtils and view parameters, improving type safety and compatibility with PHP 7.1+.
1 parent 1c97555 commit 67ea594

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Ajax/common/BaseGui.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function addHtmlComponent(BaseHtml $htmlComponent) {
8080
return $htmlComponent;
8181
}
8282

83-
public function compileHtml(JsUtils $js = NULL, &$view = NULL) {
83+
public function compileHtml(?JsUtils $js = NULL, mixed &$view = NULL) {
8484
foreach ($this->htmlComponents as $htmlComponent) {
8585
$htmlComponent->compile($js, $view);
8686
}

Ajax/common/components/BaseComponent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ abstract class BaseComponent {
1919
*/
2020
protected $js;
2121

22-
public function __construct(JsUtils $js=NULL) {
22+
public function __construct(?JsUtils $js=NULL) {
2323
$this->js=$js;
2424
}
2525

Ajax/common/html/BaseHtml.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ private function _callSetter($setter, $key, $value, &$array) {
5656
return $result;
5757
}
5858

59-
protected function getTemplate(JsUtils $js = NULL, $view = null) {
59+
protected function getTemplate(?JsUtils $js = NULL, mixed $view = null): string {
6060
return PropertyWrapper::wrap($this->_wrapBefore, $js, $view) . $this->_template . PropertyWrapper::wrap($this->_wrapAfter, $js, $view);
6161
}
6262

0 commit comments

Comments
 (0)