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

HeaderTest.php does not comply with psr-4 autoloading standard #98

Closed
karmendra opened this issue Apr 2, 2020 · 2 comments
Closed

HeaderTest.php does not comply with psr-4 autoloading standard #98

karmendra opened this issue Apr 2, 2020 · 2 comments

Comments

@karmendra
Copy link

Due to different ClassName and FileName we see following warning while doing composer dump-autoload

vagrant@homestead:~/code/mrm$ composer dump
Generating optimized autoload files
Deprecation Notice: Class Html2Text\StrToUpperTest located in ./vendor/html2text/html2text/test/HeaderTest.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

@roelofr
Copy link
Contributor

roelofr commented Apr 16, 2020

Id' actually recon that the loading of the tests is wrong in the first place.

The JSON file currenlty looks like this:

{
    // ...
    "autoload": {
        "psr-4": {
            "Html2Text\\": [
                "src/",
                "test/"
            ]
        }
    }
}

However, Composer also has an autoload-dev property, which should be used for tests instead. The classmap need not be polluted with tests.

{
    // ...
    "autoload": {
        "psr-4": {
            "Html2Text\\": "src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Html2Text\\": "test/"
        }
    }
}

I'm doubtful if @mtibben is still supporting this package, given the high number of stale pull requests (see #99 and #97)

@mtibben
Copy link
Owner

mtibben commented Apr 16, 2020

Fixed in #99

@mtibben mtibben closed this as completed Apr 16, 2020
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