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
Add Api-Platform's version in debug bar #3235
Add Api-Platform's version in debug bar #3235
Conversation
cb41c14
to
0ac0ba4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also add a test please?
It migh be enough to add it in the small tooltip opened on mouseover to save space in the toolbar ? |
0ac0ba4
to
4e16acf
Compare
@dunglas I've added a basic test, but as the data class is final + with a private construct I cannot mock it :( @antograssiot I've moved it in the toolbar: Personally I prefer it 10 times in the debug bar, you see it directly. (like Symfony does) |
83c796e
to
e6abe46
Compare
e6abe46
to
28c3e45
Compare
Thank you @dFayet! |
@@ -96,6 +96,7 @@ | |||
"doctrine/mongodb-odm-bundle": "To support MongoDB. Only versions 4.0 and later are supported.", | |||
"elasticsearch/elasticsearch": "To support Elasticsearch.", | |||
"guzzlehttp/guzzle": "To use the HTTP cache invalidation system.", | |||
"ocramius/package-versions": "To display the API Platform's version in the debug bar.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alanpoulain wouldn't it be more interesting to suggest https://github.com/composer/package-versions-deprecated for composer 1 & 2 compatibility?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about this. If the user doesn't use PHP 7.4 or Composer 2, it will find this package anyway, don't you think?
And ocramius/package-versions
is the original package, it makes sense to me to add it to the suggest list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed 👍
After a small discussion with @dunglas it appears it could be nice to display the Api-Platform's version in the Symfony's debug-bar.
Two solutions were talked about, adding a constant (:-1: because it needs to be maintained), or using ocramius/package-versions (this package is required-dev by symfony/orm).
This feature was proposed to Symfony but it was refused.
So here we are :-)
Output:
Note:
I was not sure about adding tests or not, as the outpu depends of a final class, that might exists or not