Passed
Push — develop ( 1de0e8...a7f176 )
by nguereza
03:49
created
src/EntityManager.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -57,8 +57,7 @@  discard block
 block discarded – undo
57 57
  * Class EntityManager
58 58
  * @package Platine\Orm
59 59
  */
60
-class EntityManager
61
-{
60
+class EntityManager {
62 61
 
63 62
     /**
64 63
      * The connection
@@ -82,8 +81,7 @@  discard block
 block discarded – undo
82 81
      * Create new instance
83 82
      * @param Connection $connection
84 83
      */
85
-    public function __construct(Connection $connection)
86
-    {
84
+    public function __construct(Connection $connection) {
87 85
         $this->connection = $connection;
88 86
         $this->dateFormat = $connection->getDriver()->getDateFormat();
89 87
     }
Please login to merge, or discard this patch.
src/Repository.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -62,8 +62,7 @@  discard block
 block discarded – undo
62 62
  * Class Repository
63 63
  * @package Platine\Orm
64 64
  */
65
-class Repository implements RepositoryInterface
66
-{
65
+class Repository implements RepositoryInterface {
67 66
 
68 67
     /**
69 68
      * The entity class
@@ -94,8 +93,7 @@  discard block
 block discarded – undo
94 93
      * @param EntityManager $manager
95 94
      * @param class-string $entityClass
96 95
      */
97
-    public function __construct(EntityManager $manager, string $entityClass)
98
-    {
96
+    public function __construct(EntityManager $manager, string $entityClass) {
99 97
         $this->manager = $manager;
100 98
         $this->entityClass = $entityClass;
101 99
     }
@@ -213,8 +211,7 @@  discard block
 block discarded – undo
213 211
     /**
214 212
      * {@inheritedoc}
215 213
      */
216
-    public function insert(Entity $entity)
217
-    {
214
+    public function insert(Entity $entity) {
218 215
         $data = Proxy::instance()->getEntityDataMapper($entity);
219 216
         $mapper = $data->getEntityMapper();
220 217
         $eventsHandlers = $mapper->getEventHandlers();
Please login to merge, or discard this patch.
src/Query/Query.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -57,8 +57,7 @@  discard block
 block discarded – undo
57 57
  * Class Query
58 58
  * @package Platine\Orm\Query
59 59
  */
60
-class Query extends BaseStatement
61
-{
60
+class Query extends BaseStatement {
62 61
 
63 62
     /**
64 63
      *
@@ -95,8 +94,7 @@  discard block
 block discarded – undo
95 94
      *
96 95
      * @param QueryStatement|null $queryStatement
97 96
      */
98
-    public function __construct(QueryStatement $queryStatement = null)
99
-    {
97
+    public function __construct(QueryStatement $queryStatement = null) {
100 98
         parent::__construct($queryStatement);
101 99
         $this->havingStatement = new HavingStatement($this->queryStatement);
102 100
     }
@@ -104,8 +102,7 @@  discard block
 block discarded – undo
104 102
     /**
105 103
      * Clone the object
106 104
      */
107
-    public function __clone()
108
-    {
105
+    public function __clone() {
109 106
         parent::__clone();
110 107
         $this->havingStatement = new HavingStatement($this->queryStatement);
111 108
     }
Please login to merge, or discard this patch.
src/Query/EntityQuery.php 1 patch
Braces   +10 added lines, -20 removed lines patch added patch discarded remove patch
@@ -64,8 +64,7 @@  discard block
 block discarded – undo
64 64
  * Class EntityQuery
65 65
  * @package Platine\Orm\Query
66 66
  */
67
-class EntityQuery extends Query
68
-{
67
+class EntityQuery extends Query {
69 68
 
70 69
     /**
71 70
      *
@@ -322,8 +321,7 @@  discard block
 block discarded – undo
322 321
      * @param string|Expression|Closure $column
323 322
      * @return mixed
324 323
      */
325
-    public function column($column)
326
-    {
324
+    public function column($column) {
327 325
         (new ColumnExpression($this->queryStatement))->column($column);
328 326
 
329 327
         return $this->executeAggregate();
@@ -335,8 +333,7 @@  discard block
 block discarded – undo
335 333
      * @param bool $distinct
336 334
      * @return mixed
337 335
      */
338
-    public function count($column = '*', bool $distinct = true)
339
-    {
336
+    public function count($column = '*', bool $distinct = true) {
340 337
         (new ColumnExpression($this->queryStatement))->count($column, null, $distinct);
341 338
 
342 339
         return $this->executeAggregate();
@@ -348,8 +345,7 @@  discard block
 block discarded – undo
348 345
      * @param bool $distinct
349 346
      * @return mixed
350 347
      */
351
-    public function avg($column, bool $distinct = true)
352
-    {
348
+    public function avg($column, bool $distinct = true) {
353 349
         (new ColumnExpression($this->queryStatement))->avg($column, null, $distinct);
354 350
 
355 351
         return $this->executeAggregate();
@@ -361,8 +357,7 @@  discard block
 block discarded – undo
361 357
      * @param bool $distinct
362 358
      * @return mixed
363 359
      */
364
-    public function sum($column, bool $distinct = true)
365
-    {
360
+    public function sum($column, bool $distinct = true) {
366 361
         (new ColumnExpression($this->queryStatement))->sum($column, null, $distinct);
367 362
 
368 363
         return $this->executeAggregate();
@@ -374,8 +369,7 @@  discard block
 block discarded – undo
374 369
      * @param bool $distinct
375 370
      * @return mixed
376 371
      */
377
-    public function min($column, bool $distinct = true)
378
-    {
372
+    public function min($column, bool $distinct = true) {
379 373
         (new ColumnExpression($this->queryStatement))->min($column, null, $distinct);
380 374
 
381 375
         return $this->executeAggregate();
@@ -387,8 +381,7 @@  discard block
 block discarded – undo
387 381
      * @param bool $distinct
388 382
      * @return mixed
389 383
      */
390
-    public function max($column, bool $distinct = true)
391
-    {
384
+    public function max($column, bool $distinct = true) {
392 385
         (new ColumnExpression($this->queryStatement))->max($column, null, $distinct);
393 386
 
394 387
         return $this->executeAggregate();
@@ -397,8 +390,7 @@  discard block
 block discarded – undo
397 390
     /**
398 391
      * Clone of object
399 392
      */
400
-    public function __clone()
401
-    {
393
+    public function __clone() {
402 394
         parent::__clone();
403 395
         $this->havingStatement = new HavingStatement($this->queryStatement);
404 396
     }
@@ -486,8 +478,7 @@  discard block
 block discarded – undo
486 478
      * Execute the aggregate
487 479
      * @return mixed
488 480
      */
489
-    protected function executeAggregate()
490
-    {
481
+    protected function executeAggregate() {
491 482
         $this->queryStatement->addTables([$this->mapper->getTable()]);
492 483
 
493 484
         if ($this->mapper->hasSoftDelete()) {
@@ -522,8 +513,7 @@  discard block
 block discarded – undo
522 513
      *
523 514
      * @return mixed
524 515
      */
525
-    protected function transaction(Closure $callback)
526
-    {
516
+    protected function transaction(Closure $callback) {
527 517
         return $this->manager->getConnection()
528 518
                              ->transaction($callback);
529 519
     }
Please login to merge, or discard this patch.
src/Entity.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -56,8 +56,7 @@  discard block
 block discarded – undo
56 56
  * Class Entity
57 57
  * @package Platine\Orm
58 58
  */
59
-abstract class Entity
60
-{
59
+abstract class Entity {
61 60
 
62 61
     /**
63 62
      * The instance of data mapper
@@ -103,8 +102,7 @@  discard block
 block discarded – undo
103 102
      * @param string $name
104 103
      * @return mixed
105 104
      */
106
-    public function __get(string $name)
107
-    {
105
+    public function __get(string $name) {
108 106
         if ($this->mapper()->hasRelation($name)) {
109 107
             return $this->mapper()->getRelated($name);
110 108
         }
@@ -125,8 +123,7 @@  discard block
 block discarded – undo
125 123
      * @param mixed $value
126 124
      * @return void
127 125
      */
128
-    public function __set(string $name, $value)
129
-    {
126
+    public function __set(string $name, $value) {
130 127
         if ($this->mapper()->hasRelation($name)) {
131 128
             $this->mapper()->setRelated($name, $value);
132 129
         } else {
@@ -139,8 +136,7 @@  discard block
 block discarded – undo
139 136
      * @param string $name
140 137
      * @return bool
141 138
      */
142
-    public function __isset(string $name)
143
-    {
139
+    public function __isset(string $name) {
144 140
         return $this->mapper()->hasRelation($name)
145 141
                 || $this->mapper()->hasColumn($name);
146 142
     }
Please login to merge, or discard this patch.
src/Exception/EntityStateException.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,6 +38,5 @@
 block discarded – undo
38 38
  * Class EntityStateException
39 39
  * @package Platine\Orm\Exception
40 40
  */
41
-class EntityStateException extends RuntimeException
42
-{
41
+class EntityStateException extends RuntimeException {
43 42
 }
Please login to merge, or discard this patch.
src/Exception/RelationNotFoundException.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,6 +38,5 @@
 block discarded – undo
38 38
  * Class RelationNotFoundException
39 39
  * @package Platine\Orm\Exception
40 40
  */
41
-class RelationNotFoundException extends RuntimeException
42
-{
41
+class RelationNotFoundException extends RuntimeException {
43 42
 }
Please login to merge, or discard this patch.
src/Exception/PropertyNotFoundException.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,6 +38,5 @@
 block discarded – undo
38 38
  * Class PropertyNotFoundException
39 39
  * @package Platine\Orm\Exception
40 40
  */
41
-class PropertyNotFoundException extends RuntimeException
42
-{
41
+class PropertyNotFoundException extends RuntimeException {
43 42
 }
Please login to merge, or discard this patch.
src/Mapper/DataMapperInterface.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,8 +52,7 @@
 block discarded – undo
52 52
  * Class DataMapperInterface
53 53
  * @package Platine\Orm\Mapper
54 54
  */
55
-interface DataMapperInterface
56
-{
55
+interface DataMapperInterface {
57 56
 
58 57
     /**
59 58
      * Whether the record is new
Please login to merge, or discard this patch.