donatj / PhpUserAgent

Lightning Fast, Minimalist PHP User Agent String Parser.
https://donatstudios.com/PHP-Parser-HTTP_USER_AGENT
MIT License
565 stars 128 forks source link

1.x Release Development #50

Closed donatj closed 4 years ago

donatj commented 6 years ago

I am currently working on a 1.x "major release" which involves some tidying.

I've noted that a lot of people are requiring "*"as their version when I searched github for the packagist name 😢 which means if I made breaking changes I would break their install if they composer updated.

They should use semantic versioning to avoid this, but I still wish to avoid causing unessessary pain.

As such I will try my best to maintain compatibility with this major release. 2.x however I may want to actually move this into a namespace to be more friendly.

donatj commented 5 years ago

@mimmi20 You shouldn't be seeing spaces for indentation anywhere in the code. My PHP here uniformly uses tabs, I have an auto formatter set up that formats all my code so it should all be uniform.

As for .editorconfig if you want to open a separate issue, I can append one.

mimmi20 commented 5 years ago

@donatj Then it must be an issue how the changes are displayed. The files in the bin directory have an ident size of 4, the files in the src directory have an ident size of 8 or more.

donatj commented 5 years ago

@mimmi20 Ah yeah, GitHub is very inconsistent about how it displays tabs.

While I've got your attention, any requests, ideas or review of this major release and the direction it's seemingly headed? I develop this largely in a vacuum and wouldn't mind your 2¢.

That said, keep in mind I'm determined for this release to not break backwards compatibility, and this includes people not using composer who are require-ing a single file.

As such I'm keeping the single file fully functional and self contained.

This puts a sort of weird set of restrictions on me.

I'd like to return an object from the class and have the BC function return an array-ed version, but I'd have to define it in here as well and it adds a pretty large number of LOC with the getters.

A big part of my selling point of this library has been low LOC, lol.

Public members and stdObject's both gross me out, so they're out of the question.

donatj commented 5 years ago

Now I'm pondering turning the whole thing on it's head. Move the logic back into the single function and just add some helpful wrapping objects. I think that would actually be better.

donatj commented 5 years ago

@mimmi20 lol, I also already have a .editorconfig - looks like it's been there for 2 years.