catalyst / moodle-block_multiblock

Moodle plugin which allows you to embed multiple blocks within a single block region using different formats including tabs and accordions
GNU General Public License v3.0
12 stars 12 forks source link

Creation of dynamic property block_multiblock::$blocks is deprecated #109

Closed ewallah closed 5 months ago

ewallah commented 5 months ago

Using $this->blocks without declaring a @var array $blocks in the class generates a deprecated error in php8.2.

Exception - Unknown error type: Creation of dynamic property block_multiblock::$blocks is deprecated in [dirroot]/blocks/multiblock/block_multiblock.php on line 93

Debug info:
Error code: generalexceptionmessage
Stack trace:

Adding this to the code, fixes the error:

    /** @var array $blocks. */
    private $blocks;
danmarsden commented 5 months ago

Thanks @ewallah - feel free to submit a PR otherwise we'll try to come back to it soon.

danmarsden commented 5 months ago

thanks for the PR! :-)