Commit 375a2c7
committed
minor #9807 [DependencyInjection] Avoid call_user_func in dumped containers. (realityking)
This PR was merged into the 2.5-dev branch.
Discussion
----------
[DependencyInjection] Avoid call_user_func in dumped containers.
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
This is the second commit from #9432.
When using static methods for either the factory or as the configurator we can avoid using call_user_func and directly use the class:method notation. This is faster (about 5 times, but we're talking milliseconds here) but I think the resulting code is also much easier to read.
The code to use call_user_func has to remain in PhpDumper because in the uncompiled container they still get used.
Commits
-------
be1eaaa [DependencyInjection] Avoid call_user_func in dumped containers.File tree
Expand file treeCollapse file tree
3 files changed
+17
-4
lines changedOpen diff view settings
Filter options
- src/Symfony/Component/DependencyInjection
- Dumper
- Tests/Fixtures/php
Expand file treeCollapse file tree
3 files changed
+17
-4
lines changedOpen diff view settings
Collapse file
src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php+13Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
487 | 487 | |
488 | 488 | |
489 | 489 | |
| 490 | + |
| 491 | + |
| 492 | + |
| 493 | + |
| 494 | + |
| 495 | + |
490 | 496 | |
491 | 497 | |
492 | 498 | |
| ||
691 | 697 | |
692 | 698 | |
693 | 699 | |
| 700 | + |
| 701 | + |
| 702 | + |
| 703 | + |
| 704 | + |
| 705 | + |
| 706 | + |
694 | 707 | |
695 | 708 | |
696 | 709 | |
|
Collapse file
src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php
Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
138 | 138 | |
139 | 139 | |
140 | 140 | |
141 | | - |
| 141 | + |
142 | 142 | |
143 | 143 | |
144 | 144 | |
|
Collapse file
src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php
Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php+3-3Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
148 | 148 | |
149 | 149 | |
150 | 150 | |
151 | | - |
| 151 | + |
152 | 152 | |
153 | 153 | |
154 | 154 | |
| ||
169 | 169 | |
170 | 170 | |
171 | 171 | |
172 | | - |
| 172 | + |
173 | 173 | |
174 | | - |
| 174 | + |
175 | 175 | |
176 | 176 | |
177 | 177 | |
|
0 commit comments