diff options
author | Christian Schneider | 2025-02-18 16:39:05 +0100 |
---|---|---|
committer | Christian Schneider | 2025-02-18 16:39:05 +0100 |
commit | c6330b2766fec18784d6395b0bbafbe56a4c6197 (patch) | |
tree | 66aa27bf43dea8471a165560433d1db053d1ab59 | |
parent | 2a4e493468d5337e7cfd2b3d04f9bb0943b56775 (diff) | |
download | itools-c6330b2766fec18784d6395b0bbafbe56a4c6197.tar.gz itools-c6330b2766fec18784d6395b0bbafbe56a4c6197.tar.bz2 itools-c6330b2766fec18784d6395b0bbafbe56a4c6197.zip |
Cleanup round to make indentation style consistent across files
-rw-r--r-- | it_dbi.class | 6 | ||||
-rw-r--r-- | it_dbi_postgres.class | 9 | ||||
-rw-r--r-- | it_debug.class | 3 | ||||
-rw-r--r-- | it_url.class | 2 | ||||
-rwxr-xr-x | test/it.t | 3 | ||||
-rwxr-xr-x | test/it_error.t | 9 |
6 files changed, 21 insertions, 11 deletions
diff --git a/it_dbi.class b/it_dbi.class index 14ae5fa..bd3e2e8 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -1100,7 +1100,8 @@ function _escape_name($str) return "`" . $str . "`"; } -function _connect_db($p) { +function _connect_db($p) +{ mysqli_report(MYSQLI_REPORT_OFF); # it_dbi does not want exceptions for syntax errors $result = @mysqli_connect($p['server'], $p['user'], $p['pw']); @@ -1125,7 +1126,8 @@ function _get_field_defs() return (array)$result; } -function _tables($p) { +function _tables($p) +{ for ($qr = $this->query('SHOW TABLES', $p); $row = mysqli_fetch_row($qr);) $result[] = $row[0]; diff --git a/it_dbi_postgres.class b/it_dbi_postgres.class index 6b60fb4..1190f2c 100644 --- a/it_dbi_postgres.class +++ b/it_dbi_postgres.class @@ -95,13 +95,15 @@ function _escape_name($str) return pg_escape_identifier($this->_link, $str); } -function _connect_db($p) { +function _connect_db($p) +{ $result = @pg_connect("host=$p[server] user=$p[user] dbname=$p[db] password=$p[pw]", PGSQL_CONNECT_FORCE_NEW); if ($result) { # set charset used for this connection (also change mariadb specific default utf8mb4 to utf8) - if ($p['charset']) { + if ($p['charset']) + { $charset = $p['charset'] == 'utf8mb4' ? 'UNICODE' : $p['charset']; if (pg_set_client_encoding($result, $charset) < 0) $this->_fatal("_connect(): can't set charset \"$charset\""); @@ -117,7 +119,8 @@ function __query($query, $p) { $starttime = microtime(true); pg_send_query($this->_link, $query); - while (pg_connection_busy($this->_link)) { + while (pg_connection_busy($this->_link)) + { if ($p['timeout'] && (microtime(true) - $starttime) > $p['timeout']) return false; $read = $error = [pg_socket($this->_link)]; diff --git a/it_debug.class b/it_debug.class index b929f9c..6cad9b5 100644 --- a/it_debug.class +++ b/it_debug.class @@ -59,7 +59,8 @@ static function echo($args) echo self::dump($args); } -static function debug_backtrace($p = []) { +static function debug_backtrace($p = []) +{ if (!is_array($p)) $p = array('skiplevels' => $p); diff --git a/it_url.class b/it_url.class index 5777c98..8af61ae 100644 --- a/it_url.class +++ b/it_url.class @@ -315,7 +315,7 @@ function request($p=array()) } - // FIXME 2025-01 NG just use CURLOPT_MAXFILESIZE if we have curl 8.4 + # FIXME 2025-01 NG just use CURLOPT_MAXFILESIZE if we have curl 8.4 $content = ""; if ($p['maxlength'] && !$p['writefunction']) { @@ -16,7 +16,8 @@ function _match($regex, $string, $expect, $name, $p = []) { $GLOBALS['TEST_MORE_LEVEL'] = 1; $pass = is (it::match($regex, $string, $p), $expect, $name); - if (!$pass) { + if (!$pass) + { diag(" regex given: $regex" . ($p ? " " .D($p) : "")); diag(" regex converted: " . it::convertregex($regex)); } diff --git a/test/it_error.t b/test/it_error.t index 4d9e2ad..a45e312 100755 --- a/test/it_error.t +++ b/test/it_error.t @@ -8,8 +8,10 @@ $GLOBALS['debug_verboseerrors'] = 1; if ($opts['args'][0]) foo($opts['args'][0]); -else { - foreach (range(1, 12) as $testnum) { +else +{ + foreach (range(1, 12) as $testnum) + { $errlines = explode("\n", it::exec('{cmd} {testnum} |& cat', ['cmd' => $argv[0], 'testnum' => $testnum])); $expect = $expect = it::match('Expect: (.*)', $errlines[0]); $errbody = join("\n", array_slice($errlines, 1)); @@ -34,7 +36,8 @@ function foo($testno) { $a = "hi"; - switch ($testno) { + switch ($testno) + { case 1: expect(); echo "Trace: " . it_debug::backtrace() . "\n\n"; exit; case 2: expect(); echo "Stack:\n" . it_debug::backtrace(['format' => "medium"]); exit; |