File tree 2 files changed +23
-4
lines changed
src/Symfony/Component/HttpKernel/Bundle
2 files changed +23
-4
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ require_once ('vendor/autoload.php ' );
4
+
5
+ use Symfony \Component \Yaml \Yaml ;
6
+
7
+ $ yaml = file_get_contents ('.travis.yml ' );
8
+
9
+ $ time_start = microtime (true );
10
+
11
+ for ($ i = 0 ; $ i < 1000 ; $ i ++)
12
+ {
13
+ Yaml::parse ($ yaml );
14
+ }
15
+
16
+ $ time_end = microtime (true );
17
+ $ time = $ time_end - $ time_start ;
18
+
19
+ echo 'Durée : ' .$ time .' secondes<br/> ' ;
Original file line number Diff line number Diff line change @@ -30,9 +30,7 @@ abstract class SimpleBundle extends Bundle implements ConfigurationInterface
30
30
*/
31
31
final public function getContainerExtension ()
32
32
{
33
- return new SimpleExtension ($ this , function (array $ config , ContainerBuilder $ container ) {
34
- $ this ->buildContainer ($ config , $ container );
35
- });
33
+ return new SimpleExtension ($ this );
36
34
}
37
35
38
36
/**
@@ -70,7 +68,9 @@ final class SimpleExtension extends Extension
70
68
public function __construct (SimpleBundle $ bundle , Closure $ buildContainer )
71
69
{
72
70
$ this ->bundle = $ bundle ;
73
- $ this ->buildContainer = $ buildContainer ;
71
+ $ this ->buildContainer = Closure::bind (function (array $ config , ContainerBuilder $ container ) {
72
+ $ this ->buildContainer ($ config , $ container );
73
+ }, $ bundle , SimpleBundle::class]);
74
74
}
75
75
76
76
/**
You can’t perform that action at this time.
0 commit comments