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

Generating optimized autoload files error → Could not scan for classes inside #59

Closed
remcotolsma opened this issue Jul 20, 2023 · 2 comments

Comments

@remcotolsma
Copy link

remcotolsma commented Jul 20, 2023

After running composer install --no-dev --prefer-dist --optimize-autoloader we noticed the following error:

Generating optimized autoload files

  In ClassMapGenerator.php line 73:

    Could not scan for classes inside "vendor/mck89/peast/test/Peast" which does not appear to be a file nor a folder

Is this related to the following:

peast/composer.json

Lines 18 to 23 in bd4c30d

"autoload": {
"psr-4": {
"Peast\\": "lib/Peast/",
"Peast\\test\\": "test/Peast/"
}
},

/test export-ignore

The test folder is part of export-ignore but is registered in the composer.json autoload property.

Should it be moved the autoload-dev property?

    "autoload": {
        "psr-4": {
            "Peast\\": "lib/Peast/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Peast\\test\\": "test/Peast/"
        }
    },

https://getcomposer.org/doc/04-schema.md#autoload-dev

@mck89
Copy link
Owner

mck89 commented Jul 20, 2023

Yes, I think you're right, i'll make some tests to check different cases with the fix you proposed.

@mck89
Copy link
Owner

mck89 commented Jul 21, 2023

I've applied the fix you proposed and it seems to work. I couldn't reproduce the error you mentioned but i think it depends on the composer version, so let me know if the error is still present. Thank you!

@mck89 mck89 closed this as completed Jul 21, 2023
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

2 participants