Browse Source

Fix CS error.

ADmad 6 years ago
parent
commit
647ada53f9

+ 5 - 5
src/Datasource/Paginator.php

@@ -183,7 +183,7 @@ class Paginator implements PaginatorInterface
         if ($pagingParams['requestedPage'] > $pagingParams['page']) {
             throw new PageOutOfBoundsException([
                 'requestedPage' => $pagingParams['requestedPage'],
-                'pagingParams' => $this->_pagingParams
+                'pagingParams' => $this->_pagingParams,
             ]);
         }
 
@@ -198,7 +198,7 @@ class Paginator implements PaginatorInterface
      * @param array $data Pagination data.
      * @return \Cake\Datasource\QueryInterface
      */
-    protected function getQuery(RepositoryInterface $object, QueryInterface $query = null, array $data)
+    protected function getQuery(RepositoryInterface $object, ?QueryInterface $query = null, array $data): QueryInterface
     {
         if ($query === null) {
             $query = $object->find($data['finder'], $data['options']);
@@ -216,7 +216,7 @@ class Paginator implements PaginatorInterface
      * @param array $data Pagination data.
      * @return int
      */
-    protected function getCount(QueryInterface $query, array $data)
+    protected function getCount(QueryInterface $query, array $data): int
     {
         return $query->count();
     }
@@ -229,7 +229,7 @@ class Paginator implements PaginatorInterface
      * @param array $settings The settings/configuration used for pagination.
      * @return array Array with keys 'defaults', 'options' and 'finder'
      */
-    protected function extractData(RepositoryInterface $object, array $params, array $settings)
+    protected function extractData(RepositoryInterface $object, array $params, array $settings): array
     {
         $alias = $object->getAlias();
         $defaults = $this->getDefaults($alias, $settings);
@@ -251,7 +251,7 @@ class Paginator implements PaginatorInterface
      *   'count', 'defaults', 'finder', 'numResults'.
      * @return array Paging params.
      */
-    protected function buildParams(array $data)
+    protected function buildParams(array $data): array
     {
         $defaults = $data['defaults'];
         $count = $data['count'];

+ 2 - 2
tests/TestCase/Database/Expression/FunctionExpressionTest.php

@@ -109,7 +109,7 @@ class FunctionExpressionTest extends TestCase
             ->newQuery()
             ->select(['column']);
 
-        $binder = new ValueBinder;
+        $binder = new ValueBinder();
         $function = new FunctionExpression('MyFunction', [$query]);
         $this->assertEquals(
             'MyFunction((SELECT column))',
@@ -129,7 +129,7 @@ class FunctionExpressionTest extends TestCase
             ->find()
             ->select(['column']);
 
-        $binder = new ValueBinder;
+        $binder = new ValueBinder();
         $function = new FunctionExpression('MyFunction', [$query]);
         $this->assertEquals(
             'MyFunction((SELECT Articles.column AS Articles__column FROM articles Articles))',

+ 11 - 11
tests/TestCase/ORM/QueryRegressionTest.php

@@ -1780,7 +1780,7 @@ class QueryRegressionTest extends TestCase
                             ->getConnection()
                             ->newQuery()
                             ->select(-1),
-                    ])
+                    ]),
                 ];
             });
 
@@ -1810,8 +1810,8 @@ class QueryRegressionTest extends TestCase
                             ->select(['Authors.name'])
                             ->where(function (QueryExpression $exp) {
                                 return $exp->equalFields('Authors.id', 'Articles.author_id');
-                            })
-                    ])
+                            }),
+                    ]),
                 ];
             });
 
@@ -1839,10 +1839,10 @@ class QueryRegressionTest extends TestCase
                                 ->getConnection()
                                 ->newQuery()
                                 ->select(1.23456),
-                            2
+                            2,
                         ],
                         [null, 'integer']
-                    )
+                    ),
                 ];
             });
 
@@ -1878,8 +1878,8 @@ class QueryRegressionTest extends TestCase
                             ->where(function (QueryExpression $exp) {
                                 return $exp->equalFields('Authors.id', 'Articles.author_id');
                             }),
-                        1
-                    ])
+                        1,
+                    ]),
                 ];
             });
 
@@ -1908,8 +1908,8 @@ class QueryRegressionTest extends TestCase
                             ->find()
                             ->select(['Authors.name'])
                             ->where(['Authors.id' => 1]),
-                        ' appended'
-                    ])
+                        ' appended',
+                    ]),
                 ];
             });
 
@@ -1940,8 +1940,8 @@ class QueryRegressionTest extends TestCase
                             ->where(function (QueryExpression $exp) {
                                 return $exp->equalFields('Authors.id', 'Articles.author_id');
                             }),
-                        ' appended'
-                    ])
+                        ' appended',
+                    ]),
                 ];
             });