Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
removed all *.class parameters#14070
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
fabpot commentedMar 26, 2015
Q | A |
---|---|
Bug fix? | no |
New feature? | no |
BC breaks? | yes |
Deprecations? | no |
Tests pass? | no |
Fixed tickets | #11881,#12822 |
License | MIT |
Doc PR | none |
Here is the script I used: <?phprequire_once__DIR__.'/vendor/autoload.php';useSymfony\Component\Finder\Finder;$finder = (newFinder())->name('*.xml')->in(__DIR__.'/src');$values =array();foreach ($finderas$file) {$contents =file_get_contents($file);$new =preg_replace_callback("{^ +<parameter key=\"([^\"]+)\.class\">([^<]+)</parameter>\n}m",function ($match)use (&$values) {$values['%'.$match[1].'.class%'] =$match[2]; },$contents);$new =preg_replace("{^ +<parameters>\s+</parameters>\n\n}sm",'',$new);$new =preg_replace("{</parameter>\s+</parameters>}s","</parameter>\n </parameters>",$new);$new =preg_replace("{<parameters>\s+ <parameter}s","<parameters>\n <parameter",$new);if ($new !=$contents) {file_put_contents($file,$new); }}$finder = (newFinder())->in(__DIR__.'/src');foreach ($finderas$file) {$contents =file_get_contents($file);$new =preg_replace_callback('{%[a-zA-Z0-9\._]+\.class%}',function ($match)use ($values) {returnisset($values[$match[0]]) ?$values[$match[0]] :$match[0]; },$contents);if ($new !=$contents) {file_put_contents($file,$new); }} |
👍 |
@@ -30,8 +30,6 @@ public function testLoadEmptyConfiguration() | |||
$container->loadFromExtension('twig', array()); | |||
$this->compileContainer($container); | |||
$this->assertEquals('Twig_Environment', $container->getParameter('twig.class'), '->load() loads the twig.xml file'); |
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 guess this tests needs to be replaced by testing whether thetwig
service is defined to keep that test
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.
fixed
Apart from the two small things looks ok to me. |
ebf5eca
to8835d1a
Compare👍 |
This PR was merged into the 3.0-dev branch.Discussion----------removed all *.class parameters| Q | A| ------------- | ---| Bug fix? | no| New feature? | no| BC breaks? | yes| Deprecations? | no| Tests pass? | no| Fixed tickets |#11881,#12822| License | MIT| Doc PR | noneCommits-------8835d1a removed all *.class parameters