-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Config] Add NodeDefinition::docUrl()
#59762
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
Conversation
src/Symfony/Bundle/DebugBundle/DependencyInjection/Configuration.php
Outdated
Show resolved
Hide resolved
This can also be used in the Yaml JsonSchema: #59620 |
acbda3f
to
b9240b9
Compare
Should we bump the minimum requirement for |
src/Symfony/Bundle/DebugBundle/DependencyInjection/Configuration.php
Outdated
Show resolved
Hide resolved
I suggest bumping the min version instead of doing conditional calls. It makes the code simpler |
6d8ef52
to
b2502a8
Compare
You should probably also update the dumpers to add a comment with the documentation URL (when present), so that |
b2502a8
to
4323787
Compare
src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php
Outdated
Show resolved
Hide resolved
3a00a22
to
c7f73c8
Compare
c7f73c8
to
d6884cc
Compare
src/Symfony/Bundle/DebugBundle/DependencyInjection/Configuration.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php
Outdated
Show resolved
Hide resolved
d6884cc
to
168ede3
Compare
NodeDefinition::documentationUri()
NodeDefinition::docUrl()
public function docUrl(string $uri, ?string $package = null): static | ||
{ | ||
if ($package) { | ||
preg_match('/^(\d+)\.(\d+)\.(\d+)/', InstalledVersions::getVersion($package) ?? '', $m); |
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.
No $
, because some packages may return a fourth number (in local, phpunit/phpunit
returns 9.6.99.0
for example on my computer)
src/Symfony/Component/Config/Tests/Definition/Builder/NodeDefinitionTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Config/Tests/Definition/Builder/NodeDefinitionTest.php
Outdated
Show resolved
Hide resolved
168ede3
to
1d3c7b3
Compare
1d3c7b3
to
a27e4aa
Compare
src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php
Outdated
Show resolved
Hide resolved
a27e4aa
to
3c7fce2
Compare
@@ -18,13 +18,14 @@ | |||
"require": { | |||
"php": ">=8.2", | |||
"ext-xml": "*", | |||
"composer-runtime-api": ">=2.1", |
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.
When installing the smallest possible Symfony app, we currently only require Symfony deps. So, that would be the first non-Symfony dependency that we require.
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.
I had the same thought until I realized the framework bundle already has this dependency:
https://github.com/symfony/symfony/blob/7.3/src/Symfony/Bundle/FrameworkBundle/composer.json
Thank you @alexandre-daubois. |
…xabbuh) This PR was merged into the 7.3 branch. Discussion ---------- [DebugBundle] require the 7.3+ of the Config component | Q | A | ------------- | --- | Branch? | 7.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | | License | MIT related to #59762, we could bump the conflict rule instead, but I don't see a use case where using the bundle without the Config component actually makes sense Commits ------- 28d1a83 require the 7.3+ of the Config component
Adding such information would allow extensions and bundles to provide even more info with a documentation "one click away".
The primary goal is to use this feature in conjunction with #58771, allowing to dump a
@see https://symfony.com/doc/...
right next to the configuration array shape.