diff --git a/ecrire/iterateur/data.php b/ecrire/iterateur/data.php index 0432a03d8e63c485d41358d92f2d19af6ba3d902..55ddf530a265738e349160537a8c66832b4849e3 100644 --- a/ecrire/iterateur/data.php +++ b/ecrire/iterateur/data.php @@ -125,7 +125,7 @@ class IterateurDATA implements Iterator { * * @return void */ - public function rewind() { + public function rewind() : void { reset($this->tableau); $this->cle = key($this->tableau); $this->valeur = current($this->tableau); @@ -531,15 +531,16 @@ class IterateurDATA implements Iterator { * * @return bool */ - public function valid() { + public function valid() : bool { return !is_null($this->cle); } /** * Retourner la valeur * - * @return null + * @return mixed */ + #[\ReturnTypeWillChange] public function current() { return $this->valeur; } @@ -547,8 +548,9 @@ class IterateurDATA implements Iterator { /** * Retourner la cle * - * @return null + * @return mixed */ + #[\ReturnTypeWillChange] public function key() { return $this->cle; } @@ -558,7 +560,7 @@ class IterateurDATA implements Iterator { * * @return void */ - public function next() { + public function next() : void { if ($this->valid()) { $this->cle = key($this->tableau); $this->valeur = current($this->tableau); diff --git a/ecrire/iterateur/sql.php b/ecrire/iterateur/sql.php index d8574e407dd07cf62edcaca0a4146f917fdb93de..907f24d587a33c44301b0559b40096b4a5929796 100644 --- a/ecrire/iterateur/sql.php +++ b/ecrire/iterateur/sql.php @@ -105,10 +105,10 @@ class IterateurSQL implements Iterator { * * @return bool */ - public function rewind() { - return ($this->pos > 0) - ? $this->seek(0) - : true; + public function rewind() : void { + if ($this->pos > 0) { + $this->seek(0); + } } /** @@ -116,7 +116,7 @@ class IterateurSQL implements Iterator { * * @return bool */ - public function valid() { + public function valid() : bool { if ($this->err) { return false; } @@ -132,10 +132,12 @@ class IterateurSQL implements Iterator { * * @return array */ + #[\ReturnTypeWillChange] public function current() { return $this->row; } + #[\ReturnTypeWillChange] public function key() { return $this->pos; } @@ -172,7 +174,7 @@ class IterateurSQL implements Iterator { * * @return void */ - public function next() { + public function next() : void { $this->row = sql_fetch($this->sqlresult, $this->command['connect']); $this->pos++; $this->firstseek |= true; diff --git a/ecrire/public/iterateur.php b/ecrire/public/iterateur.php index 37fc20e045df71fea67f0c507d525088a2934390..e468bd5d8e47fc40a2dd4a12cb5480e5b44e0617 100644 --- a/ecrire/public/iterateur.php +++ b/ecrire/public/iterateur.php @@ -443,7 +443,7 @@ class IterDecorator extends FilterIterator { } - public function next() { + public function next() : void { $this->pos++; parent::next(); } @@ -453,7 +453,7 @@ class IterDecorator extends FilterIterator { * * @return void */ - public function rewind() { + public function rewind() : void { $this->pos = 0; $this->fetched = 0; parent::rewind(); @@ -635,7 +635,7 @@ class IterDecorator extends FilterIterator { * Accepte-t-on l'entree courante lue ? * On execute les filtres pour le savoir. **/ - public function accept() { + public function accept() : bool { if ($f = $this->func_filtre) { return $f(); }