php-code-coverage icon indicating copy to clipboard operation
php-code-coverage copied to clipboard

Private Empty Constructor Coverage

Open tklever opened this issue 11 years ago • 1 comments

Found an inconsistency when using private constructors

final class Demo
{
    private function __construct(){}

    public static function returnTrue()
    {
        return true;
    }
}

vs.

final class Demo
{
    private function __construct()
    {
    }

    public static function returnTrue()
    {
        return true;
    }
}

Assuming the static function is covered, the first formatting shows 100%, all lines covered. The second formatting shows two uncovered lines (3 and 5 to be specific). No other changes to the file or tests, just two extra carriage returns.

tklever avatar Jun 07 '15 06:06 tklever

I cannot reproduce this.

screenshot from 2015-06-19 14-04-23

sebastianbergmann avatar Jun 19 '15 12:06 sebastianbergmann