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

Add src/MobileDetectInterface.php #931

Closed tattali closed 1 year ago

serbanghita commented 1 year ago

@tattali why is this needed?

pquerner commented 1 year ago

I like having an interface, however this late into "production" this may break many projects extending this class. Its not a major break and doesnt give much headache, but it is one nonetheless.

For this reason I would maybe use it in a 4.x branch.

serbanghita commented 1 year ago

@pquerner I don't see the practical reason for an interface unless you want to swap implementation or something like that.

I'm not sure if this project will live to see 4.x if Google succeeds with the user-agent reduction initiative 🗡️

serbanghita commented 1 year ago

I believe https://github.com/serbanghita/Mobile-Detect/pull/936 is enough for extensibility