diff --git a/wire/core/PageArrayIterator.php b/wire/core/PageArrayIterator.php index aca629ff..c20f3e56 100644 --- a/wire/core/PageArrayIterator.php +++ b/wire/core/PageArrayIterator.php @@ -135,6 +135,7 @@ class PageArrayIterator extends Wire implements \Iterator { * Rewind to beginning * */ + #[\ReturnTypeWillChange] public function rewind() { $this->pagesPosition = 0; $this->position = 0; @@ -149,6 +150,7 @@ class PageArrayIterator extends Wire implements \Iterator { * @return Page * */ + #[\ReturnTypeWillChange] public function current() { return $this->pages[$this->pagesPosition]; } @@ -159,6 +161,7 @@ class PageArrayIterator extends Wire implements \Iterator { * @return int * */ + #[\ReturnTypeWillChange] public function key() { return $this->position; } @@ -167,6 +170,7 @@ class PageArrayIterator extends Wire implements \Iterator { * Update current position to next * */ + #[\ReturnTypeWillChange] public function next() { $this->pagesPosition++; $this->position++; @@ -178,6 +182,7 @@ class PageArrayIterator extends Wire implements \Iterator { * @return bool * */ + #[\ReturnTypeWillChange] public function valid() { if($this->position === 0 || $this->pagesPosition >= $this->pagesCount) { // If we have just been rewound or if we have reached the end of the buffer, diff --git a/wire/core/PagesEditor.php b/wire/core/PagesEditor.php index ea0f2167..29744433 100644 --- a/wire/core/PagesEditor.php +++ b/wire/core/PagesEditor.php @@ -369,7 +369,7 @@ class PagesEditor extends Wire { foreach($page->template->fieldgroup as $field) { if($page->isLoaded($field->name)) continue; // value already set if(!$page->hasField($field)) continue; // field not valid for page - if(!strlen($field->defaultValue)) continue; // no defaultValue property defined with Fieldtype config inputfields + if(!strlen("$field->defaultValue")) continue; // no defaultValue property defined with Fieldtype config inputfields try { $blankValue = $field->type->getBlankValue($page, $field); if(is_object($blankValue) || is_array($blankValue)) continue; // we don't currently handle complex types diff --git a/wire/core/PagesType.php b/wire/core/PagesType.php index fe7cf216..08e65053 100644 --- a/wire/core/PagesType.php +++ b/wire/core/PagesType.php @@ -622,6 +622,7 @@ class PagesType extends Wire implements \IteratorAggregate, \Countable { * @see Pages::count() * */ + #[\ReturnTypeWillChange] public function count($selectorString = '', array $options = array()) { if(empty($selectorString) && empty($options) && count($this->parents) == 1) { return $this->getParent()->numChildren(); diff --git a/wire/core/WireDateTime.php b/wire/core/WireDateTime.php index 09611a8e..59725284 100644 --- a/wire/core/WireDateTime.php +++ b/wire/core/WireDateTime.php @@ -266,7 +266,7 @@ class WireDateTime extends Wire { public function formatDate($value, $format) { if(!$value) return ''; - if(!strlen($format) || $format == 'U' || $format == '%s') return (int) $value; // unix timestamp + if(!strlen("$format") || $format === 'U' || $format === '%s') return (int) $value; // unix timestamp $relativeStr = ''; if(strpos($format, '!') !== false) { diff --git a/wire/modules/Process/ProcessPageLister/ProcessPageLister.module b/wire/modules/Process/ProcessPageLister/ProcessPageLister.module index cc5101c4..f5c25e4c 100644 --- a/wire/modules/Process/ProcessPageLister/ProcessPageLister.module +++ b/wire/modules/Process/ProcessPageLister/ProcessPageLister.module @@ -504,7 +504,7 @@ class ProcessPageLister extends Process implements ConfigurableModule { if(in_array('disableFilters', $this->toggles)) { $s->attr('disabled', 'disabled'); } - $selector = $this->sessionGet('selector'); + $selector = (string) $this->sessionGet('selector'); if($this->initSelector) { if(strpos($selector, $this->initSelector) !== false) { $selector = str_replace($this->initSelector, '', $selector); // ensure that $selector does not contain initSelector