Completed
Push — master ( 80166f...325728 )
by Thomas
06:11 queued 04:01
created
src/Relation/Owner.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     /** {@inheritdoc} */
39 39
     public function fetch(Entity $self, EntityManager $entityManager)
40 40
     {
41
-        $key = array_map([$self, '__get' ], array_keys($this->reference));
41
+        $key = array_map([$self, '__get'], array_keys($this->reference));
42 42
 
43 43
         if (in_array(null, $key)) {
44 44
             return null;
@@ -82,6 +82,6 @@  discard block
 block discarded – undo
82 82
             $expression[] = $alias . '.' . $myVar . ' = ' . $this->name . '.' . $hisVar;
83 83
         }
84 84
 
85
-        call_user_func([ $fetcher, $join ], $this->class, implode(' AND ', $expression), $this->name, [], true);
85
+        call_user_func([$fetcher, $join], $this->class, implode(' AND ', $expression), $this->name, [], true);
86 86
     }
87 87
 }
Please login to merge, or discard this patch.
src/EntityFetcher.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
 
62 62
         $this->tableName = $entityManager->escapeIdentifier($class::getTableName());
63 63
         $this->alias     = 't0';
64
-        $this->columns   = [ 't0.*' ];
65
-        $this->modifier  = [ 'DISTINCT' ];
64
+        $this->columns   = ['t0.*'];
65
+        $this->modifier  = ['DISTINCT'];
66 66
 
67 67
         $this->classMapping['byClass'][$class] = 't0';
68 68
         $this->classMapping['byAlias']['t0']   = $class;
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
             $alias = $this->alias;
184 184
         }
185 185
 
186
-        call_user_func([ $class, 'getRelation' ], $relation)->addJoin($this, $join, $alias);
186
+        call_user_func([$class, 'getRelation'], $relation)->addJoin($this, $join, $alias);
187 187
         return $this;
188 188
     }
189 189
 
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
             return null;
231 231
         }
232 232
 
233
-        $class         = $this->class;
233
+        $class = $this->class;
234 234
         $newEntity = new $class($data, $this->entityManager, true);
235 235
         $entity    = $this->entityManager->map($newEntity);
236 236
 
@@ -275,11 +275,11 @@  discard block
 block discarded – undo
275 275
     public function count()
276 276
     {
277 277
         // set the columns and reset after get query
278
-        $this->columns  = [ 'COUNT(DISTINCT t0.*)' ];
278
+        $this->columns  = ['COUNT(DISTINCT t0.*)'];
279 279
         $this->modifier = [];
280 280
         $query          = $this->getQuery();
281
-        $this->columns  = [ 't0.*' ];
282
-        $this->modifier = [ 'DISTINCT' ];
281
+        $this->columns  = ['t0.*'];
282
+        $this->modifier = ['DISTINCT'];
283 283
 
284 284
         return (int) $this->entityManager->getConnection()->query($query)->fetchColumn();
285 285
     }
Please login to merge, or discard this patch.
src/EntityManager.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -384,8 +384,7 @@  discard block
 block discarded – undo
384 384
         }
385 385
 
386 386
         return $useAutoIncrement && $entity::isAutoIncremented() ?
387
-            $this->getDbal()->insertAndSyncWithAutoInc($entity) :
388
-            $this->getDbal()->insertAndSync($entity);
387
+            $this->getDbal()->insertAndSyncWithAutoInc($entity) : $this->getDbal()->insertAndSync($entity);
389 388
     }
390 389
 
391 390
     /**
@@ -501,7 +500,7 @@  discard block
 block discarded – undo
501 500
             return new EntityFetcher($this, $class);
502 501
         }
503 502
 
504
-        $primaryKey = $this::buildPrimaryKey($class, (array)$primaryKey);
503
+        $primaryKey = $this::buildPrimaryKey($class, (array) $primaryKey);
505 504
         $checksum = $this::buildChecksum($primaryKey);
506 505
 
507 506
         if (isset($this->map[$class][$checksum])) {
Please login to merge, or discard this patch.
src/Testing/EntityManagerMock.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
             return new EntityFetcherMock($this, $class);
21 21
         }
22 22
 
23
-        $primaryKey = $this->buildPrimaryKey($class, (array)$primaryKey);
23
+        $primaryKey = $this->buildPrimaryKey($class, (array) $primaryKey);
24 24
         $checksum = $this->buildChecksum($primaryKey);
25 25
 
26 26
         if (isset($this->map[$class][$checksum])) {
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,8 +56,9 @@
 block discarded – undo
56 56
      *
57 57
      * As the results are mocked to come from the database they will also get a primary key if they don't have already.
58 58
      *
59
-     * @param $class
59
+     * @param string $class
60 60
      * @param Entity ...$entities
61
+     * @param Entity[] $entities
61 62
      * @return Result|m\MockInterface
62 63
      * @codeCoverageIgnore proxy method
63 64
      */
Please login to merge, or discard this patch.
src/Testing/MocksEntityManager.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -176,7 +176,7 @@
 block discarded – undo
176 176
         $em = $this->ormGetEntityManagerInstance($class);
177 177
 
178 178
         /** @var m\MockInterface|EntityFetcher $fetcher */
179
-        $fetcher = m::mock(EntityFetcher::class, [ $em, $class ])->makePartial();
179
+        $fetcher = m::mock(EntityFetcher::class, [$em, $class])->makePartial();
180 180
         $expectation = $em->shouldReceive('fetch')->with($class)->andReturn($fetcher);
181 181
 
182 182
         $fetcher->shouldReceive('count')->with()->andReturn(count($entities))->byDefault();
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     /**
21 21
      * Get the EntityManagerMock for $class
22 22
      *
23
-     * @param $class
23
+     * @param string $class
24 24
      * @return EntityManagerMock|m\MockInterface|EntityManager
25 25
      * @codeCoverageIgnore proxy method
26 26
      */
@@ -130,6 +130,7 @@  discard block
 block discarded – undo
130 130
      *
131 131
      * @param string $class The class of an Entity
132 132
      * @param Entity ...$entities The entities that will be returned
133
+     * @param Entity[] $entities
133 134
      * @return EntityFetcherMock\Result|m\MockInterface
134 135
      * @codeCoverageIgnore trivial code
135 136
      */
@@ -260,7 +261,7 @@  discard block
 block discarded – undo
260 261
      *
261 262
      * Entity has to be a mock use `emCreateMockedEntity()` to create it.
262 263
      *
263
-     * @param Entity|m\MockInterface $entity
264
+     * @param m\MockInterface $entity
264 265
      * @param array  $changingData Emulate changing data during update statement (triggers etc)
265 266
      * @param array  $updatedData  Emulate data changes in database
266 267
      */
@@ -275,7 +276,7 @@  discard block
 block discarded – undo
275 276
      *
276 277
      * Entity has to be a mock use `emCreateMockedEntity()` to create it.
277 278
      *
278
-     * @param Entity|m\MockInterface $entity
279
+     * @param m\MockInterface $entity
279 280
      * @param array $changingData Emulate changing data during update statement (triggers etc)
280 281
      * @param array $updatedData Emulate data changes in database
281 282
      * @return m\Expectation
Please login to merge, or discard this patch.
src/Dbal/Column.php 1 patch
Spacing   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     protected static function getRegisteredType(array $columnDefinition)
42 42
     {
43 43
         foreach (self::$registeredTypes as $class) {
44
-            if (call_user_func([ $class, 'fits' ], $columnDefinition)) {
44
+            if (call_user_func([$class, 'fits'], $columnDefinition)) {
45 45
                 return $class;
46 46
             }
47 47
         }
@@ -114,8 +114,7 @@  discard block
 block discarded – undo
114 114
     public function __get($name)
115 115
     {
116 116
         $method = [$this, 'get' . ucfirst($name)];
117
-        return is_callable($method) ? call_user_func($method) :
118
-            (isset($this->columnDefinition[$name]) ? $this->columnDefinition[$name] : null);
117
+        return is_callable($method) ? call_user_func($method) : (isset($this->columnDefinition[$name]) ? $this->columnDefinition[$name] : null);
119 118
     }
120 119
 
121 120
     /**
@@ -183,11 +182,11 @@  discard block
 block discarded – undo
183 182
                 $class = $this->columnDefinition['type'];
184 183
             }
185 184
 
186
-            if ($class === null || !is_callable([ $class, 'factory' ])) {
185
+            if ($class === null || !is_callable([$class, 'factory'])) {
187 186
                 $class = Type\Text::class;
188 187
             }
189 188
 
190
-            $this->type = call_user_func([ $class, 'factory' ], $this->dbal, $this->columnDefinition);
189
+            $this->type = call_user_func([$class, 'factory'], $this->dbal, $this->columnDefinition);
191 190
         }
192 191
 
193 192
         return $this->type;
Please login to merge, or discard this patch.
src/Dbal/Escaping.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@
 block discarded – undo
89 89
      * Escape a date time object for query
90 90
      *
91 91
      * @param DateTime $value
92
-     * @return mixed
92
+     * @return string
93 93
      */
94 94
     protected function escapeDateTime(DateTime $value)
95 95
     {
Please login to merge, or discard this patch.
src/Testing/EntityFetcherMock/ResultRepository.php 1 patch
Doc Comments   +2 added lines patch added patch discarded remove patch
@@ -39,6 +39,7 @@  discard block
 block discarded – undo
39 39
      * RANDOM_KEY_MIN and RANDOM_KEY_MAX (at the time writing this it is 1000000000 and 1000999999).
40 40
      *
41 41
      * @param Entity ...$entities
42
+     * @param Entity[] $entities
42 43
      * @return Entity[]
43 44
      */
44 45
     public static function completePrimaryKeys(Entity ...$entities)
@@ -97,6 +98,7 @@  discard block
 block discarded – undo
97 98
      *
98 99
      * @param $class
99 100
      * @param Entity ...$entities
101
+     * @param Entity[] $entities
100 102
      * @return Result|m\MockInterface
101 103
      */
102 104
     public function addResult($class, Entity ...$entities)
Please login to merge, or discard this patch.