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 2.0 type warnings #104

Open
loqus opened this issue Nov 5, 2020 · 4 comments
Open

Composer 2.0 type warnings #104

loqus opened this issue Nov 5, 2020 · 4 comments
Labels

Comments

@loqus
Copy link

loqus commented Nov 5, 2020

Question

I generated a module a year ago and it works really well, but the last months after running composer update i get an error message like "does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0.".

Is that something you can fix in a future generator? Or maybe change the readme to incorporate changes for composer v2

@loqus loqus added the question label Nov 5, 2020
@bencroker
Copy link

This should be fixed in an update here. Can you show us which classes/files are causing the messages?

@kevinmu17
Copy link

This should be fixed in an update here. Can you show us which classes/files are causing the messages?

All of them:
Class modules\custommodule\migrations
Class modules\custommodule\records
Class modules\custommodule\models
Class modules\custommodule\variables
Class modules\custommodule\assetbundles
Class modules\custommodule\assetbundles
Class modules\custommodule\assetbundles
Class modules\custommodule\fields
Class modules\custommodule\jobs
Class modules\custommodule\twigextensions
Class modules\custommodule\controllers
Class modules\custommodule\controllers
Class modules\custommodule\services
Class modules\custommodule\widgets
Class modules\custommodule\console
Class modules\custommodule\CustomModule

@kevinmu17
Copy link

kevinmu17 commented Jan 8, 2021

Okay found the issue:
in the composer.json you need these lines

  "autoload": {
    "psr-4": {
      "modules\\custommodule\\": "modules/custommodule/src"
    }
  },

beware of the trailing \, i overlooked them and was searching for hours :)

@bencroker
Copy link

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

3 participants