From a0070f411da79a5368a012970d028486a0cc1372 Mon Sep 17 00:00:00 2001 From: Hugues Peccatte Date: Sun, 26 Jul 2015 12:31:57 +0200 Subject: [PATCH] Add/update PHPDoc. Make PHPCS happy. Signed-off-by: Hugues Peccatte --- libraries/sql.lib.php | 5 ++++- test/libraries/PMA_Linter_Test.php | 9 +++++--- test/libraries/PMA_sql_test.php | 35 ++++++++++++++++++++++++++++-- 3 files changed, 43 insertions(+), 6 deletions(-) diff --git a/libraries/sql.lib.php b/libraries/sql.lib.php index a77a311c70..528681f9dd 100644 --- a/libraries/sql.lib.php +++ b/libraries/sql.lib.php @@ -12,7 +12,10 @@ if (!defined('PHPMYADMIN')) { /** * Parses and analyzes the given SQL query. * - * @param string $sql_query + * @param string $sql_query SQL query + * @param string $db DB name + * + * @return mixed */ function PMA_parseAndAnalyze($sql_query, $db = null) { diff --git a/test/libraries/PMA_Linter_Test.php b/test/libraries/PMA_Linter_Test.php index d7f4323dd2..a3b5fe4971 100644 --- a/test/libraries/PMA_Linter_Test.php +++ b/test/libraries/PMA_Linter_Test.php @@ -101,7 +101,8 @@ class PMA_Linter_Test extends PHPUnit_Framework_TestCase array( array( array( - 'message' => 'Unrecognized data type. (near IN)', + 'message' => 'Unrecognized data type. (near ' . + 'IN)', 'fromLine' => 0, 'fromColumn' => 22, 'toLine' => 0, @@ -109,7 +110,8 @@ class PMA_Linter_Test extends PHPUnit_Framework_TestCase 'severity' => 'error', ), array( - 'message' => 'A closing bracket was expected. (near IN)', + 'message' => 'A closing bracket was expected. (near ' . + 'IN)', 'fromLine' => 0, 'fromColumn' => 22, 'toLine' => 0, @@ -122,7 +124,8 @@ class PMA_Linter_Test extends PHPUnit_Framework_TestCase array( array( array( - 'message' => 'Linting is disabled for this query because it exceeds the maximum length.', + 'message' => 'Linting is disabled for this query because ' . + 'it exceeds the maximum length.', 'fromLine' => 0, 'fromColumn' => 0, 'toLine' => 0, diff --git a/test/libraries/PMA_sql_test.php b/test/libraries/PMA_sql_test.php index 0ad00e8d94..800d1e854b 100644 --- a/test/libraries/PMA_sql_test.php +++ b/test/libraries/PMA_sql_test.php @@ -18,7 +18,11 @@ require_once 'libraries/sql.lib.php'; */ class PMA_SqlTest extends PHPUnit_Framework_TestCase { - + /** + * Test PMA_getSqlWithLimitClause + * + * @return void + */ public function testGetSqlWithLimitClause() { // Test environment. @@ -26,13 +30,20 @@ class PMA_SqlTest extends PHPUnit_Framework_TestCase $GLOBALS['_SESSION']['tmpval']['max_rows'] = 2; $GLOBALS['db'] = 'db'; - $analyzed_sql_results = PMA_parseAndAnalyze('SELECT * FROM test LIMIT 0, 10'); + $analyzed_sql_results = PMA_parseAndAnalyze( + 'SELECT * FROM test LIMIT 0, 10' + ); $this->assertEquals( 'SELECT * FROM test LIMIT 1, 2 ', PMA_getSqlWithLimitClause($analyzed_sql_results) ); } + /** + * Test PMA_isRememberSortingOrder + * + * @return void + */ public function testIsRememberSortingOrder() { // Test environment. @@ -70,6 +81,11 @@ class PMA_SqlTest extends PHPUnit_Framework_TestCase ); } + /** + * Test PMA_isAppendLimitClause + * + * @return void + */ public function testIsAppendLimitClause() { // Test environment. @@ -89,6 +105,11 @@ class PMA_SqlTest extends PHPUnit_Framework_TestCase ); } + /** + * Test PMA_isJustBrowsing + * + * @return void + */ public function testIsJustBrowsing() { // Test environment. @@ -117,6 +138,11 @@ class PMA_SqlTest extends PHPUnit_Framework_TestCase ); } + /** + * Test PMA_isDeleteTransformationInfo + * + * @return void + */ public function testIsDeleteTransformationInfo() { $this->assertTrue( @@ -138,6 +164,11 @@ class PMA_SqlTest extends PHPUnit_Framework_TestCase ); } + /** + * Test PMA_hasNoRightsToDropDatabase + * + * @return void + */ public function testHasNoRightsToDropDatabase() { $this->assertEquals(