summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavey Shafik <me@daveyshafik.com>2017-01-10 19:42:37 -0800
committerDavey Shafik <me@daveyshafik.com>2017-01-10 19:42:37 -0800
commit79a84640939bc9b09aad90e9565563a00baa5616 (patch)
treea1f7fe3c8efb668a4b4647143b280144412cae13
parent5723d3b4b29c1e8f66ae20a5393024464c6db14c (diff)
downloadphp7-mysql-shim-79a84640939bc9b09aad90e9565563a00baa5616.zip
php7-mysql-shim-79a84640939bc9b09aad90e9565563a00baa5616.tar.gz
php7-mysql-shim-79a84640939bc9b09aad90e9565563a00baa5616.tar.bz2
Fix CS
-rw-r--r--lib/mysql.php10
-rw-r--r--tests/MySqlShimTest.php19
2 files changed, 16 insertions, 13 deletions
diff --git a/lib/mysql.php b/lib/mysql.php
index cd45f46..d2d9772 100644
--- a/lib/mysql.php
+++ b/lib/mysql.php
@@ -153,9 +153,9 @@ namespace {
$link = \Dshafik\MySQL::getConnection($link);
return mysqli_query(
- $link,
- 'USE `' . mysqli_real_escape_string($link, $databaseName) . '`'
- ) !== false;
+ $link,
+ 'USE `' . mysqli_real_escape_string($link, $databaseName) . '`'
+ ) !== false;
}
function mysql_query($query, \mysqli $link = null)
@@ -268,10 +268,10 @@ namespace {
$found = true;
if (strpos($field, '.') !== false) {
- list($table, $name) = explode('.', $field);
+ list($table, $name) = explode('.', $field);
$i = 0;
$found = false;
- mysqli_field_seek($result, 0);
+ mysqli_field_seek($result, 0);
while ($column = mysqli_fetch_field($result)) {
if ($column->table === $table && $column->name === $name) {
$field = $i;
diff --git a/tests/MySqlShimTest.php b/tests/MySqlShimTest.php
index 9952e81..58d33b2 100644
--- a/tests/MySqlShimTest.php
+++ b/tests/MySqlShimTest.php
@@ -14,24 +14,24 @@ class MySqlShimTest extends \PHPUnit_Framework_TestCase
/**
* @var string MySQL Host
*/
- static protected $host;
+ protected static $host;
- static protected $password = null;
+ protected static $password = null;
/**
* @var string Docker container
*/
- static protected $container;
+ protected static $container;
/**
* @var array Location of binaries
*/
- static protected $bin = array();
+ protected static $bin = array();
/**
* @var array List of databases created
*/
- static protected $dbs = array();
+ protected static $dbs = array();
/**
* @var \SebastianBergmann\Environment\Runtime
@@ -308,7 +308,8 @@ class MySqlShimTest extends \PHPUnit_Framework_TestCase
"INSERT INTO
testing (id, one, two, three, four, five, six, seven, eight, nine, ten, eleven)
VALUES
- (5, '5', '5', '5', '5', '5', '5', '5', '5', '5', '5', '5')");
+ (5, '5', '5', '5', '5', '5', '5', '5', '5', '5', '5', '5')"
+ );
$this->assertTrue($result);
$this->assertEquals(5, mysql_insert_id());
}
@@ -785,7 +786,7 @@ class MySqlShimTest extends \PHPUnit_Framework_TestCase
$result = mysql_query('SELECT one, two AS aliased FROM testing');
$this->assertResult($result);
- for($i = 0, $max = mysql_num_rows($result); $i < $max; $i++) {
+ for ($i = 0, $max = mysql_num_rows($result); $i < $max; $i++) {
$this->assertEquals($i+1, mysql_result($result, $i, 0));
$this->assertEquals($i+1, mysql_result($result, $i, 'one'));
$this->assertEquals($i+1, mysql_result($result, $i, 1));
@@ -889,7 +890,9 @@ class MySqlShimTest extends \PHPUnit_Framework_TestCase
$this->assertRegExp(
'@You have an error in your SQL syntax; check the manual that corresponds to your (.*?) ' .
- 'server version for the right syntax to use near \'\' at line 1@', mysql_error());
+ 'server version for the right syntax to use near \'\' at line 1@',
+ mysql_error()
+ );
}
public function test_mysql_errno()