Skip to content

False positives for IsAbstract expression #434

Open
@davidcv91

Description

Bug Report

Q A
BC Break yes
Library Version 0.3.33
PHP version 8.1.28

Summary

IsAbstract() finds classes that are not abstract

Apparently, the bug was added on this commit

Current behavior

App\MyClass has 1 violations
  should have a name that matches Abstract* because we want to prefix abstract classes

How to reproduce

Add the following rule:

Rule::allClasses()
        ->that(new IsAbstract())
        ->should(new HaveNameMatching('Abstract*'))
        ->because('we want to prefix abstract classes');

And create a class like:

final class MyClass
{
}

Expected behavior

No errors reported

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions