Skip to content

Commit 9d19b8e

Browse files
committed
[skip ci] Update method signatures for PHP 7.1+ type hints
Replaces explicit class type hints with nullable and 'mixed' types in several method signatures to improve compatibility with PHP 7.1+ type hinting. Affects HtmlDoubleElement, Sidebar, TableTrait, HtmlInput, and DataTable classes.
1 parent 577cb1f commit 9d19b8e

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

Ajax/common/html/HtmlDoubleElement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public function asEditable(HtmlFormField $field, $asForm = false, $setValuePrope
151151
* {@inheritdoc}
152152
* @see \Ajax\common\html\BaseHtml::compile_once()
153153
*/
154-
protected function compile_once(\Ajax\JsUtils $js = NULL, &$view = NULL) {
154+
protected function compile_once(?\Ajax\JsUtils $js = NULL, mixed &$view = NULL) {
155155
if (! $this->_compiled && isset($this->_editableContent)) {
156156
$this->wrap("", $this->_editableContent);
157157
}

Ajax/semantic/components/Sidebar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
class Sidebar extends SimpleSemExtComponent {
1616

17-
public function __construct(JsUtils $js = NULL) {
17+
public function __construct(?JsUtils $js = NULL) {
1818
parent::__construct($js);
1919
$this->uiName = 'sidebar';
2020
}

Ajax/semantic/html/collections/table/traits/TableTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public function getEventsScript() {
120120
return $this->_self->getBsComponent()->getScript();
121121
}
122122

123-
public function addEventsOnRun(JsUtils $js = NULL) {
123+
public function addEventsOnRun(?JsUtils $js = NULL) {
124124
$script = parent::addEventsOnRun($js);
125125
$innerScript = $this->_self->getInnerScript();
126126
if (! isset($innerScript)) {

Ajax/semantic/html/elements/HtmlInput.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function setTransparent() {
5858
return $this->addToProperty("class", "transparent");
5959
}
6060

61-
public function compile_once(\Ajax\JsUtils $js = NULL, &$view = NULL) {
61+
public function compile_once(?\Ajax\JsUtils $js = NULL, mixed &$view = NULL) {
6262
parent::compile_once($js, $view);
6363
if (isset($this->content['file'])) {
6464
$this->onCreate(Javascript::fileUploadBehavior($this->identifier));

Ajax/semantic/widgets/datatable/DataTable.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ protected function _generatePagination($table) {
330330
$footer->addValues($this->_paginationToolbar);
331331
}
332332

333-
protected function _associatePaginationBehavior(JsUtils $js = NULL, $offset = null) {
333+
protected function _associatePaginationBehavior(?JsUtils $js = NULL, $offset = null) {
334334
if (isset($this->_urls["refresh"])) {
335335
$menu = $this->_pagination->getMenu();
336336
if (isset($menu) && isset($js)) {
@@ -349,7 +349,7 @@ protected function _associatePaginationBehavior(JsUtils $js = NULL, $offset = nu
349349
}
350350
}
351351

352-
protected function _compileSearchFieldBehavior(JsUtils $js = NULL) {
352+
protected function _compileSearchFieldBehavior(?JsUtils $js = NULL) {
353353
if (isset($this->_searchField) && isset($js) && isset($this->_urls["refresh"])) {
354354
$this->_searchField->postOn("change", $this->_urls["refresh"], "{'s':$(self).val(),'_model':'" . JString::doubleBackSlashes($this->_model) . "'}", "#" . $this->identifier . " tbody", [
355355
"preventDefault" => false,
@@ -360,7 +360,7 @@ protected function _compileSearchFieldBehavior(JsUtils $js = NULL) {
360360
}
361361
}
362362

363-
protected function _associateSearchFieldBehavior(JsUtils $js = NULL, $offset = null) {}
363+
protected function _associateSearchFieldBehavior(?JsUtils $js = NULL, $offset = null) {}
364364

365365
protected function _getFieldName($index) {
366366
$fieldName = parent::_getFieldName($index);

0 commit comments

Comments
 (0)