@@ -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 | |
@@ -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\Component\ObjectAgent; |
| 6 | 6 | |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | public function __construct(array $agents) |
| 12 | 12 | { |
| 13 | - array_map(function (AgentInterface $agent) { |
|
| 13 | + array_map(function(AgentInterface $agent) { |
|
| 14 | 14 | }, $agents); |
| 15 | 15 | $this->agents = $agents; |
| 16 | 16 | } |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | } |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - $classes = array_map(function ($element) { |
|
| 26 | + $classes = array_map(function($element) { |
|
| 27 | 27 | return get_class($element); |
| 28 | 28 | }, $this->agents); |
| 29 | 29 | |
@@ -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 | |
@@ -23,13 +23,13 @@ discard block |
||
| 23 | 23 | public function getDefaultConfig() |
| 24 | 24 | { |
| 25 | 25 | return [ |
| 26 | - 'db_path' => __DIR__ . '/../../../../cache/test.sqlite', |
|
| 26 | + 'db_path' => __DIR__.'/../../../../cache/test.sqlite', |
|
| 27 | 27 | ]; |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | public function load(Container $container) |
| 31 | 31 | { |
| 32 | - $container->register('phpcr_odm', function (Container $container) { |
|
| 32 | + $container->register('phpcr_odm', function(Container $container) { |
|
| 33 | 33 | $dbPath = $container->getParameter('db_path'); |
| 34 | 34 | $registerNodeTypes = false; |
| 35 | 35 | |
@@ -63,9 +63,9 @@ discard block |
||
| 63 | 63 | $typeRegistrator->registerNodeTypes($session); |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - $xmlDriver = new XmlDriver([__DIR__ . '/mappings']); |
|
| 66 | + $xmlDriver = new XmlDriver([__DIR__.'/mappings']); |
|
| 67 | 67 | $annotationDriver = new AnnotationDriver(new AnnotationReader(), [ |
| 68 | - __DIR__ . '/../../../vendor/doctrine/phpcr-odm/lib/Doctrine/ODM/PHPCR/Document', |
|
| 68 | + __DIR__.'/../../../vendor/doctrine/phpcr-odm/lib/Doctrine/ODM/PHPCR/Document', |
|
| 69 | 69 | ]); |
| 70 | 70 | $chain = new MappingDriverChain(); |
| 71 | 71 | $chain->addDriver($xmlDriver, 'Psi\Bridge\ObjectAgent\Doctrine\PhpcrOdm\Tests\Functional\Model'); |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | return DocumentManager::create($session, $config); |
| 78 | 78 | }); |
| 79 | 79 | |
| 80 | - $container->register('psi_object_agent.phpcr_odm', function (Container $container) { |
|
| 80 | + $container->register('psi_object_agent.phpcr_odm', function(Container $container) { |
|
| 81 | 81 | return new PhpcrOdmAgent($container->get('phpcr_odm')); |
| 82 | 82 | }); |
| 83 | 83 | } |
@@ -1,13 +1,13 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Psi\Component\ObjectAgent\Query; |
| 6 | 6 | |
| 7 | 7 | class Composite implements Expression |
| 8 | 8 | { |
| 9 | - const AND = 'and'; |
|
| 10 | - const OR = 'or'; |
|
| 9 | + constAND= 'and'; |
|
| 10 | + constOR= 'or'; |
|
| 11 | 11 | |
| 12 | 12 | private static $validTypes = [ |
| 13 | 13 | self::AND, |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | public function __construct(string $type, array $expressions) |
| 21 | 21 | { |
| 22 | 22 | // ensure types |
| 23 | - array_map(function (Expression $expr) { |
|
| 23 | + array_map(function(Expression $expr) { |
|
| 24 | 24 | }, $expressions); |
| 25 | 25 | |
| 26 | 26 | if (!in_array($type, self::$validTypes)) { |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | return $this->walkComposite($expr, $parentNode); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - throw new \RuntimeException('Unknown Expression: ' . get_class($expr)); |
|
| 49 | + throw new \RuntimeException('Unknown Expression: '.get_class($expr)); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | /** |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | return $parentNode->gte()->field($this->getField($field))->literal($value)->end(); |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - throw new \RuntimeException('Unknown comparator: ' . $comparison->getComparator()); |
|
| 80 | + throw new \RuntimeException('Unknown comparator: '.$comparison->getComparator()); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | /** |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | private function walkComposite(Composite $expression, AbstractNode $parentNode) |
| 87 | 87 | { |
| 88 | - $node = $expression->getType() === Composite::AND ? $parentNode->andX() : $parentNode->orX(); |
|
| 88 | + $node = $expression->getType() === Composite::AND? $parentNode->andX() : $parentNode->orX(); |
|
| 89 | 89 | |
| 90 | 90 | $expressions = $expression->getExpressions(); |
| 91 | 91 | $leftExpression = array_shift($expressions); |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | private function getField($field): string |
| 113 | 113 | { |
| 114 | - return $this->sourceAlias . '.' . $field; |
|
| 114 | + return $this->sourceAlias.'.'.$field; |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | /** |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | [ |
| 94 | 94 | 'in', |
| 95 | 95 | [10, 20, 30], |
| 96 | - function ($nodes) { |
|
| 96 | + function($nodes) { |
|
| 97 | 97 | $this->assertInstanceOf(ConstraintOrx::class, $nodes[0]); |
| 98 | 98 | $nodes = $nodes[0]->getChildrenOfType(AbstractNode::NT_CONSTRAINT); |
| 99 | 99 | $this->assertInstanceOf(ConstraintComparison::class, $nodes[0]); |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | [ |
| 107 | 107 | 'nin', |
| 108 | 108 | [10, 20, 30], |
| 109 | - function ($nodes) { |
|
| 109 | + function($nodes) { |
|
| 110 | 110 | $this->assertInstanceOf(ConstraintNot::class, $nodes[0]); |
| 111 | 111 | $nodes = $nodes[0]->getChildrenOfType(AbstractNode::NT_CONSTRAINT); |
| 112 | 112 | $this->assertInstanceOf(ConstraintOrx::class, $nodes[0]); |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | [ |
| 119 | 119 | 'not_contains', |
| 120 | 120 | 'hello', |
| 121 | - function ($nodes) { |
|
| 121 | + function($nodes) { |
|
| 122 | 122 | $this->assertInstanceOf(ConstraintNot::class, $nodes[0]); |
| 123 | 123 | $nodes = $nodes[0]->getChildrenOfType(AbstractNode::NT_CONSTRAINT); |
| 124 | 124 | $this->assertEquals('jcr.operator.like', $nodes[0]->getOperator()); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | [ |
| 128 | 128 | 'null', |
| 129 | 129 | null, |
| 130 | - function ($nodes) { |
|
| 130 | + function($nodes) { |
|
| 131 | 131 | $this->assertInstanceOf(ConstraintNot::class, $nodes[0]); |
| 132 | 132 | $nodes = $nodes[0]->getChildrenOfType(AbstractNode::NT_CONSTRAINT); |
| 133 | 133 | $this->assertInstanceOf(ConstraintFieldIsset::class, $nodes[0]); |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | [ |
| 137 | 137 | 'not_null', |
| 138 | 138 | null, |
| 139 | - function ($nodes) { |
|
| 139 | + function($nodes) { |
|
| 140 | 140 | $this->assertInstanceOf(ConstraintFieldIsset::class, $nodes[0]); |
| 141 | 141 | }, |
| 142 | 142 | ], |
@@ -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 | } |
@@ -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,7 +114,7 @@ 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 | 119 | return call_user_func_array([$this->expressionFactory, $method], $ormExpressions); |
| 120 | 120 | } |
@@ -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 | /** |
@@ -149,6 +149,6 @@ discard block |
||
| 149 | 149 | { |
| 150 | 150 | $this->parameters[$name] = $value; |
| 151 | 151 | |
| 152 | - return ':' . $name; |
|
| 152 | + return ':'.$name; |
|
| 153 | 153 | } |
| 154 | 154 | } |