Phpinspectionsea: False/Positive static closure

Created on 25 Apr 2019  路  2Comments  路  Source: kalessil/phpinspectionsea

When a method in a class 'wraps' a call to parent the closure can't be static:

<?php

class A
{
    public function test()
    {
        return 'A';
    }
}

class B extends A
{
    public function test()
    {
        return (function ()
        {
            return parent::test();
        })();
    }
}

Thus the inspection probably checks for $this in the closure, but should also check for parent:: :)

bug / false-positive fixed

Most helpful comment

Fixed!

All 2 comments

oops, thank you for reporting @fruitl00p !

Fixed!

Was this page helpful?
0 / 5 - 0 ratings