@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | private $parameters = []; |
21 | 21 | |
22 | 22 | /** |
23 | - * @param QueryBuilder $expressionFactory |
|
23 | + * @param Expr $expressionFactory |
|
24 | 24 | */ |
25 | 25 | public function __construct(Expr $expressionFactory, string $sourceAlias) |
26 | 26 | { |
@@ -32,7 +32,6 @@ discard block |
||
32 | 32 | * Walk the given expression to build up the PHPCR-ODM query builder. |
33 | 33 | * |
34 | 34 | * @param Expression $expr |
35 | - * @param AbstractNode|null $parentNode |
|
36 | 35 | */ |
37 | 36 | public function dispatch(Expression $expr) |
38 | 37 | { |
@@ -111,7 +111,7 @@ |
||
111 | 111 | |
112 | 112 | $ormExpressions = []; |
113 | 113 | foreach ($expressions as $index => $childExpression) { |
114 | - $ormExpressions[] = $this->dispatch($childExpression); |
|
114 | + $ormExpressions[] = $this->dispatch($childExpression); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | $method = $expression->getType() == Composite::AND ? 'andX' : 'orX'; |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | return $this->walkComposite($expr); |
46 | 46 | } |
47 | 47 | |
48 | - throw new \RuntimeException('Unknown Expression: ' . get_class($expr)); |
|
48 | + throw new \RuntimeException('Unknown Expression: '.get_class($expr)); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | public function getParameters() |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | return $this->expressionFactory->isNotNull($field, $this->registerParameter($field, $value)); |
100 | 100 | } |
101 | 101 | |
102 | - throw new \RuntimeException('Unknown comparator: ' . $comparison->getComparator()); |
|
102 | + throw new \RuntimeException('Unknown comparator: '.$comparison->getComparator()); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
@@ -114,9 +114,9 @@ discard block |
||
114 | 114 | $ormExpressions[] = $this->dispatch($childExpression); |
115 | 115 | } |
116 | 116 | |
117 | - $method = $expression->getType() == Composite::AND ? 'andX' : 'orX'; |
|
117 | + $method = $expression->getType() == Composite::AND? 'andX' : 'orX'; |
|
118 | 118 | |
119 | - return call_user_func_array([ $this->expressionFactory, $method ], $ormExpressions); |
|
119 | + return call_user_func_array([$this->expressionFactory, $method], $ormExpressions); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | /** |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | */ |
127 | 127 | private function getField($field): string |
128 | 128 | { |
129 | - return $this->sourceAlias . '.' . $field; |
|
129 | + return $this->sourceAlias.'.'.$field; |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | /** |
@@ -148,6 +148,6 @@ discard block |
||
148 | 148 | private function registerParameter(string $name, $value) |
149 | 149 | { |
150 | 150 | $this->parameters[$name] = $value; |
151 | - return ':' . $name; |
|
151 | + return ':'.$name; |
|
152 | 152 | } |
153 | 153 | } |
@@ -3,12 +3,6 @@ |
||
3 | 3 | |
4 | 4 | namespace Psi\Bridge\ObjectAgent\Doctrine\Orm\Tests\Functional; |
5 | 5 | |
6 | -use Doctrine\ODM\PHPCR\Query\Builder\AbstractNode; |
|
7 | -use Doctrine\ODM\PHPCR\Query\Builder\ConstraintAndx; |
|
8 | -use Doctrine\ODM\PHPCR\Query\Builder\ConstraintComparison; |
|
9 | -use Doctrine\ODM\PHPCR\Query\Builder\ConstraintFieldIsset; |
|
10 | -use Doctrine\ODM\PHPCR\Query\Builder\ConstraintNot; |
|
11 | -use Doctrine\ODM\PHPCR\Query\Builder\ConstraintOrx; |
|
12 | 6 | use Psi\Bridge\ObjectAgent\Doctrine\Orm\ExpressionVisitor; |
13 | 7 | use Psi\Component\ObjectAgent\Tests\Functional\Model\Page; |
14 | 8 | use Psi\Component\ObjectAgent\Query\Query; |
@@ -101,29 +101,29 @@ |
||
101 | 101 | [ |
102 | 102 | 'null', |
103 | 103 | null, |
104 | - function ($expr) { |
|
104 | + function($expr) { |
|
105 | 105 | $this->assertEquals('title IS NULL', $expr); |
106 | 106 | }, |
107 | 107 | ], |
108 | 108 | [ |
109 | 109 | 'not_null', |
110 | 110 | null, |
111 | - function ($expr) { |
|
111 | + function($expr) { |
|
112 | 112 | $this->assertEquals('title IS NOT NULL', $expr); |
113 | 113 | }, |
114 | 114 | ], |
115 | 115 | [ |
116 | 116 | 'in', |
117 | - [ 1, 2, 3 ], |
|
118 | - function ($expr) { |
|
117 | + [1, 2, 3], |
|
118 | + function($expr) { |
|
119 | 119 | $this->assertInstanceOf(Func::class, $expr); |
120 | 120 | $this->assertEquals('title IN', $expr->getName()); |
121 | 121 | }, |
122 | 122 | ], |
123 | 123 | [ |
124 | 124 | 'nin', |
125 | - [ 1, 2, 3 ], |
|
126 | - function ($expr) { |
|
125 | + [1, 2, 3], |
|
126 | + function($expr) { |
|
127 | 127 | $this->assertInstanceOf(Func::class, $expr); |
128 | 128 | $this->assertEquals('title NOT IN', $expr->getName()); |
129 | 129 | }, |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Psi\Bridge\ObjectAgent\Doctrine\PhpcrOdm; |
6 | 6 |
@@ -24,19 +24,19 @@ discard block |
||
24 | 24 | public function getDefaultConfig() |
25 | 25 | { |
26 | 26 | return [ |
27 | - 'db_path' => __DIR__ . '/../../../../cache/test.sqlite', |
|
27 | + 'db_path' => __DIR__.'/../../../../cache/test.sqlite', |
|
28 | 28 | ]; |
29 | 29 | } |
30 | 30 | |
31 | 31 | public function load(Container $container) |
32 | 32 | { |
33 | - $container->register('entity_manager', function (Container $container) { |
|
33 | + $container->register('entity_manager', function(Container $container) { |
|
34 | 34 | $dbParams = [ |
35 | 35 | 'driver' => 'pdo_sqlite', |
36 | 36 | 'path' => $container->getParameter('db_path'), |
37 | 37 | ]; |
38 | 38 | $paths = [ |
39 | - __DIR__ . '/mappings', |
|
39 | + __DIR__.'/mappings', |
|
40 | 40 | ]; |
41 | 41 | $config = Setup::createXMLMetadataConfiguration($paths, true); |
42 | 42 | $manager = EntityManager::create($dbParams, $config); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | return $manager; |
45 | 45 | }); |
46 | 46 | |
47 | - $container->register('psi_object_agent.doctrine_orm', function (Container $container) { |
|
47 | + $container->register('psi_object_agent.doctrine_orm', function(Container $container) { |
|
48 | 48 | return new OrmAgent($container->get('entity_manager')); |
49 | 49 | }); |
50 | 50 | } |