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

Does not comply with psr-4 autoloading standard #9

Open
hipwebdesign opened this issue May 9, 2020 · 2 comments
Open

Does not comply with psr-4 autoloading standard #9

hipwebdesign opened this issue May 9, 2020 · 2 comments

Comments

@hipwebdesign
Copy link

Does not comply with psr-4 autoloading standard

Composer returns the following error: Deprecation Notice: Class RESO\RESO located in ./vendor/reso/reso-php/lib/Reso.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201

Warning indicates that package will not autoload in Composer v2.0, but I'm running v1.10.6 and I still can't get it to autoload.

Steps to Reproduce

  1. Install package composer require reso/reso-php
  2. Run composer dump-autoload --optimize
  3. Call require_once('/path/to/vendor/autoload.php');
  4. Returns Fatal error: Uncaught Error: Class 'RESO\RESO' not found

Expected behavior: Autoload package and make Classes accessible.

Actual behavior: Autoload runs without package and Classes are inaccessible.

Versions

RESO-WebAPI-Client-PHP v1.0
Composer V.1.10.6
PHP v7.3.11

@venom1979
Copy link

Same issue here. Same Composer version: 1.10.6.

@danvbe
Copy link

danvbe commented May 13, 2021

Using composer 2.0.12 I got:
Class RESO\RESO located in ./vendor/reso/reso-php/lib/Reso.php does not comply with psr-4 autoloading standard. Skipping.

I have managed to load the classes by adding a separate entry in composer.json, to load RESO classes with classmap:

"autoload": {
        "psr-4": {
            ..... [my original psr-4 config] ....
        },
        "classmap": ["vendor/reso/reso-php/lib/"]
    },

This was referenced Sep 18, 2021
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

3 participants