Skip to content

Commit 2f96112

Browse files
committed
Code and comment enhancements.
1 parent b81d542 commit 2f96112

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/MySqlFix.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class MySqlFix
2222
*
2323
* @return string
2424
*/
25-
static public function fixColumnComments($theSourceCode)
25+
public static function fixColumnComments($theSourceCode)
2626
{
2727
$source_lines = explode("\n", $theSourceCode);
2828

@@ -33,7 +33,7 @@ static public function fixColumnComments($theSourceCode)
3333
$table_name = null;
3434
foreach ($source_lines as $i => $line)
3535
{
36-
if ($table_name)
36+
if (isset($table_name))
3737
{
3838
if (preg_match('/^ `(\w+)`/', $source_lines[$i], $matches))
3939
{
@@ -45,7 +45,7 @@ static public function fixColumnComments($theSourceCode)
4545
}
4646
}
4747

48-
if (!$table_name && preg_match('/^CREATE TABLE `(\w+)`/', $line, $matches))
48+
if ($table_name===null && preg_match('/^CREATE TABLE `(\w+)`/', $line, $matches))
4949
{
5050
$table_name = $matches[1];
5151
}
@@ -106,7 +106,7 @@ static public function fixColumnComments($theSourceCode)
106106
*
107107
* @return string
108108
*/
109-
static public function fixIndexComments($theSourceCode)
109+
public static function fixIndexComments($theSourceCode)
110110
{
111111
$source_lines = explode("\n", $theSourceCode);
112112

@@ -168,7 +168,7 @@ static public function fixIndexComments($theSourceCode)
168168
*
169169
* @return string
170170
*/
171-
static public function fixTableComments($theSourceCode)
171+
public static function fixTableComments($theSourceCode)
172172
{
173173
$source_lines = explode("\n", $theSourceCode);
174174

@@ -195,7 +195,7 @@ static public function fixTableComments($theSourceCode)
195195
}
196196
}
197197

198-
if (!$table_name && preg_match('/^CREATE TABLE `(\w+)`(\s*\()?/', $line, $matches))
198+
if ($table_name===null && preg_match('/^CREATE TABLE `(\w+)`(\s*\()?/', $line, $matches))
199199
{
200200
$table_name = $matches[1];
201201
if ($matches[2]) $level = 1;

0 commit comments

Comments
 (0)