@MichaIng opened this Issue on November 24th 2021

Even after #18309 there are still two deprecation warnings in this script:

PHP Deprecated:  Return type of HTML_QuickForm2_ContainerIterator::hasChildren() should either be compatible with RecursiveArrayIterator::hasChildren(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/matomo/libs/HTML/QuickForm2/Container.php on line 68
PHP Deprecated:  Return type of HTML_QuickForm2_ContainerIterator::getChildren() should either be compatible with RecursiveArrayIterator::getChildren(): ?RecursiveArrayIterator, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/matomo/libs/HTML/QuickForm2/Container.php on line 74

Expected Behavior

No deprecation warnings.

Current Behavior

Deprecation warnings as shown above.

Possible Solution

While this is not a good solution, I currently muted those via:

    #[\ReturnTypeWillChange]
    public function hasChildren()
    {
        return $this->current() instanceof HTML_QuickForm2_Container;
    }

    #[\ReturnTypeWillChange]
    public function getChildren()
    {
        return new HTML_QuickForm2_ContainerIterator($this->current());
    }

Steps to Reproduce (for Bugs)

  1. Install php8.1-fpm
  2. Access and browse Matomo web interface, through I couldn't identify the exact element/page which triggers this.

Context

Your Environment

  • Matomo Version: v4.6.0-rc2
  • PHP Version: 8.1.0RC6
  • Server Operating System: Debian Bookworm
  • Additionally installed plugins:
    API, Actions, Annotations, BulkTracking, CoreAdminHome, CoreConsole, CoreHome, CorePluginsAdmin, CoreUpdater, CoreVisualizations, CoreVue, DBStats, DarkTheme 1.1.7, Dashboard, DevicePlugins, DevicesDetection, Diagnostics, Goals, IPReports 4.1.1, ImageGraph, Insights, Installation, Intl, LanguagesManager, Live, LogViewer 4.0.1, Login, Marketplace, Monolog, Morpheus, PagePerformance, PrivacyManager, Proxy, Referrers, Resolution, SEO, SegmentEditor, SitesManager, TrackingSpamPrevention 4.1.0, Transitions, UserLanguage, UsersManager, VisitFrequency, VisitTime, VisitorInterest, VisitsSummary, WebsiteMeasurable
@sgiehl commented on November 25th 2021 Member

Hi @MichaIng. Thanks for the report. We have already fixed those with https://github.com/matomo-org/matomo/pull/18309

@MichaIng commented on November 25th 2021

As said, I'm using v4.6.0-rc2 already, which contains these commits but still face the warnings.

@Findus23 commented on November 25th 2021 Member

It seems like this is indeed after #18309 as otherwise RecursiveArrayIterator::hasChildren(): would not be in line 68.

@sgiehl commented on November 26th 2021 Member

Ah sorry. Seems I missed that.

Powered by GitHub Issue Mirror