diff --git a/lib/Varien/Data/Form/Element/Collection.php b/lib/Varien/Data/Form/Element/Collection.php index 25d4ec55033..8c6e7bcf76c 100644 --- a/lib/Varien/Data/Form/Element/Collection.php +++ b/lib/Varien/Data/Form/Element/Collection.php @@ -58,7 +58,7 @@ public function __construct($container) * * @return ArrayIterator */ - public function getIterator() + public function getIterator(): \Traversable { return new ArrayIterator($this->_elements); } @@ -69,7 +69,7 @@ public function getIterator() * @param mixed $key * @param mixed $value */ - public function offsetSet($key, $value) + public function offsetSet($key, $value): void { $this->_elements[$key] = $value; } @@ -80,7 +80,7 @@ public function offsetSet($key, $value) * @param mixed $key * @return mixed */ - public function offsetGet($key) + public function offsetGet($key): mixed { return $this->_elements[$key]; } @@ -90,7 +90,7 @@ public function offsetGet($key) * * @param mixed $key */ - public function offsetUnset($key) + public function offsetUnset($key): void { unset($this->_elements[$key]); } @@ -99,9 +99,9 @@ public function offsetUnset($key) * Implementation of ArrayAccess:offsetExists() * * @param mixed $key - * @return boolean + * @return bool */ - public function offsetExists($key) + public function offsetExists($key): bool { return isset($this->_elements[$key]); } @@ -179,7 +179,7 @@ public function remove($elementId) * * @return int */ - public function count() + public function count(): int { return count($this->_elements); } diff --git a/lib/Varien/Data/Tree/Node/Collection.php b/lib/Varien/Data/Tree/Node/Collection.php index be863c3a856..084314167cb 100644 --- a/lib/Varien/Data/Tree/Node/Collection.php +++ b/lib/Varien/Data/Tree/Node/Collection.php @@ -59,7 +59,7 @@ public function getNodes() /** * Implementation of IteratorAggregate::getIterator() */ - public function getIterator() + public function getIterator(): \Traversable { return new ArrayIterator($this->_nodes); } @@ -69,7 +69,7 @@ public function getIterator() * @param string $key * @param string $value */ - public function offsetSet($key, $value) + public function offsetSet($key, $value): void { $this->_nodes[$key] = $value; } @@ -77,9 +77,9 @@ public function offsetSet($key, $value) /** * Implementation of ArrayAccess:offsetGet() * @param string $key - * @return Varien_Data_Tree_Node + * @return mixed|Varien_Data_Tree_Node */ - public function offsetGet($key) + public function offsetGet($key): mixed { return $this->_nodes[$key]; } @@ -88,7 +88,7 @@ public function offsetGet($key) * Implementation of ArrayAccess:offsetUnset() * @param string $key */ - public function offsetUnset($key) + public function offsetUnset($key): void { unset($this->_nodes[$key]); } @@ -98,7 +98,7 @@ public function offsetUnset($key) * @param string $key * @return bool */ - public function offsetExists($key) + public function offsetExists($key): bool { return isset($this->_nodes[$key]); } @@ -139,7 +139,7 @@ public function delete($node) * * @return int */ - public function count() + public function count(): int { return count($this->_nodes); } diff --git a/lib/Varien/Db/Tree/NodeSet.php b/lib/Varien/Db/Tree/NodeSet.php index 3e3619343be..a902bbd3de8 100644 --- a/lib/Varien/Db/Tree/NodeSet.php +++ b/lib/Varien/Db/Tree/NodeSet.php @@ -21,7 +21,6 @@ /** * TODO implements iterators - * */ class Varien_Db_Tree_NodeSet implements Iterator { @@ -60,31 +59,32 @@ public function count() /** * @return bool */ - public function valid() + public function valid(): bool { return isset($this->_nodes[$this->_current]); } + #[\ReturnTypeWillChange] public function next() { if ($this->_current > $this->_currentNode) { return false; } else { - return $this->_current++; + return $this->_current++; } } - public function key() + public function key(): mixed { return $this->_current; } - public function current() + public function current(): mixed { return $this->_nodes[$this->_current]; } - public function rewind() + public function rewind(): void { $this->_current = 0; } diff --git a/lib/Varien/Object.php b/lib/Varien/Object.php index 790f897ef6d..46b374f379e 100644 --- a/lib/Varien/Object.php +++ b/lib/Varien/Object.php @@ -835,8 +835,7 @@ public function debug($data = null, &$objects = []) * @param string $offset * @param mixed $value */ - #[ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { $this->_data[$offset] = $value; } @@ -846,10 +845,9 @@ public function offsetSet($offset, $value) * * @link http://www.php.net/manual/en/arrayaccess.offsetexists.php * @param string $offset - * @return boolean + * @return bool */ - #[ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->_data[$offset]); } @@ -860,8 +858,7 @@ public function offsetExists($offset) * @link http://www.php.net/manual/en/arrayaccess.offsetunset.php * @param string $offset */ - #[ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->_data[$offset]); } @@ -873,8 +870,7 @@ public function offsetUnset($offset) * @param string $offset * @return mixed */ - #[ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return isset($this->_data[$offset]) ? $this->_data[$offset] : null; }