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

Absolutely namespaced classes not properly detected with class_exists() #195

Closed
cmb69 opened this issue Apr 25, 2015 · 2 comments
Closed
Assignees
Labels
Milestone

Comments

@cmb69
Copy link
Contributor

cmb69 commented Apr 25, 2015

Consider the following script:

<?php

if (class_exists('\Normalizer')) {
    \Normalizer::normalize('foo');
}

Running phpcompatinfo analyser:run . (PHAR version 4.1.0), I get the following (partial) output:

    Class       Matches REF  EXT min/Max PHP min/Max PHP all
    Normalizer  1       intl 1.0.0beta   5.3.0alpha1
 CU \Normalizer         user             5.3.0

I would expect, however, something like:

    Class      Matches REF  EXT min/Max PHP min/Max PHP all
 C  Normalizer 1       intl 1.0.0beta   5.3.0alpha1

This is, by the way, the result I'm getting when omitting the leading backslash from both class names in the script.

@llaville llaville added the bug label Apr 27, 2015
@llaville llaville added this to the 4.2.0 milestone Apr 27, 2015
@llaville llaville self-assigned this Apr 27, 2015
@llaville
Copy link
Owner

As explained in #194, the intl reference with missing methods is not yet able to detect the right version for \Normalizer::normalize('foo').
I must document it before to check other fixes !

@llaville
Copy link
Owner

Thanks Christoph for your report. It will allow me to improve again conditional code detection.

When a class is detected previously as optional, all methods are also tagged as optional to avoid bad total requirements

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