Skip to content

Commit 4de8e01

Browse files
Slamdunkifsnop
authored andcommitted
Minor coding standards fixes
1 parent 1a4c418 commit 4de8e01

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

src/Ifsnop/Mysqldump/Mysqldump.php

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,8 @@ private function getDatabaseStructureEvents()
554554
* @param $arr array with strings or patterns
555555
* @return bool
556556
*/
557-
private function matches($table, $arr) {
557+
private function matches($table, $arr)
558+
{
558559
$match = false;
559560

560561
foreach ($arr as $pattern) {
@@ -584,7 +585,7 @@ private function exportTables()
584585
$this->getTableStructure($table);
585586
if (false === $this->dumpSettings['no-data']) { // don't break compatibility with old trigger
586587
$this->listValues($table);
587-
} else if (true === $this->dumpSettings['no-data']
588+
} elseif (true === $this->dumpSettings['no-data']
588589
|| $this->matches($table, $this->dumpSettings['no-data'])) {
589590
continue;
590591
} else {
@@ -698,7 +699,8 @@ private function getTableStructure($tableName)
698699
* @return array type column types detailed
699700
*/
700701

701-
private function getTableColumnTypes($tableName) {
702+
private function getTableColumnTypes($tableName)
703+
{
702704
$columnTypes = array();
703705
$columns = $this->dbHandler->query(
704706
$this->typeAdapter->show_columns($tableName)
@@ -758,7 +760,8 @@ private function getViewStructureTable($viewName)
758760
* @param string $viewName Name of view to export
759761
* @return string create statement
760762
*/
761-
function createStandInTable($viewName) {
763+
public function createStandInTable($viewName)
764+
{
762765
$ret = array();
763766
foreach ($this->tableColumnTypes[$viewName] as $k => $v) {
764767
$ret[] = "`${k}` ${v['type_sql']}";
@@ -985,7 +988,6 @@ private function listValues($tableName)
985988
foreach ($resultSet as $row) {
986989
$vals = $this->prepareColumnValues($tableName, $row);
987990
if ($onlyOnce || !$this->dumpSettings['extended-insert']) {
988-
989991
if ($this->dumpSettings['complete-insert']) {
990992
$lineSize += $this->compressManager->write(
991993
"INSERT$ignore INTO `$tableName` (".
@@ -1023,7 +1025,7 @@ private function listValues($tableName)
10231025
*
10241026
* @return null
10251027
*/
1026-
function prepareListValues($tableName)
1028+
public function prepareListValues($tableName)
10271029
{
10281030
if (!$this->dumpSettings['skip-comments']) {
10291031
$this->compressManager->write(
@@ -1071,7 +1073,7 @@ function prepareListValues($tableName)
10711073
*
10721074
* @return null
10731075
*/
1074-
function endListValues($tableName)
1076+
public function endListValues($tableName)
10751077
{
10761078
if ($this->dumpSettings['disable-keys']) {
10771079
$this->compressManager->write(
@@ -1112,15 +1114,15 @@ function endListValues($tableName)
11121114
*
11131115
* @return array SQL sentence with columns for select
11141116
*/
1115-
function getColumnStmt($tableName)
1117+
public function getColumnStmt($tableName)
11161118
{
11171119
$colStmt = array();
11181120
foreach ($this->tableColumnTypes[$tableName] as $colName => $colType) {
11191121
if ($colType['type'] == 'bit' && $this->dumpSettings['hex-blob']) {
11201122
$colStmt[] = "LPAD(HEX(`${colName}`),2,'0') AS `${colName}`";
1121-
} else if ($colType['is_blob'] && $this->dumpSettings['hex-blob']) {
1123+
} elseif ($colType['is_blob'] && $this->dumpSettings['hex-blob']) {
11221124
$colStmt[] = "HEX(`${colName}`) AS `${colName}`";
1123-
} else if ($colType['is_virtual']) {
1125+
} elseif ($colType['is_virtual']) {
11241126
$this->dumpSettings['complete-insert'] = true;
11251127
continue;
11261128
} else {
@@ -1138,10 +1140,10 @@ function getColumnStmt($tableName)
11381140
*
11391141
* @return array columns for sql sentence for insert
11401142
*/
1141-
function getColumnNames($tableName)
1143+
public function getColumnNames($tableName)
11421144
{
11431145
$colNames = array();
1144-
foreach($this->tableColumnTypes[$tableName] as $colName => $colType) {
1146+
foreach ($this->tableColumnTypes[$tableName] as $colName => $colType) {
11451147
if ($colType['is_virtual']) {
11461148
$this->dumpSettings['complete-insert'] = true;
11471149
continue;
@@ -1678,7 +1680,7 @@ public function create_view($row)
16781680
{
16791681
$ret = "";
16801682
if (!isset($row['Create View'])) {
1681-
throw new Exception("Error getting view structure, unknown output");
1683+
throw new Exception("Error getting view structure, unknown output");
16821684
}
16831685

16841686
$viewStmt = $row['Create View'];
@@ -1868,7 +1870,6 @@ public function lock_table()
18681870
$this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__);
18691871
$args = func_get_args();
18701872
return $this->dbHandler->exec("LOCK TABLES `${args[0]}` READ LOCAL");
1871-
18721873
}
18731874

18741875
public function unlock_table()
@@ -1968,7 +1969,7 @@ public function parseColumnType($colType)
19681969
if ($fparen = strpos($colParts[0], "(")) {
19691970
$colInfo['type'] = substr($colParts[0], 0, $fparen);
19701971
$colInfo['length'] = str_replace(")", "", substr($colParts[0], $fparen + 1));
1971-
$colInfo['attributes'] = isset($colParts[1]) ? $colParts[1] : NULL;
1972+
$colInfo['attributes'] = isset($colParts[1]) ? $colParts[1] : null;
19721973
} else {
19731974
$colInfo['type'] = $colParts[0];
19741975
}

0 commit comments

Comments
 (0)