1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Bdf\Prime\Query; |
4
|
|
|
|
5
|
|
|
require_once __DIR__ . '/../_files/BenchData.php'; |
6
|
|
|
|
7
|
|
|
use Bdf\Prime\Bench\BenchData; |
8
|
|
|
use Bdf\Prime\Bench\User; |
9
|
|
|
use Bdf\Prime\Cache\ArrayCache; |
10
|
|
|
use Bdf\Prime\Connection\ConnectionConfig; |
|
|
|
|
11
|
|
|
use Bdf\Prime\ConnectionManager; |
12
|
|
|
use Bdf\Prime\Locatorizable; |
13
|
|
|
use Bdf\Prime\Repository\EntityRepository; |
14
|
|
|
use Bdf\Prime\ServiceLocator; |
15
|
|
|
use Bdf\Prime\Types\ArrayType; |
16
|
|
|
use BenchCaseAdapter; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* Bench wrap as results |
20
|
|
|
* |
21
|
|
|
* @Revs(10) |
22
|
|
|
* @Iterations(5) |
23
|
|
|
*/ |
24
|
|
|
class QueryWrapAsBench extends BenchCaseAdapter |
25
|
|
|
{ |
26
|
|
|
/** |
27
|
|
|
* @var ServiceLocator |
28
|
|
|
*/ |
29
|
|
|
protected $prime; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* @var BenchData |
33
|
|
|
*/ |
34
|
|
|
protected $data; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @var ArrayCache |
38
|
|
|
*/ |
39
|
|
|
protected $cache; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @var EntityRepository |
43
|
|
|
*/ |
44
|
|
|
protected $repository; |
45
|
|
|
|
46
|
|
|
|
47
|
|
|
|
48
|
|
|
public function setUp() |
49
|
|
|
{ |
50
|
|
|
$this->cache = new ArrayCache(); |
51
|
|
|
$this->prime = new ServiceLocator(); |
52
|
|
|
$this->prime->connections()->declareConnection('test', BENCH_CONNECTION); |
53
|
|
|
$this->prime->connection('test')->getConfiguration()->getTypes()->register(ArrayType::class, 'array'); |
|
|
|
|
54
|
|
|
Locatorizable::configure($this->prime); |
|
|
|
|
55
|
|
|
|
56
|
|
|
$this->data = new BenchData($this->prime); |
57
|
|
|
$this->data->addAllData(); |
58
|
|
|
|
59
|
|
|
$this->repository = $this->prime->repository(User::class); |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* {@inheritdoc} |
64
|
|
|
*/ |
65
|
|
|
public function tearDown() |
66
|
|
|
{ |
67
|
|
|
$this->data->clear(); |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* |
73
|
|
|
*/ |
74
|
|
|
public function bench_no_wrap() |
75
|
|
|
{ |
76
|
|
|
$this->repository->all(); |
|
|
|
|
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* |
81
|
|
|
*/ |
82
|
|
|
public function bench_wrapAs_collection() |
83
|
|
|
{ |
84
|
|
|
$this->repository->wrapAs('collection')->all(); |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* |
89
|
|
|
*/ |
90
|
|
|
public function bench_wrapAs_array() |
91
|
|
|
{ |
92
|
|
|
$this->repository->wrapAs('array')->all(); |
93
|
|
|
} |
94
|
|
|
} |
95
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths