pestphp / pestphp/pest

[4.x] Abstract classes cannot be final - strict preset

Open
#1,353 6 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PHP
Stars
11.7k
Forks
538
Avg merge
4d 11h
Merged PRs (30d)
8

Description

What Happened

When i use arch()->preset()->strict() in my tests, i get an error

arch('')->preset()->strict();

Image

But this class must necessarily be abstract, so it cannot be final.

How to Reproduce
clear && vendor/bin/pest --arch

Image

Image

Image

Image

Sample Repository

https://github.com/19950512/pestphp-poc-arch

Pest Version

3.7

PHP Version

8.3.15 (CLI)

Operation System

Linux

Notes

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with vendor/bin/pest --arch and the arch('')->preset()->strict() configuration from the issue, using the linked sample repository if needed. Trace the strict preset's architecture rule for abstract classes; done means valid abstract classes are no longer reported as requiring final, while other strict checks still behave as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.