Browse Source

Merge pull request #10536 from Theaxiom/one-time-use

Removing some one-time use variables
Mark Story 9 years ago
parent
commit
66c10605a9
5 changed files with 5 additions and 11 deletions
  1. 1 3
      src/Auth/BaseAuthenticate.php
  2. 1 2
      src/Console/Shell.php
  3. 1 2
      src/Http/Response.php
  4. 1 2
      src/ORM/Query.php
  5. 1 2
      src/ORM/Table.php

+ 1 - 3
src/Auth/BaseAuthenticate.php

@@ -156,9 +156,7 @@ abstract class BaseAuthenticate implements EventListenerInterface
             $options['username'] = $username;
         }
 
-        $query = $table->find($finder, $options);
-
-        return $query;
+        return $table->find($finder, $options);
     }
 
     /**

+ 1 - 2
src/Console/Shell.php

@@ -528,9 +528,8 @@ class Shell
     public function getOptionParser()
     {
         $name = ($this->plugin ? $this->plugin . '.' : '') . $this->name;
-        $parser = new ConsoleOptionParser($name);
 
-        return $parser;
+        return new ConsoleOptionParser($name);
     }
 
     /**

+ 1 - 2
src/Http/Response.php

@@ -1267,9 +1267,8 @@ class Response implements ResponseInterface
             if (!$public && !$private && !$noCache) {
                 return null;
             }
-            $sharable = $public || !($private || $noCache);
 
-            return $sharable;
+            return $public || !($private || $noCache);
         }
         if ($public) {
             $this->_cacheDirectives['public'] = true;

+ 1 - 2
src/ORM/Query.php

@@ -987,9 +987,8 @@ class Query extends DatabaseQuery implements JsonSerializable, QueryInterface
         $this->triggerBeforeFind();
 
         $this->_transformQuery();
-        $sql = parent::sql($binder);
 
-        return $sql;
+        return parent::sql($binder);
     }
 
     /**

+ 1 - 2
src/ORM/Table.php

@@ -2401,9 +2401,8 @@ class Table implements RepositoryInterface, EventListenerInterface, EventDispatc
     {
         if ($data === null) {
             $class = $this->getEntityClass();
-            $entity = new $class([], ['source' => $this->getRegistryAlias()]);
 
-            return $entity;
+            return new $class([], ['source' => $this->getRegistryAlias()]);
         }
         if (!isset($options['associated'])) {
             $options['associated'] = $this->_associations->keys();