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

Missing extension when class name FQN is resolved under user namespace #275

Closed
llaville opened this issue Sep 29, 2020 · 2 comments
Closed
Assignees
Milestone

Comments

@llaville
Copy link
Owner

With issue #210 running on new version 5.4, I've noticed (and it's normal because it's PHP native behaviour), that class called with new constructor that are not properly defined with namespace import are detected under user namespace.

Here is a concrete example pick from vfsStream v1.6.0 => https://github.com/bovigo/vfsStream/blob/v1.6.0/src/test/php/org/bovigo/vfs/vfsStreamZipTestCase.php#L39
ZipArchive is resolved by nikic/php-parser NameResolver as org\bovigo\vfs\ZipArchive (and it's not a bug)

So in CompatInfo 5.4.0 I'll consider this situtation (conditional code only) as resolving extension with :

  • ext.min = 0.1.0
  • php.min = 5.3.0
@llaville llaville added this to the 5.4 milestone Sep 29, 2020
@llaville llaville self-assigned this Sep 29, 2020
@llaville
Copy link
Owner Author

Run example with v5.4 when analysing this file https://github.com/bovigo/vfsStream/blob/v1.6.0/src/test/php/org/bovigo/vfs/vfsStreamZipTestCase.php

Data Source Analysed

Directories                                          1
Files                                                1
Errors                                               0


Extensions Analysis

    Extension REF      EXT min/Max PHP min/Max
    Core      Core     4.0.0       4.0.0
    standard  standard 4.0.0       4.0.0
    zip       zip      0.1.0       5.3.0
    Total [3]                      5.3.0

Namespaces Analysis

    Namespace      REF  EXT min/Max PHP min/Max
    org\bovigo\vfs user             5.3.0
    Total [1]                       5.3.0

No interface found

No trait found

Classes Analysis

    Class                               REF  EXT min/Max PHP min/Max
  U org\bovigo\vfs\ZipArchive           user             5.3.0
    org\bovigo\vfs\vfsStreamZipTestCase user             5.3.0
    Total [2]                                            5.3.0

No generator found

Functions Analysis

    Function         REF      EXT min/Max PHP min/Max
    extension_loaded Core     4.0.0       4.0.0
    file_exists      standard 4.0.0       4.0.0
    var_dump         standard 4.0.0       4.0.0
    Total [3]                             4.0.0

Constants Analysis

    Constant  REF  EXT min/Max PHP min/Max
    false     Core 4.0.0       4.0.0
    Total [1]                  4.0.0

Conditions Analysis

    Condition             REF EXT min/Max PHP min/Max
    extension_loaded(zip) zip 0.1.0       5.3.0
    Total [1]                             5.3.0

Requires PHP 5.3.0 (min)

llaville added a commit that referenced this issue Sep 29, 2020
@llaville
Copy link
Owner Author

Change with commits 83492c2 and c5254b0 allows to solve situation in such context https://github.com/sebastianbergmann/phpunit/blob/7.5.20/src/Util/Configuration.php#L549
And php.min was changed to 4.0.0 with commit 7ed2d57

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

No branches or pull requests

1 participant