Browse Source

Remove unused variables.

ADmad 11 years ago
parent
commit
37d6ad7072

+ 0 - 1
src/Controller/Component/RequestHandlerComponent.php

@@ -149,7 +149,6 @@ class RequestHandlerComponent extends Component {
 	public function initialize(array $config) {
 		$controller = $this->_registry->getController();
 		$request = $this->request = $controller->request;
-		$response = $this->response = $controller->response;
 
 		if (isset($request->params['_ext'])) {
 			$this->ext = $request->params['_ext'];

+ 0 - 4
src/Controller/Component/SecurityComponent.php

@@ -369,10 +369,6 @@ class SecurityComponent extends Component {
 			'unlockedFields' => $this->_config['unlockedFields'],
 		);
 
-		$tokenData = array();
-		if ($this->session->check('_Token')) {
-			$tokenData = $this->session->read('_Token');
-		}
 		$this->session->write('_Token', $token);
 		$request->params['_Token'] = array(
 			'unlockedFields' => $token['unlockedFields']

+ 0 - 1
src/Core/Plugin.php

@@ -268,7 +268,6 @@ class Plugin {
 		if ($config['bootstrap'] === false) {
 			return false;
 		}
-		$path = static::path($plugin);
 		if ($config['bootstrap'] === true) {
 			return static::_includeFile(
 				$config['configPath'] . 'bootstrap.php',

+ 0 - 2
src/Database/Connection.php

@@ -336,8 +336,6 @@ class Connection {
  * @return \Cake\Database\StatementInterface
  */
 	public function update($table, array $data, array $conditions = [], $types = []) {
-		$columns = array_keys($data);
-
 		return $this->newQuery()->update($table)
 			->set($data, $types)
 			->where($conditions, $types)

+ 0 - 1
src/Database/Query.php

@@ -180,7 +180,6 @@ class Query implements ExpressionInterface, IteratorAggregate {
  * @return string
  */
 	public function sql(ValueBinder $generator = null) {
-		$sql = '';
 		if (!$generator) {
 			$generator = $this->valueBinder();
 			$generator->resetCount();

+ 0 - 1
src/Network/Http/Auth/Oauth.php

@@ -201,7 +201,6 @@ class Oauth {
 
 		$post = [];
 		$body = $request->body();
-		$contentType = $request->header('content-type');
 
 		if (is_array($body)) {
 			$post = $body;

+ 1 - 1
src/Network/Http/Response.php

@@ -375,7 +375,7 @@ class Response extends Message {
 		if (!empty($this->_xml)) {
 			return $this->_xml;
 		}
-		$restore = libxml_use_internal_errors();
+		libxml_use_internal_errors();
 		$data = simplexml_load_string($this->_body);
 		if ($data) {
 			$this->_xml = $data;

+ 1 - 1
src/Network/Request.php

@@ -355,7 +355,7 @@ class Request implements \ArrayAccess {
  * @link https://cakephp.lighthouseapp.com/projects/42648-cakephp/tickets/3318
  */
 	protected static function _base() {
-		$base = $dir = $webroot = $baseUrl = null;
+		$base = $webroot = $baseUrl = null;
 		$config = Configure::read('App');
 		extract($config);
 

+ 0 - 1
src/ORM/Marshaller.php

@@ -347,7 +347,6 @@ class Marshaller {
  */
 	public function mergeMany($entities, array $data, array $options = []) {
 		$primary = (array)$this->_table->primaryKey();
-		$isSimple = !is_array($primary);
 
 		$data = new Collection($data);
 		$data = $data->groupBy(function ($el) use ($primary) {

+ 0 - 1
src/ORM/Table.php

@@ -1242,7 +1242,6 @@ class Table implements RepositoryInterface, EventListener {
 		}
 
 		$data = $entity->extract($this->schema()->columns(), true);
-		$keys = array_keys($data);
 		$isNew = $entity->isNew();
 
 		if ($isNew) {

+ 0 - 2
src/Shell/Task/FixtureTask.php

@@ -398,8 +398,6 @@ class FixtureTask extends BakeTask {
 			'limit' => $recordCount
 		]);
 
-		$schema = $model->schema();
-		$alias = $model->alias();
 		$out = [];
 		foreach ($records as $record) {
 			$out[] = $record->toArray();

+ 0 - 2
src/Shell/Task/ModelTask.php

@@ -220,7 +220,6 @@ class ModelTask extends BakeTask {
  */
 	public function findBelongsTo($model, array $associations) {
 		$schema = $model->schema();
-		$primary = (array)$schema->primaryKey();
 		foreach ($schema->columns() as $fieldName) {
 			if (!preg_match('/^.*_id$/', $fieldName)) {
 				continue;
@@ -433,7 +432,6 @@ class ModelTask extends BakeTask {
 			return false;
 		}
 
-		$skipFields = false;
 		$validate = [];
 		$primaryKey = (array)$schema->primaryKey();
 

+ 0 - 9
src/Shell/Task/TestTask.php

@@ -127,11 +127,6 @@ class TestTask extends BakeTask {
  */
 	public function outputClassChoices($type) {
 		$type = $this->mapType($type);
-		$plugin = null;
-		if (!empty($this->plugin)) {
-			$plugin = $this->plugin;
-		}
-
 		$this->out(
 			'You must provide a class to bake a test for. Some possible options are:',
 			2
@@ -281,10 +276,6 @@ class TestTask extends BakeTask {
  * @return string Path of the subspace.
  */
 	public function getSubspacePath($type) {
-		$namespace = Configure::read('App.namespace');
-		if ($this->plugin) {
-			$namespace = $this->plugin;
-		}
 		$suffix = $this->classSuffixes[strtolower($type)];
 		$subspace = $this->mapType($type);
 		return str_replace('\\', DS, $subspace);