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

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

Closed
ruudk opened this issue Nov 21, 2024 · 4 comments · Fixed by #1928
Closed
Labels

Comments

@ruudk
Copy link
Contributor

ruudk commented Nov 21, 2024

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:

  • Rename Monolog\DateTimeImmutable to something different, for example: Monolog\JsonSerializableDateTimeImmutable
  • Keep the old Monolog\DateTimeImmutable as an alias for Monolog\JsonSerializableDateTimeImmutable, and mark it as deprecated.
  • In the next major, remove Monolog\DateTimeImmutable

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

/cc @Seldaek

@ruudk ruudk added the Feature label Nov 21, 2024
@Seldaek
Copy link
Owner

Seldaek commented Nov 21, 2024

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
Copy link
Contributor Author

ruudk commented Nov 21, 2024

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

@Seldaek
Copy link
Owner

Seldaek commented Nov 21, 2024

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 added a commit to ruudk/monolog that referenced this issue Nov 21, 2024
@ruudk
Copy link
Contributor Author

ruudk commented Nov 21, 2024

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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants