Browse Source

Set default arg to `true` for all `enable...()`setters

antograssiot 9 years ago
parent
commit
cadcc19811
5 changed files with 8 additions and 8 deletions
  1. 2 2
      src/Database/Driver.php
  2. 1 1
      src/Database/Query.php
  3. 1 1
      src/ORM/EagerLoader.php
  4. 3 3
      src/ORM/Query.php
  5. 1 1
      src/View/ViewBuilder.php

+ 2 - 2
src/Database/Driver.php

@@ -63,7 +63,7 @@ abstract class Driver
         $config += $this->_baseConfig;
         $this->_config = $config;
         if (!empty($config['quoteIdentifiers'])) {
-            $this->enableAutoQuoting(true);
+            $this->enableAutoQuoting();
         }
     }
 
@@ -303,7 +303,7 @@ abstract class Driver
      * @param bool $enable Whether to enable auto quoting
      * @return self
      */
-    public function enableAutoQuoting($enable)
+    public function enableAutoQuoting($enable = true)
     {
         $this->_autoQuoting = (bool)$enable;
 

+ 1 - 1
src/Database/Query.php

@@ -1809,7 +1809,7 @@ class Query implements ExpressionInterface, IteratorAggregate
      * @param bool $enable Whether or not to enable buffering
      * @return self
      */
-    public function enableBufferedResults($enable)
+    public function enableBufferedResults($enable = true)
     {
         $this->_dirty();
         $this->_useBufferedResults = (bool)$enable;

+ 1 - 1
src/ORM/EagerLoader.php

@@ -165,7 +165,7 @@ class EagerLoader
      * @param bool $enable The value to set.
      * @return self
      */
-    public function enableAutoFields($enable)
+    public function enableAutoFields($enable = true)
     {
         $this->_autoFields = (bool)$enable;
 

+ 3 - 3
src/ORM/Query.php

@@ -597,8 +597,8 @@ class Query extends DatabaseQuery implements JsonSerializable, QueryInterface
         $result = $this->getEagerLoader()
             ->setMatching($assoc, $builder, [
                 'joinType' => 'INNER',
-            ])
                 'fields' => false
+            ])
             ->getMatching();
         $this->_addAssociationsToTypeMap($this->repository(), $this->getTypeMap(), $result);
         $this->_dirty();
@@ -891,7 +891,7 @@ class Query extends DatabaseQuery implements JsonSerializable, QueryInterface
      * @param bool $enable Use a boolean to set the hydration mode.
      * @return self
      */
-    public function enableHydration($enable)
+    public function enableHydration($enable = true)
     {
         $this->_dirty();
         $this->_hydrate = (bool)$enable;
@@ -1219,7 +1219,7 @@ class Query extends DatabaseQuery implements JsonSerializable, QueryInterface
      * @param bool $value Set true to enable, false to disable.
      * @return self
      */
-    public function enableAutoFields($value)
+    public function enableAutoFields($value = true)
     {
         $this->_autoFields = (bool)$value;
 

+ 1 - 1
src/View/ViewBuilder.php

@@ -199,7 +199,7 @@ class ViewBuilder implements JsonSerializable, Serializable
      * @param bool $enable Boolean to turn on/off.
      * @return $this
      */
-    public function enableAutoLayout($enable)
+    public function enableAutoLayout($enable = true)
     {
         $this->_autoLayout = (bool)$enable;