This repository was archived by the owner on Feb 6, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ namespace ZendBench \ServiceManager \BenchAsset ;
3
+
4
+ class Bar
5
+ {
6
+ protected $ options ;
7
+
8
+ public function __construct ($ options = null )
9
+ {
10
+ $ this ->options = $ options ;
11
+ }
12
+ }
Original file line number Diff line number Diff line change 5
5
use PhpBench \Benchmark \Metadata \Annotations \Iterations ;
6
6
use PhpBench \Benchmark \Metadata \Annotations \Revs ;
7
7
use PhpBench \Benchmark \Metadata \Annotations \Warmup ;
8
+ use Zend \ServiceManager \AbstractFactory \ConfigAbstractFactory ;
8
9
use Zend \ServiceManager \ServiceManager ;
9
10
10
11
/**
@@ -30,14 +31,20 @@ public function __construct()
30
31
],
31
32
'services ' => [
32
33
'service1 ' => new \stdClass (),
34
+ 'config ' => [
35
+ ConfigAbstractFactory::class => [
36
+ BenchAsset \Bar::class => [],
37
+ ],
38
+ ],g
33
39
],
34
40
'aliases ' => [
35
41
'factoryAlias1 ' => 'factory1 ' ,
36
42
'recursiveFactoryAlias1 ' => 'factoryAlias1 ' ,
37
43
'recursiveFactoryAlias2 ' => 'recursiveFactoryAlias1 ' ,
38
44
],
39
45
'abstract_factories ' => [
40
- BenchAsset \AbstractFactoryFoo::class
46
+ BenchAsset \AbstractFactoryFoo::class,
47
+ ConfigAbstractFactory::class,
41
48
],
42
49
]);
43
50
}
@@ -145,4 +152,10 @@ public function benchBuildAbstractFactoryFoo()
145
152
146
153
$ sm ->build ('foo ' );
147
154
}
155
+
156
+ public function benchFetchConfigAbstractFactoryBar ()
157
+ {
158
+ $ sm = clone $ this ->sm ;
159
+ $ sm ->get (BenchAsset \Bar::class);
160
+ }
148
161
}
You can’t perform that action at this time.
0 commit comments