-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
symfony/config does not support multiline text #60317
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
Labels
Comments
Example after using the patch: <?php
namespace Symfony\Config;
use Symfony\Component\Config\Loader\ParamConfigurator;
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
/**
* This class is automatically generated to help in creating a config.
*/
class TemporalConfig implements \Symfony\Component\Config\Builder\ConfigBuilderInterface
{
private $foo;
private $_usedProperties = [];
/**
* Sets the rate limiting on number of activities that can be
* executed per second per worker. This can be used to limit resources used by the worker.
* Notice that the number is represented in float, so that you can set it
* to less than 1 if needed. For example, set the number to 0.1 means you
* want your activity to be executed once for every 10 seconds. This can be
* used to protect down stream services from flooding.
* @default 'bar'
* @param ParamConfigurator|mixed $value
* @return $this
*/
public function foo($value): static
{
$this->_usedProperties['foo'] = true;
$this->foo = $value;
return $this;
}
public function getExtensionAlias(): string
{
return 'temporal';
}
public function __construct(array $value = [])
{
if (array_key_exists('foo', $value)) {
$this->_usedProperties['foo'] = true;
$this->foo = $value['foo'];
unset($value['foo']);
}
if ([] !== $value) {
throw new InvalidConfigurationException(sprintf('The following keys are not supported by "%s": ', __CLASS__).implode(', ', array_keys($value)));
}
}
public function toArray(): array
{
$output = [];
if (isset($this->_usedProperties['foo'])) {
$output['foo'] = $this->foo;
}
return $output;
}
} |
Thanks for reporting this issue. I opened #60400. ->info(<<<STRING
Sets the rate limiting on number of activities that can be
executed per second per worker. This can be used to limit resources used by the worker.
Notice that the number is represented in float, so that you can set it
to less than 1 if needed. For example, set the number to 0.1 means you
want your activity to be executed once for every 10 seconds. This can be
used to protect down stream services from flooding.
STRING) Status: Reviewed |
fabpot
added a commit
that referenced
this issue
May 14, 2025
This PR was squashed before being merged into the 6.4 branch. Discussion ---------- [Config] Fix generated comment for multiline "info" | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #60317 | License | MIT Instead of fixing the multiline comment formatting only for the "info" part, the `* ` is now prepended to every line of the generated comment block. `nette/code-generator` uses almost the same transformation: https://github.com/nette/php-generator/blob/42806049a7774a2bd316c958f5dcf01c6b5c56fa/src/PhpGenerator/Helpers.php#L60 Commits ------- 941c051 [Config] Fix generated comment for multiline "info"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Symfony version(s) affected
5.3 - 7.3
Description
The symfony/config component formats phpdoc comments very poorly, and does not support multiple hyphenated text. Example below
How to reproduce
Repoduce stand:
Output:
Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: