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

PHPUnit\Framework\TestCase has @internal annotation in PHAR #5596

Closed
sebastianbergmann opened this issue Dec 1, 2023 · 4 comments
Closed
Assignees
Labels

Comments

@sebastianbergmann
Copy link
Owner

@spriebsch just informed me that the phpunit.phar for PHPUnit 10.5 (and likely other recently built PHARs) has an @internal annotation in the doc-comment for PHPUnit\Framework\TestCase (and likely in the doc-comment for other classes that are part of PHPUnit's public API).

The only explanation I can think of right now would be a regression in PHP-Scoper.

CC @theofidry

@sebastianbergmann
Copy link
Owner Author

When I downgrade to PHP-Scoper 0.18.4 then the PHPUnit\Framework\TestCase does not have an @internal annotation in its doc-comment in the PHAR.

The first version that is affected is PHP-Scoper 0.18.5. At first glance, I would assume that the implementation of humbug/php-scoper#882 also adds the @internal annotation to the doc-comment of units of code that are not scoped.

@theofidry
Copy link
Contributor

Ha yes this would be part of humbug/php-scoper#882. The idea was if you include a scoped tool/package within your project you would not get PHPStorm providing hints about those scoped classes.

For exposed symbols I do not think it should be a problem as they are exposed via class_alias() which I don't think would get the annotation (the source would have it, but the alias would not – not entirely sure of IDEs behaviour there). But actually it would be a problem for excluded symbols, more specifically when you exclude a namespace.

If it's a big deal I would just revert the whole thing, I am not sure yet it is working as intended.

@sebastianbergmann
Copy link
Owner Author

I will revert PHPUnit's build process to PHP-Scoper 0.18.4 now and roll new releases for PHPUnit 8.5, PHPUnit 9.6, and PHPUnit 10.5.

@sebastianbergmann
Copy link
Owner Author

New versions of PHPUnit 8.5, PHPUnit 9.6, and PHPUnit 10.5 have been released. The PHAR for these versions has been built using PHP-Scoper 0.18.4 which is not affected by humbug/php-scoper#924.

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

No branches or pull requests

2 participants