@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | private $expressionBuilder; |
22 | 22 | |
23 | 23 | /** |
24 | - * @param QueryBuilder $expressionBuilder |
|
24 | + * @param ExpressionBuilder $expressionBuilder |
|
25 | 25 | */ |
26 | 26 | public function __construct(ExpressionBuilder $expressionBuilder) |
27 | 27 | { |
@@ -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 | { |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Psi\Bridge\ObjectAgent\Doctrine\Collections; |
6 | 6 | |
@@ -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 | /** |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | } |
97 | 97 | |
98 | - throw new \RuntimeException('Unknown comparator: ' . $comparison->getComparator()); |
|
98 | + throw new \RuntimeException('Unknown comparator: '.$comparison->getComparator()); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | $ormExpressions[] = $this->dispatch($childExpression); |
111 | 111 | } |
112 | 112 | |
113 | - $method = $expression->getType() == Composite::AND ? 'andX' : 'orX'; |
|
113 | + $method = $expression->getType() == Composite::AND? 'andX' : 'orX'; |
|
114 | 114 | |
115 | 115 | return call_user_func_array([$this->expressionBuilder, $method], $ormExpressions); |
116 | 116 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | [ |
109 | 109 | 'null', |
110 | 110 | null, |
111 | - function ($expr) { |
|
111 | + function($expr) { |
|
112 | 112 | $this->assertEquals('=', $expr->getOperator()); |
113 | 113 | $this->assertNull($expr->getValue()->getValue()); |
114 | 114 | }, |
@@ -116,17 +116,17 @@ discard block |
||
116 | 116 | [ |
117 | 117 | 'in', |
118 | 118 | [1, 2, 3], |
119 | - function ($expr) { |
|
119 | + function($expr) { |
|
120 | 120 | $this->assertEquals('IN', $expr->getOperator()); |
121 | - $this->assertEquals([ 1, 2, 3 ], $expr->getValue()->getValue()); |
|
121 | + $this->assertEquals([1, 2, 3], $expr->getValue()->getValue()); |
|
122 | 122 | }, |
123 | 123 | ], |
124 | 124 | [ |
125 | 125 | 'nin', |
126 | 126 | [1, 2, 3], |
127 | - function ($expr) { |
|
127 | + function($expr) { |
|
128 | 128 | $this->assertEquals('NIN', $expr->getOperator()); |
129 | - $this->assertEquals([ 1, 2, 3 ], $expr->getValue()->getValue()); |
|
129 | + $this->assertEquals([1, 2, 3], $expr->getValue()->getValue()); |
|
130 | 130 | }, |
131 | 131 | ], |
132 | 132 | ]; |
@@ -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 | } |
@@ -82,8 +82,9 @@ |
||
82 | 82 | public function getIdentifier($object) |
83 | 83 | { |
84 | 84 | foreach ($this->getCollectionFor($object) as $identifier => $element) { |
85 | - if ($element === $object) |
|
86 | - return $identifier; |
|
85 | + if ($element === $object) { |
|
86 | + return $identifier; |
|
87 | + } |
|
87 | 88 | } |
88 | 89 | |
89 | 90 | throw new \RuntimeException(sprintf( |
@@ -17,7 +17,7 @@ |
||
17 | 17 | |
18 | 18 | public function addCollection($classFqn, array $collection) |
19 | 19 | { |
20 | - array_map(function ($object) use ($classFqn) { |
|
20 | + array_map(function($object) use ($classFqn) { |
|
21 | 21 | if (get_class($object) !== $classFqn) { |
22 | 22 | throw new \InvalidArgumentException(sprintf( |
23 | 23 | 'All objects in collection must be of class "%s", got "%s"', |
@@ -23,7 +23,7 @@ |
||
23 | 23 | { |
24 | 24 | throw new self(sprintf( |
25 | 25 | 'Comparison "%s" is not supported.', |
26 | - $comparison |
|
26 | + $comparison |
|
27 | 27 | )); |
28 | 28 | } |
29 | 29 | } |