serbanghita / Mobile-Detect

Mobile_Detect is a lightweight PHP class for detecting mobile devices (including tablets). It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.
http://mobiledetect.net
MIT License
10.52k stars 2.67k forks source link

Update composer to use correct autoload setting for tests #944

Closed JPry closed 10 months ago

JPry commented 10 months ago

This PR updates the composer.json file to move the autoload setting for tests/ into autoload-dev.

The reason for this change is that the tests/ directory is (correctly) not inculded in distribution, but including it in the normal autoload property still specifies the testing namespace. In distribution, this namespace doesn't exist.

More specifically, if we attempt to use a 3rd party tool (such as Mozart) to add a prefix to this namespace, the extraneous namespace for tests/ causes an error to be thrown. Moving the namespace to autoload-dev solves this issue.

serbanghita commented 10 months ago

@JPry thank you! 🙇 I will release a new version today!

JPry commented 10 months ago

Thanks @serbanghita!