From 34dce1d3b4ec0dec16fc8c0878f93f36311bc606 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 11 Jun 2013 16:27:31 +0200 Subject: [PATCH] Various coding style improvements --- libraries/plugins/export/ExportCsv.class.php | 6 ++++-- libraries/plugins/import/ImportSql.class.php | 6 ++++-- libraries/tbl_views.lib.php | 4 +++- tbl_addfield.php | 4 +++- test/classes/PMA_Index_test.php | 18 +++++++++--------- test/classes/PMA_Types_MySQL_test.php | 2 +- test/libraries/core/PMA_securePath_test.php | 10 ++++++++++ themes.php | 1 + transformation_overview.php | 1 + view_operations.php | 1 + 10 files changed, 37 insertions(+), 16 deletions(-) diff --git a/libraries/plugins/export/ExportCsv.class.php b/libraries/plugins/export/ExportCsv.class.php index f5c6fd7ed7..f94c51e1ae 100644 --- a/libraries/plugins/export/ExportCsv.class.php +++ b/libraries/plugins/export/ExportCsv.class.php @@ -257,7 +257,9 @@ class ExportCsv extends ExportPlugin $schema_insert = ''; for ($i = 0; $i < $fields_cnt; $i++) { if ($csv_enclosed == '') { - $schema_insert .= stripslashes($GLOBALS['dbi']->fieldName($result, $i)); + $schema_insert .= stripslashes( + $GLOBALS['dbi']->fieldName($result, $i) + ); } else { $schema_insert .= $csv_enclosed . str_replace( @@ -344,4 +346,4 @@ class ExportCsv extends ExportPlugin return true; } } -?> \ No newline at end of file +?> diff --git a/libraries/plugins/import/ImportSql.class.php b/libraries/plugins/import/ImportSql.class.php index d3520fa52a..d410e61edf 100644 --- a/libraries/plugins/import/ImportSql.class.php +++ b/libraries/plugins/import/ImportSql.class.php @@ -152,7 +152,9 @@ class ImportSql extends ImportPlugin $sql_modes[] = 'NO_AUTO_VALUE_ON_ZERO'; } if (count($sql_modes) > 0) { - $GLOBALS['dbi']->tryQuery('SET SQL_MODE="' . implode(',', $sql_modes) . '"'); + $GLOBALS['dbi']->tryQuery( + 'SET SQL_MODE="' . implode(',', $sql_modes) . '"' + ); } unset($sql_modes); @@ -437,4 +439,4 @@ class ImportSql extends ImportPlugin PMA_importRunQuery('', substr($buffer, 0, $len), false, $sql_data); PMA_importRunQuery('', '', false, $sql_data); } -} \ No newline at end of file +} diff --git a/libraries/tbl_views.lib.php b/libraries/tbl_views.lib.php index 98bcdc19a8..955e2d5064 100644 --- a/libraries/tbl_views.lib.php +++ b/libraries/tbl_views.lib.php @@ -27,7 +27,9 @@ function PMA_getColumnMap($sql_query, $view_columns) if ($real_source_result !== false) { - $real_source_fields_meta = $GLOBALS['dbi']->getFieldsMeta($real_source_result); + $real_source_fields_meta = $GLOBALS['dbi']->getFieldsMeta( + $real_source_result + ); if (count($real_source_fields_meta) > 0) { diff --git a/tbl_addfield.php b/tbl_addfield.php index 499cb21ef0..4b2c3fe216 100644 --- a/tbl_addfield.php +++ b/tbl_addfield.php @@ -59,7 +59,9 @@ if (isset($_REQUEST['do_save_data'])) { // on this db. $GLOBALS['dbi']->selectDb($db) or PMA_Util::mysqlDie( - $GLOBALS['dbi']->getError(), 'USE ' . PMA_Util::backquote($db), '', $err_url + $GLOBALS['dbi']->getError(), + 'USE ' . PMA_Util::backquote($db), '', + $err_url ); $sql_query = 'ALTER TABLE ' . PMA_Util::backquote($table) . ' ' . $sql_statement . ';'; diff --git a/test/classes/PMA_Index_test.php b/test/classes/PMA_Index_test.php index e81f331335..2e6af2acac 100644 --- a/test/classes/PMA_Index_test.php +++ b/test/classes/PMA_Index_test.php @@ -35,7 +35,7 @@ class PMA_Index_Test extends PHPUnit_Framework_TestCase $this->_params['Index_comment'] = "PMA_Index_comment"; $this->_params['Non_unique'] = "PMA_Non_unique"; $this->_params['Packed'] = "PMA_Packed"; - + //test add columns $column1 = array("Column_name"=>"column1","Seq_in_index"=>"index1", "Collation"=>"Collation1","Cardinality"=>"Cardinality1", @@ -94,7 +94,7 @@ class PMA_Index_Test extends PHPUnit_Framework_TestCase 'INDEX', $index->getChoice() ); - + } /** @@ -141,16 +141,16 @@ class PMA_Index_Test extends PHPUnit_Framework_TestCase public function testAddColumns() { $index = new PMA_Index(); - $index->addColumns($this->_params['columns']); - $this->assertTrue($index->hasColumn("column1")); - $this->assertTrue($index->hasColumn("column2")); + $index->addColumns($this->_params['columns']); + $this->assertTrue($index->hasColumn("column1")); + $this->assertTrue($index->hasColumn("column2")); $this->assertTrue($index->hasColumn("column3")); $this->assertEquals( 3, $index->getColumnCount() ); } - + /** * Test for get Name & set Name * @@ -165,17 +165,17 @@ class PMA_Index_Test extends PHPUnit_Framework_TestCase $index->getName() ); } - + /** * Test for PMA_Index_Column * * @return void */ - public function testPMA_Index_Column() + public function testColumns() { $index = new PMA_Index(); $index->addColumns($this->_params['columns']); - + $index_columns = $index->getColumns(); $index_column = $index_columns['column1']; $this->assertEquals( diff --git a/test/classes/PMA_Types_MySQL_test.php b/test/classes/PMA_Types_MySQL_test.php index 5fae358748..63bb3d1e06 100644 --- a/test/classes/PMA_Types_MySQL_test.php +++ b/test/classes/PMA_Types_MySQL_test.php @@ -38,7 +38,7 @@ class PMA_Types_MySQL_Test extends PHPUnit_Framework_TestCase /** * Test for getTypeDescription * - * @param string $type The data type to get a description. + * @param string $type The data type to get a description. * * @return void * diff --git a/test/libraries/core/PMA_securePath_test.php b/test/libraries/core/PMA_securePath_test.php index f66c8a034b..bb91085716 100644 --- a/test/libraries/core/PMA_securePath_test.php +++ b/test/libraries/core/PMA_securePath_test.php @@ -9,8 +9,18 @@ require_once 'libraries/core.lib.php'; +/** + * Test for securing path. + * + * @package PhpMyAdmin-test + */ class PMA_SecurePath extends PHPUnit_Framework_TestCase { + /** + * Test for replacing dots. + * + * @return void + */ public function testReplaceDots() { $this->assertEquals( diff --git a/themes.php b/themes.php index 4328383a73..aed65f97dd 100644 --- a/themes.php +++ b/themes.php @@ -1,6 +1,7 @@