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

composer warning: Ambiguous class resolution; file for autoloading is chosen at random #4

Closed
sapphirecat opened this issue Jul 16, 2015 · 9 comments

Comments

@sapphirecat
Copy link

Warning: Ambiguous class resolution, "SimpleReflection" was found in both "vendor/simpletest/simpletest/reflection_php4.php" and "vendor/simpletest/simpletest/reflection_php5.php", the first will be used.

Composer seems to iterate in filesystem order, so this class effectively gets chosen at random on each distinct installation, although the php5 variant is the correct one in my environment.

I don't think this makes a difference (the class isn't actually autoloaded, so if the wrong one was in the autoloader, nothing bad happens) unless client code accidentally triggers the autoload before SimpleTest gets a chance to do its own direct loading. Still, I would like the warning to be fixed.

In fact, I think the php4 file can just be deleted. composer.json and the bundled docs both say 1.1+ are PHP5-only, and I can't find anywhere that would load the php4 variant.

@jakoch jakoch closed this as completed in dcddfe9 Jul 16, 2015
jakoch added a commit that referenced this issue Jul 16, 2015
@jakoch
Copy link
Member

jakoch commented Jul 16, 2015

In fact, I think the php4 file can just be deleted.

Allright, i've dropped the file and it's test.

@lxlang
Copy link

lxlang commented Jul 30, 2015

Can you create a new version including this fix?

@VasuLief
Copy link

+1

2 similar comments
@stockii
Copy link

stockii commented Jul 30, 2015

👍

@zaratozom
Copy link

👍

@GuillaumeMB
Copy link

Any news regarding this matter?

@jakoch
Copy link
Member

jakoch commented Nov 3, 2015

Can you create a new version including this fix?

I've released a new tag v1.1.7 including these changes.

@GuillaumeMB
Copy link

On my composer.json file when I add "simpletest/simpletest": "^1.1", version 1.1.6 of simpletest is installed. I don't understand why because the new tag 1.1.7 is available on Packagist.

@jakoch
Copy link
Member

jakoch commented Nov 3, 2015

I tested the issue you reported, but was unable to reproduce it.
I used the following composer.json:

{
    "require": {
        "simpletest/simpletest": "^1.1"
    }
}

Then composer install -vvv --profile.
Result: - Installing simpletest/simpletest (v1.1.7).

ShaneMcC pushed a commit to ShaneMcC/SimpleTest that referenced this issue Nov 27, 2015
ShaneMcC pushed a commit to ShaneMcC/SimpleTest that referenced this issue Nov 27, 2015
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

7 participants