Skip to content

Conversation

@GrahamCampbell
Copy link
Collaborator

@GrahamCampbell GrahamCampbell commented Sep 25, 2021

Reverts #38852. Supports psr log v1, v2 and v3.

@X-Coder264
Copy link
Contributor

X-Coder264 commented Sep 25, 2021

What does removing the string|Stringable types fix? If it's compatibility with psr/log v1 I don't think that's needed for Laravel 9 anymore as every lib out there that is frequently used is compatible with at least psr/log v2 already AFAIK (and even if not there's plently of time for the community to catch up before the Laravel 9 release next year).

@GrahamCampbell
Copy link
Collaborator Author

Lots of libs still only support v1 and breaking v1 support is silly. When we can easily support everything, we should.

@GrahamCampbell
Copy link
Collaborator Author

We can also clearly see most people still use v1:

image

@GrahamCampbell
Copy link
Collaborator Author

image

@X-Coder264
Copy link
Contributor

Fair enough, even though I'm more on the "let's push the community forward" line of thinking (by making Laravel 9 support psr log v2 and v3 instead of all three major versions). For v1 there's still Laravel <=8.

@GrahamCampbell
Copy link
Collaborator Author

I don't agree that's a good approach here. We can certainly recommend people v3, but until everyone gets caught up, we just needlessly stopping people from upgrading. Maybe once v3 is up to 30% of the downloads, we could reconsider, maybe for Laravel 10.

@taylorotwell taylorotwell merged commit 747032b into master Sep 26, 2021
@taylorotwell taylorotwell deleted the revert-38852-patch-10 branch September 26, 2021 20:38
@kylekatarnls
Copy link
Contributor

For me scarifying the type strictness to allow backward compatibility with v1 and v2 is fine, but I proposed this change because I got interface incompatibility PHP errors when using PHP 8.1 and psr/log 3, I will check if it's now working but if you just revert the previous change we likely have the incompatibility again.

@GrahamCampbell
Copy link
Collaborator Author

This is not a straight up revert. It fixes compatibility with v3, without breaking v1 and v2.

@kylekatarnls
Copy link
Contributor

Oh I see you reverted the param type but not the return type so it's both covariant and contravariant.

Impressed

@GrahamCampbell
Copy link
Collaborator Author

Yeh. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants