Browse Source

use inline code

saeid 8 years ago
parent
commit
5c46f8b267
2 changed files with 2 additions and 4 deletions
  1. 1 2
      src/Database/Query.php
  2. 1 2
      tests/TestCase/Database/QueryTest.php

+ 1 - 2
src/Database/Query.php

@@ -1264,8 +1264,7 @@ class Query implements ExpressionInterface, IteratorAggregate
     public function page($num, $limit = null)
     {
         if ($num < 1) {
-            $msg = 'Pages should start at 1.';
-            throw new InvalidArgumentException($msg);
+            throw new InvalidArgumentException('Pages should start at 1.');
         }
         if ($limit !== null) {
             $this->limit($limit);

+ 1 - 2
tests/TestCase/Database/QueryTest.php

@@ -2217,8 +2217,7 @@ class QueryTest extends TestCase
     {
         $this->loadFixtures('Comments');
         $query = new Query($this->connection);
-        $result = $query->from('comments')
-                        ->page(0);
+        $result = $query->from('comments')->page(0);
     }
 
     /**