• Resolved neo2k23

    (@neo2k23)


    Can you please fix deprecation notifications. I am using the latest trunk version and php 8.2

    Thank you

        Deprecated: Return type of IPTools\Range::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/mywebsite/public_html/wp-content/plugins/wp-statistics/includes/vendor/s1lentium/iptools/src/Range.php on line 189
    
        Deprecated: Return type of IPTools\Range::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/mywebsite/public_html/wp-content/plugins/wp-statistics/includes/vendor/s1lentium/iptools/src/Range.php on line 202
    
        Deprecated: Return type of IPTools\Range::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/mywebsite/public_html/wp-content/plugins/wp-statistics/includes/vendor/s1lentium/iptools/src/Range.php on line 197
    
        Deprecated: Return type of IPTools\Range::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/mywebsite/public_html/wp-content/plugins/wp-statistics/includes/vendor/s1lentium/iptools/src/Range.php on line 215
    
        Deprecated: Return type of IPTools\Range::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/mywebsite/public_html/wp-content/plugins/wp-statistics/includes/vendor/s1lentium/iptools/src/Range.php on line 207
    
        Deprecated: Return type of IPTools\Range::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/mywebsite/public_html/wp-content/plugins/wp-statistics/includes/vendor/s1lentium/iptools/src/Range.php on line 223
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter neo2k23

    (@neo2k23)

    Just add #[\ReturnTypeWillChange] in the range.php file before each function to fix the issues.

    Thank you

    #[\ReturnTypeWillChange]
    public function current()
    {
        return $this->firstIP->next($this->position);
    }
    
    /**
     * @return int
     */
    #[\ReturnTypeWillChange]
    public function key()
    {
        return $this->position;
    }
    #[\ReturnTypeWillChange]
    public function next()
    {
        ++$this->position;
    }
    #[\ReturnTypeWillChange]
    public function rewind()
    {
        $this->position = 0;
    }
    
    /**
     * @return bool
     */
    #[\ReturnTypeWillChange]
    public function valid()
    {
        return strcmp($this->firstIP->next($this->position)->inAddr(), $this->lastIP->inAddr()) <= 0;
    }
    
    /**
     * @return int
     */
    #[\ReturnTypeWillChange]
    public function count()
    {
        return (integer)bcadd(bcsub($this->lastIP->toLong(), $this->firstIP->toLong()), 1);
    }
    Plugin Author Mostafa Soufi

    (@mostafas1990)

    Hello,

    Oh, good point, thank you for the fixing, I’ve applied them on the library

    https://github.com/wp-statistics/wp-statistics/commit/dd2ff6b0bad1c6cda4b8d665b4c0641c02aa8fe4

    Best

    Thread Starter neo2k23

    (@neo2k23)

    Thank you for fixing it. Please close the issue. Have a great weekend!

    Plugin Author Mostafa Soufi

    (@mostafas1990)

    Yeah, have a great weekend too.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Php 8.2 and wp 6.5 compatible issue’ is closed to new replies.