From 6d75d90c252166c4fdaecbcdcc726a9c4aa4bfa4 Mon Sep 17 00:00:00 2001 From: Majna Date: Fri, 28 Dec 2012 21:54:00 +0100 Subject: [PATCH] Code cleanup Remove unneeded sprintf. Fix doc blocks. Remove duplicated keys in tests assertions. Use boolean value for CakeRequest $parseEnvironment param. --- lib/Cake/Configure/PhpReader.php | 4 +--- lib/Cake/Controller/Component.php | 2 +- lib/Cake/Model/Datasource/DboSource.php | 2 +- lib/Cake/Test/Case/Cache/Engine/MemcacheEngineTest.php | 1 - .../Test/Case/Controller/Component/Auth/CrudAuthorizeTest.php | 1 - lib/Cake/Test/Case/Controller/ControllerTest.php | 2 +- lib/Cake/Test/Case/Routing/RouterTest.php | 2 +- 7 files changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/Cake/Configure/PhpReader.php b/lib/Cake/Configure/PhpReader.php index 4372baadb8e..83e0e96fe73 100644 --- a/lib/Cake/Configure/PhpReader.php +++ b/lib/Cake/Configure/PhpReader.php @@ -70,9 +70,7 @@ public function read($key) { include $file; if (!isset($config)) { - throw new ConfigureException( - sprintf(__d('cake_dev', 'No variable $config found in %s'), $file) - ); + throw new ConfigureException(__d('cake_dev', 'No variable $config found in %s', $file)); } return $config; } diff --git a/lib/Cake/Controller/Component.php b/lib/Cake/Controller/Component.php index 6d8b817a2d7..e1b36e7cbbe 100644 --- a/lib/Cake/Controller/Component.php +++ b/lib/Cake/Controller/Component.php @@ -135,7 +135,7 @@ public function beforeRender(Controller $controller) { * * @param Controller $controller Controller with components to shutdown * @return void - * @link @link http://book.cakephp.org/2.0/en/controllers/components.html#Component::shutdown + * @link http://book.cakephp.org/2.0/en/controllers/components.html#Component::shutdown */ public function shutdown(Controller $controller) { } diff --git a/lib/Cake/Model/Datasource/DboSource.php b/lib/Cake/Model/Datasource/DboSource.php index ef0891827c2..192f2156caa 100644 --- a/lib/Cake/Model/Datasource/DboSource.php +++ b/lib/Cake/Model/Datasource/DboSource.php @@ -2959,7 +2959,7 @@ public function index($model) { /** * Generate a database-native schema for the given Schema object * - * @param Model $schema An instance of a subclass of CakeSchema + * @param CakeSchema $schema An instance of a subclass of CakeSchema * @param string $tableName Optional. If specified only the table name given will be generated. * Otherwise, all tables defined in the schema are generated. * @return string diff --git a/lib/Cake/Test/Case/Cache/Engine/MemcacheEngineTest.php b/lib/Cake/Test/Case/Cache/Engine/MemcacheEngineTest.php index 27453d84e8c..bd355bf3800 100644 --- a/lib/Cake/Test/Case/Cache/Engine/MemcacheEngineTest.php +++ b/lib/Cake/Test/Case/Cache/Engine/MemcacheEngineTest.php @@ -93,7 +93,6 @@ public function testSettings() { 'persistent' => true, 'compress' => false, 'engine' => 'Memcache', - 'persistent' => true, 'groups' => array() ); $this->assertEquals($expecting, $settings); diff --git a/lib/Cake/Test/Case/Controller/Component/Auth/CrudAuthorizeTest.php b/lib/Cake/Test/Case/Controller/Component/Auth/CrudAuthorizeTest.php index 859e4243bc6..ec631e4037e 100644 --- a/lib/Cake/Test/Case/Controller/Component/Auth/CrudAuthorizeTest.php +++ b/lib/Cake/Test/Case/Controller/Component/Auth/CrudAuthorizeTest.php @@ -155,7 +155,6 @@ public function testMapActionsSet() { 'create' => 'create', 'read' => 'read', 'index' => 'read', - 'add' => 'create', 'edit' => 'update', 'view' => 'read', 'delete' => 'delete', diff --git a/lib/Cake/Test/Case/Controller/ControllerTest.php b/lib/Cake/Test/Case/Controller/ControllerTest.php index 42446769dc6..70b0c6b7828 100644 --- a/lib/Cake/Test/Case/Controller/ControllerTest.php +++ b/lib/Cake/Test/Case/Controller/ControllerTest.php @@ -1254,7 +1254,7 @@ public function testShutdownProcessIndirect() { * @return void */ public function testPropertyBackwardsCompatibility() { - $request = new CakeRequest('posts/index', null); + $request = new CakeRequest('posts/index', false); $request->addParams(array('controller' => 'posts', 'action' => 'index')); $request->data = array('Post' => array('id' => 1)); $request->here = '/posts/index'; diff --git a/lib/Cake/Test/Case/Routing/RouterTest.php b/lib/Cake/Test/Case/Routing/RouterTest.php index 177f4008d76..f0d0f6ad0e5 100644 --- a/lib/Cake/Test/Case/Routing/RouterTest.php +++ b/lib/Cake/Test/Case/Routing/RouterTest.php @@ -1315,7 +1315,7 @@ public function testExtensionParsing() { $this->assertEquals($expected, $result); $result = Router::parse('/posts/view/1.rss'); - $expected = array('plugin' => null, 'controller' => 'posts', 'action' => 'view', 'pass' => array('1'), 'named' => array(), 'ext' => 'rss', 'named' => array()); + $expected = array('plugin' => null, 'controller' => 'posts', 'action' => 'view', 'pass' => array('1'), 'named' => array(), 'ext' => 'rss'); $this->assertEquals($expected, $result); $result = Router::parse('/posts/view/1.rss?query=test');