php-scoper icon indicating copy to clipboard operation
php-scoper copied to clipboard

Fix tests

Open VincentLanglet opened this issue 1 year ago • 3 comments

I think there is a change in the behavior of some dependency which remove this useless parenthesis when parsing the file.

($file instanceof \SplFileInfo) ? $file : new \SplFileInfo($file);

is transformed to

$file instanceof \SplFileInfo ? $file : new \SplFileInfo($file);

Since the parenthesis is useless, it seems better to remove it from the both input and output IMHO.

VincentLanglet avatar Aug 15 '24 09:08 VincentLanglet

I don't understand the failure https://github.com/humbug/php-scoper/actions/runs/10401466964/job/28820621264?pr=1065 ; it might be something random.

For the removal of the parenthesis it comes from the next version of nikic/php-parser https://github.com/nikic/PHP-Parser/releases/tag/v5.1.0

So I had to update the version in the composer.lock in order to use the same for all the tests @theofidry

VincentLanglet avatar Aug 18 '24 19:08 VincentLanglet

Can you approve again the CI @theofidry, to see if the PR is ok or need more fixes ?

VincentLanglet avatar Aug 26 '24 10:08 VincentLanglet

the unit test failures looks related to some changes in the jetbrains stubs. I don't know if that was intentional of them or not, and it's worth noting that those stubs are about the IDE, they are not meant to provide an exhaustive list of symbols (e.g. there's plenty of old unmaintained extensions that are not documented).

In any case such changes go to the Enriched reflector. Usually I try to keep the reflector as light as possible, but add more tests for checking against regressions. If it's not obvious I may be able to take a lookt this week

ares_gethostbyname was removed in https://github.com/JetBrains/phpstorm-stubs/pull/1627 because it's considered as outdated.

I assume it's the same for uv_read2_start uv_handle_type uv_ares_init_options

Do you know these method ? Is the PR on phpstorm-stubs wrong ?

VincentLanglet avatar Aug 28 '24 17:08 VincentLanglet

I don't know them, but it's what I meant by "those stubs are about the IDE, they are not meant to provide an exhaustive list of symbols" when talking of JetBrains stubs. So whilst we can use it to leverage a big number of stubs, that list needs to be complemented.

The missing symbols can be added to https://github.com/humbug/php-scoper/blob/main/src/Symbol/Reflector.php

theofidry avatar Aug 30 '24 13:08 theofidry

The missing symbols can be added to main/src/Symbol/Reflector.php

Done @theofidry

VincentLanglet avatar Sep 01 '24 13:09 VincentLanglet

Thank you @VincentLanglet!

theofidry avatar Sep 02 '24 13:09 theofidry

Thank you @VincentLanglet!

Thanks you too. I rebased https://github.com/humbug/php-scoper/pull/1061

VincentLanglet avatar Sep 02 '24 13:09 VincentLanglet