Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve method coverage line /w attributes #1030

Open
mvorisek opened this issue Feb 4, 2024 · 1 comment
Open

Improve method coverage line /w attributes #1030

mvorisek opened this issue Feb 4, 2024 · 1 comment

Comments

@mvorisek
Copy link
Contributor

mvorisek commented Feb 4, 2024

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).

@sebastianbergmann
Copy link
Owner

Lines that only contain attribute declarations should be marked as not executable / coverable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants