2
2
3
3
namespace PHPCR \Benchmark \Query ;
4
4
5
- use PhpBench \BenchIteration ;
6
5
use PHPCR \Benchmark \BaseBench ;
6
+ use PhpBench \Benchmark ;
7
+ use PhpBench \Benchmark \Iteration ;
7
8
8
- class QueryBench extends BaseBench
9
+ class QueryBench extends BaseBench implements Benchmark
9
10
{
10
11
/**
11
12
* @description Run a select query
@@ -14,7 +15,7 @@ class QueryBench extends BaseBench
14
15
* @beforeMethod beforeCreateNodes
15
16
* @iterations 1
16
17
*/
17
- public function benchQuery (BenchIteration $ iteration )
18
+ public function benchQuery (Iteration $ iteration )
18
19
{
19
20
$ query = $ this ->getQueryManager ()->createQuery ($ iteration ->getParameter ('query ' ), 'JCR-SQL2 ' );
20
21
$ query ->execute ();
@@ -27,7 +28,7 @@ public function benchQuery(BenchIteration $iteration)
27
28
* @beforeMethod beforeCreateNodes
28
29
* @iterations 1
29
30
*/
30
- public function benchQueryAndIterate (BenchIteration $ iteration )
31
+ public function benchQueryAndIterate (Iteration $ iteration )
31
32
{
32
33
$ query = $ this ->getQueryManager ()->createQuery ($ iteration ->getParameter ('query ' ), 'JCR-SQL2 ' );
33
34
$ result = $ query ->execute ();
@@ -44,7 +45,7 @@ public function benchQueryAndIterate(BenchIteration $iteration)
44
45
* @beforeMethod beforeCreateNodes
45
46
* @iterations 2
46
47
*/
47
- public function benchQueryAndIterateWithNode (BenchIteration $ iteration )
48
+ public function benchQueryAndIterateWithNode (Iteration $ iteration )
48
49
{
49
50
$ query = $ this ->getQueryManager ()->createQuery ($ iteration ->getParameter ('query ' ), 'JCR-SQL2 ' );
50
51
$ result = $ query ->execute ();
@@ -111,7 +112,7 @@ public function benchSearchPropertyFullText()
111
112
}
112
113
}
113
114
114
- public function beforeCreateNodes (BenchIteration $ iteration )
115
+ public function beforeCreateNodes (Iteration $ iteration )
115
116
{
116
117
// do not recreate nodes in the same iteration set
117
118
if ($ iteration ->getIndex () > 0 ) {
@@ -134,7 +135,7 @@ public function beforeCreateNodes(BenchIteration $iteration)
134
135
$ this ->getSession ()->save ();
135
136
}
136
137
137
- public function beforeAppendNode (BenchIteration $ iteration )
138
+ public function beforeAppendNode (Iteration $ iteration )
138
139
{
139
140
// do not recreate nodes in the same iteration set
140
141
if ($ iteration ->getIndex () > 0 ) {
0 commit comments