|
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 as BenchUser; |
|
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
|
|
|
|
|
17
|
|
|
/** |
|
18
|
|
|
* Bench query generation with dynamic join |
|
19
|
|
|
* @Revs(10) |
|
20
|
|
|
*/ |
|
21
|
|
|
class JoinBench extends \BenchCaseAdapter |
|
22
|
|
|
{ |
|
23
|
|
|
/** |
|
24
|
|
|
* @var ServiceLocator |
|
25
|
|
|
*/ |
|
26
|
|
|
protected $prime; |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* @var BenchData |
|
30
|
|
|
*/ |
|
31
|
|
|
protected $data; |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* @var ArrayCache |
|
35
|
|
|
*/ |
|
36
|
|
|
protected $cache; |
|
37
|
|
|
|
|
38
|
|
|
/** |
|
39
|
|
|
* @var EntityRepository |
|
40
|
|
|
*/ |
|
41
|
|
|
protected $repository; |
|
42
|
|
|
|
|
43
|
|
|
|
|
44
|
|
|
|
|
45
|
|
|
public function setUp() |
|
46
|
|
|
{ |
|
47
|
|
|
$this->cache = new ArrayCache(); |
|
48
|
|
|
$this->prime = new ServiceLocator(); |
|
49
|
|
|
$this->prime->connections()->declareConnection('test', BENCH_CONNECTION); |
|
50
|
|
|
$this->prime->connection('test')->getConfiguration()->getTypes()->register(ArrayType::class, 'array'); |
|
|
|
|
|
|
51
|
|
|
Locatorizable::configure($this->prime); |
|
|
|
|
|
|
52
|
|
|
|
|
53
|
|
|
$this->data = new BenchData($this->prime); |
|
54
|
|
|
$this->data->addAllData(); |
|
55
|
|
|
|
|
56
|
|
|
$this->repository = $this->prime->repository(BenchUser::class); |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
|
|
/** |
|
60
|
|
|
* {@inheritdoc} |
|
61
|
|
|
*/ |
|
62
|
|
|
public function tearDown() |
|
63
|
|
|
{ |
|
64
|
|
|
$this->data->clear(); |
|
65
|
|
|
} |
|
66
|
|
|
|
|
67
|
|
|
|
|
68
|
|
|
/** |
|
69
|
|
|
* @ParamProviders({"joins"}) |
|
70
|
|
|
*/ |
|
71
|
|
|
public function bench($params) |
|
72
|
|
|
{ |
|
73
|
|
|
list($clause, $value) = $params; |
|
74
|
|
|
|
|
75
|
|
|
$this->repository |
|
76
|
|
|
->where($clause, $value) |
|
77
|
|
|
->toSql(); |
|
|
|
|
|
|
78
|
|
|
} |
|
79
|
|
|
|
|
80
|
|
|
/** |
|
81
|
|
|
* |
|
82
|
|
|
*/ |
|
83
|
|
|
public function joins() |
|
84
|
|
|
{ |
|
85
|
|
|
return [ |
|
86
|
|
|
['customer.packs.label', 'Simply'], |
|
87
|
|
|
['customer.name', 'customer Common name'], |
|
88
|
|
|
['customer.id', '330000'], |
|
89
|
|
|
]; |
|
90
|
|
|
} |
|
91
|
|
|
} |
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