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

feat: Add support for covers class method annotation #1239

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from

Conversation

dshafik
Copy link

@dshafik dshafik commented Sep 11, 2024

What:

  • Bug Fix
  • New Feature

Description:

Adds support for the CoversMethod annotation. As a bonus it fixes these two ignored uncovered types:

  src/PendingCalls/TestCall.php ...... pa521, pa521 100%

Usage

For single class method alone:

covers([ClassName::class, 'method']);
// or
covers([
     [ClassName::class, 'method']
]);

For multiple values:

covers(ClassName::class, [OtherClassName::class, 'method']);
// or
covers([
    ClassName::class, 
    [OtherClassName::class, 'method']
]);

Related:

@dshafik dshafik force-pushed the dshafik/covers-method-support branch from c74b947 to e1146c4 Compare September 12, 2024 07:10
@dshafik dshafik changed the title feat: Add support for covers class method annotation [wip] feat: Add support for covers class method annotation Sep 12, 2024
@dshafik dshafik force-pushed the dshafik/covers-method-support branch from e1146c4 to 1823633 Compare September 12, 2024 07:33
@dshafik dshafik changed the title [wip] feat: Add support for covers class method annotation feat: Add support for covers class method annotation Sep 12, 2024
@dshafik
Copy link
Author

dshafik commented Sep 12, 2024

@nunomaduro made some updates to ensure that both array and variadic args are supported correctly, there are tests for all variants

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

Successfully merging this pull request may close these issues.

1 participant