Skip to content

Uncaught ReflectionException: Method not accessible when trying to BetterReflection\Reflection\Adapter\ReflectionMethod->invoke #7429

@janedbal

Description

@janedbal

Bug report

We use PHP 8.1 where setAccessible is no longer needed to be called, but it is checked in the adapter. Repository ondrejmirtes/BetterReflection does not accept issues so I placed it here. Tested on 1.7.11

Code snippet that reproduces the problem

$this->reflectionProvider->getClass($className)->getNativeReflection()->getMethod($privateMethodName)->invoke(null); // in custom rule

Expected output

No error

Metadata

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