Skip to content

Improve method coverage line /w attributes #1030

Open
@mvorisek

Description

@mvorisek
Q A
php-code-coverage version 10.1.11
PHP version 8.3.0
Driver Xdebug
PCOV version (if used) n/a
Xdebug version (if used) 3.3.1
Installation Method Composer
Usage Method PHPUnit
PHPUnit version (if used) 10.5.9

repro code:

<?php

declare(strict_types=1);

namespace Atk4\Data\Persistence;

// dummy space to match the line numbers in the screenshot below
//

class GenericPlatform extends Platforms\AbstractPlatform
{
    private function createNotSupportedException(): \Exception
    {
        return DbalException::notSupported('SQL');
    }

    #[\Override]
    public function getName(): string
    {
        return 'atk4_data_generic';
    }

    #[\Override]
    protected function initializeDoctrineTypeMappings(): void {}
}

image

This is a feature request to improve the emitted coverage line of method to be the "line where the method name (or visibility) is declared".

In the example screen, I would coverage to be emitted on l18 and l24 (instead l17 and l23).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions