Fix PHP 8.1 compatibility in DatabaseObjectList
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 20 Sep 2021 13:44:14 +0000 (15:44 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Mon, 20 Sep 2021 13:44:14 +0000 (15:44 +0200)
> Return type of wcf\data\DatabaseObjectList::count() should either be
> compatible with Countable::count(): int, or the #[ReturnTypeWillChange]
> attribute should be used to temporarily suppress the notice […]

wcfsetup/install/files/lib/data/DatabaseObjectList.class.php

index c47a762e7c7d8de595ab257bbc085692b9da9930..2741d806962fb7433d7801e5ab34203cad1156f9 100644 (file)
@@ -309,7 +309,7 @@ abstract class DatabaseObjectList implements \Countable, ITraversableObject
     /**
      * @inheritDoc
      */
-    public function count()
+    public function count(): int
     {
         return \count($this->objects);
     }