Seldaek / monolog

Sends your logs to files, sockets, inboxes, databases and various web services
https://seldaek.github.io/monolog/
MIT License
21.04k stars 1.9k forks source link

Rename `Monolog\DateTimeImmutable` to something else, e.g. `JsonSerializableDateTimeImmutable` #1926

Open ruudk opened 3 days ago

ruudk commented 3 days ago

First of all, thanks for this amazing package 💙

So this is something that I'm bothered by for a long time. Every time I want to import DateTimeImmutable, PHPStorm asks me which one I want to import:

Screenshot 2024-11-21 at 12 14 13@2x

Even though the version of Monolog is namespaced, it's still annoying to think which one to pick.

I want to propose the following:

Or if there is a better way to do this, I'm all ears. I would be happy to create the PR.

/cc @Seldaek

Seldaek commented 3 days ago

Yeah i wonder if marking it internal would help? Can you try that locally maybe? There's a minor use case of passing it directly to addRecord but i dont think many people do that..

Renaming would be cleaner but a longer term solution.

Not sure what else is possible.

ruudk commented 3 days ago

Marking it as internal won't do anything for PHPStorm.

Seldaek commented 3 days ago

And did you try if an alias helps? Because I'm guessing it would also still suggest the alias, if so that'd only be fixed in 4.0

ruudk commented 3 days ago

The alias won't hide it :(

So it will be a long time before I can enjoy it, but I still think it's good to prepare this for 4.0, so I created the PR: