You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR was squashed before being merged into the master branch (closes #7620).
Discussion
----------
Enforce sprintf for exceptions
| Q | A
| ------------- | ---
| Bug fix? |no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | [yes|no]
| Fixed tickets | n/a
| License | MIT
| Doc PR | symfony/symfony-docs#2483
Changed format of exceptions which concatenate strings as follows
````
throw new \Exception('The '.$something.' needs the '.$foobar.' parameter');
````
to
````
throw new \Exception(sprintf('The %s needs the %s parameter', $something, $foobar));
````
This follows discussion on mailing list: https://groups.google.com/forum/?fromgroups#!topic/symfony-devs/tecj3UOAueM
Unit test results are pending...
Commits
-------
e655120 Enforce sprintf for exceptions
thrownew \LogicException('The extension with alias "'.$extension->getAlias().
113
-
'" does not have it\'s getConfiguration() method setup');
112
+
thrownew \LogicException(sprintf('The extension with alias "%s" does not have it\'s getConfiguration() method setup', $extension->getAlias()));
114
113
}
115
114
116
115
if (!$configurationinstanceof ConfigurationInterface) {
117
-
thrownew \LogicException(
118
-
'Configuration class "'.get_class($configuration).
119
-
'" should implement ConfigurationInterface in order to be dumpable');
116
+
thrownew \LogicException(sprintf('Configuration class "%s" should implement ConfigurationInterface in order to be dumpable', get_class($configuration)));
0 commit comments