@@ -88,8 +88,8 @@ |
||
| 88 | 88 | protected function composerMessage(): array |
| 89 | 89 | { |
| 90 | 90 | return array_merge($this->splitIntoTwoColumns('MySQL Errno', (string)$this->errno), |
| 91 | - $this->splitIntoTwoColumns('Error', $this->error), |
|
| 92 | - $this->splitIntoTwoColumns('Method', $this->method)); |
|
| 91 | + $this->splitIntoTwoColumns('Error', $this->error), |
|
| 92 | + $this->splitIntoTwoColumns('Method', $this->method)); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | //-------------------------------------------------------------------------------------------------------------------- |
@@ -87,7 +87,7 @@ |
||
| 87 | 87 | */ |
| 88 | 88 | protected function composerMessage(): array |
| 89 | 89 | { |
| 90 | - return array_merge($this->splitIntoTwoColumns('MySQL Errno', (string)$this->errno), |
|
| 90 | + return array_merge($this->splitIntoTwoColumns('MySQL Errno', (string) $this->errno), |
|
| 91 | 91 | $this->splitIntoTwoColumns('Error', $this->error), |
| 92 | 92 | $this->splitIntoTwoColumns('Method', $this->method)); |
| 93 | 93 | } |
@@ -1035,7 +1035,7 @@ |
||
| 1035 | 1035 | if ($this->logQueries) |
| 1036 | 1036 | { |
| 1037 | 1037 | $this->queryLog[] = ['query' => $query, |
| 1038 | - 'time' => microtime(true) - $time0]; |
|
| 1038 | + 'time' => microtime(true) - $time0]; |
|
| 1039 | 1039 | } |
| 1040 | 1040 | } |
| 1041 | 1041 | |
@@ -326,11 +326,11 @@ discard block |
||
| 326 | 326 | $line = ''; |
| 327 | 327 | foreach ($row as $i => $field) |
| 328 | 328 | { |
| 329 | - if ($i>0) |
|
| 329 | + if ($i > 0) |
|
| 330 | 330 | { |
| 331 | 331 | $line .= ' '; |
| 332 | 332 | } |
| 333 | - $line .= str_pad((string)$field, $fields[$i]->max_length); |
|
| 333 | + $line .= str_pad((string) $field, $fields[$i]->max_length); |
|
| 334 | 334 | } |
| 335 | 335 | echo date('Y-m-d H:i:s'), ' ', $line, "\n"; |
| 336 | 336 | $n++; |
@@ -703,16 +703,16 @@ discard block |
||
| 703 | 703 | $query = "show variables like 'max_allowed_packet'"; |
| 704 | 704 | $maxAllowedPacket = $this->executeRow1($query); |
| 705 | 705 | |
| 706 | - $this->maxAllowedPacket = (int)$maxAllowedPacket['Value']; |
|
| 706 | + $this->maxAllowedPacket = (int) $maxAllowedPacket['Value']; |
|
| 707 | 707 | |
| 708 | 708 | // Note: When setting $chunkSize equal to $maxAllowedPacket it is not possible to transmit a LOB |
| 709 | 709 | // with size $maxAllowedPacket bytes (but only $maxAllowedPacket - 8 bytes). But when setting the size of |
| 710 | 710 | // $chunkSize less than $maxAllowedPacket than it is possible to transmit a LOB with size |
| 711 | 711 | // $maxAllowedPacket bytes. |
| 712 | - $this->chunkSize = (int)min($this->maxAllowedPacket - 8, 1024 * 1024); |
|
| 712 | + $this->chunkSize = (int) min($this->maxAllowedPacket - 8, 1024 * 1024); |
|
| 713 | 713 | } |
| 714 | 714 | |
| 715 | - return (int)$this->maxAllowedPacket; |
|
| 715 | + return (int) $this->maxAllowedPacket; |
|
| 716 | 716 | } |
| 717 | 717 | |
| 718 | 718 | //-------------------------------------------------------------------------------------------------------------------- |
@@ -800,7 +800,7 @@ discard block |
||
| 800 | 800 | |
| 801 | 801 | if (is_int($value) || is_float($value)) |
| 802 | 802 | { |
| 803 | - return (string)$value; |
|
| 803 | + return (string) $value; |
|
| 804 | 804 | } |
| 805 | 805 | |
| 806 | 806 | return "'".$this->mysqli->real_escape_string($value)."'"; |
@@ -821,7 +821,7 @@ discard block |
||
| 821 | 821 | return 'null'; |
| 822 | 822 | } |
| 823 | 823 | |
| 824 | - return (string)$value; |
|
| 824 | + return (string) $value; |
|
| 825 | 825 | } |
| 826 | 826 | |
| 827 | 827 | //-------------------------------------------------------------------------------------------------------------------- |
@@ -839,7 +839,7 @@ discard block |
||
| 839 | 839 | return 'null'; |
| 840 | 840 | } |
| 841 | 841 | |
| 842 | - return (string)$value; |
|
| 842 | + return (string) $value; |
|
| 843 | 843 | } |
| 844 | 844 | |
| 845 | 845 | //-------------------------------------------------------------------------------------------------------------------- |
@@ -1140,7 +1140,7 @@ discard block |
||
| 1140 | 1140 | { |
| 1141 | 1141 | $n = strlen($data); |
| 1142 | 1142 | $p = 0; |
| 1143 | - while ($p<$n) |
|
| 1143 | + while ($p < $n) |
|
| 1144 | 1144 | { |
| 1145 | 1145 | $success = @$statement->send_long_data($paramNr, substr($data, $p, $this->chunkSize)); |
| 1146 | 1146 | if (!$success) |
@@ -1183,13 +1183,13 @@ discard block |
||
| 1183 | 1183 | foreach ($columns as $column) |
| 1184 | 1184 | { |
| 1185 | 1185 | $separator .= str_repeat('-', $column['length'] + 2).'+'; |
| 1186 | - $spaces = ($column['length'] + 2) - mb_strlen((string)$column['header']); |
|
| 1186 | + $spaces = ($column['length'] + 2) - mb_strlen((string) $column['header']); |
|
| 1187 | 1187 | |
| 1188 | - $spacesLeft = (int)floor($spaces / 2); |
|
| 1189 | - $spacesRight = (int)ceil($spaces / 2); |
|
| 1188 | + $spacesLeft = (int) floor($spaces / 2); |
|
| 1189 | + $spacesRight = (int) ceil($spaces / 2); |
|
| 1190 | 1190 | |
| 1191 | - $fillerLeft = ($spacesLeft>0) ? str_repeat(' ', $spacesLeft) : ''; |
|
| 1192 | - $fillerRight = ($spacesRight>0) ? str_repeat(' ', $spacesRight) : ''; |
|
| 1191 | + $fillerLeft = ($spacesLeft > 0) ? str_repeat(' ', $spacesLeft) : ''; |
|
| 1192 | + $fillerRight = ($spacesRight > 0) ? str_repeat(' ', $spacesRight) : ''; |
|
| 1193 | 1193 | |
| 1194 | 1194 | $header .= $fillerLeft.$column['header'].$fillerRight.'|'; |
| 1195 | 1195 | } |
@@ -1208,7 +1208,7 @@ discard block |
||
| 1208 | 1208 | */ |
| 1209 | 1209 | private function executeTableShowTableColumn(array $column, mixed $value): void |
| 1210 | 1210 | { |
| 1211 | - $spaces = str_repeat(' ', max($column['length'] - mb_strlen((string)$value), 0)); |
|
| 1211 | + $spaces = str_repeat(' ', max($column['length'] - mb_strlen((string) $value), 0)); |
|
| 1212 | 1212 | |
| 1213 | 1213 | switch ($column['type']) |
| 1214 | 1214 | { |
@@ -98,7 +98,7 @@ |
||
| 98 | 98 | |
| 99 | 99 | case 'decimal': |
| 100 | 100 | $ret = $dataTypeInfo['numeric_precision']; |
| 101 | - if ($dataTypeInfo['numeric_scale']>0) |
|
| 101 | + if ($dataTypeInfo['numeric_scale'] > 0) |
|
| 102 | 102 | { |
| 103 | 103 | $ret += 1; |
| 104 | 104 | } |
@@ -550,9 +550,9 @@ discard block |
||
| 550 | 550 | private function extractParameters(): void |
| 551 | 551 | { |
| 552 | 552 | $this->routineParameters = new RoutineParametersHelper($this->dl, |
| 553 | - $this->io, |
|
| 554 | - $this->docBlockReflection, |
|
| 555 | - $this->routineName); |
|
| 553 | + $this->io, |
|
| 554 | + $this->docBlockReflection, |
|
| 555 | + $this->routineName); |
|
| 556 | 556 | |
| 557 | 557 | $this->routineParameters->extractRoutineParameters(); |
| 558 | 558 | } |
@@ -943,8 +943,8 @@ discard block |
||
| 943 | 943 | 'longtext']; |
| 944 | 944 | $parts = ['whitespace' => '(?<whitespace>\s+)', |
| 945 | 945 | 'type_list' => str_replace('type-list', |
| 946 | - implode('|', $types), |
|
| 947 | - '(?<datatype>(type-list).*)'), |
|
| 946 | + implode('|', $types), |
|
| 947 | + '(?<datatype>(type-list).*)'), |
|
| 948 | 948 | 'nullable' => '(?<nullable>not\s+null)?', |
| 949 | 949 | 'punctuation' => '(?<punctuation>\s*[,;])?', |
| 950 | 950 | 'hint' => '(?<hint>\s+--\s+type:\s+(\w+\.)?\w+\.\w+\s*)']; |
@@ -491,7 +491,7 @@ discard block |
||
| 491 | 491 | { |
| 492 | 492 | throw new RoutineLoaderException('Tag @type not found in DocBlock.'); |
| 493 | 493 | } |
| 494 | - elseif (count($tags)>1) |
|
| 494 | + elseif (count($tags) > 1) |
|
| 495 | 495 | { |
| 496 | 496 | throw new RoutineLoaderException('Multiple @type tags found in DocBlock.'); |
| 497 | 497 | } |
@@ -654,7 +654,7 @@ discard block |
||
| 654 | 654 | $key1 = $this->findFirstMatchingLine('/^\s*(as|is)\s*$/i'); |
| 655 | 655 | $key2 = $this->findFirstMatchingLine('/^\s*begin\s*$/i'); |
| 656 | 656 | |
| 657 | - if ($key1!==null && $key2!==null && $key1<$key2) |
|
| 657 | + if ($key1!==null && $key2!==null && $key1 < $key2) |
|
| 658 | 658 | { |
| 659 | 659 | $this->syntax = self::PL_SQL_SYNTAX; |
| 660 | 660 | } |
@@ -826,7 +826,7 @@ discard block |
||
| 826 | 826 | |
| 827 | 827 | $start = $this->findFirstMatchingLine('/^\s*\/\*\*\s*$/'); |
| 828 | 828 | $end = $this->findFirstMatchingLine('/^\s*\*\/\s*$/'); |
| 829 | - if ($start!==null && $end!==null && $start<$end) |
|
| 829 | + if ($start!==null && $end!==null && $start < $end) |
|
| 830 | 830 | { |
| 831 | 831 | $lines = array_slice($this->routineSourceCodeLines, $start, $end - $start + 1); |
| 832 | 832 | $docBlock = implode(PHP_EOL, $lines); |
@@ -911,7 +911,7 @@ discard block |
||
| 911 | 911 | */ |
| 912 | 912 | private function updateSourceTypeHints(): void |
| 913 | 913 | { |
| 914 | - $types = ['int', |
|
| 914 | + $types = ['int', |
|
| 915 | 915 | 'smallint', |
| 916 | 916 | 'tinyint', |
| 917 | 917 | 'mediumint', |
@@ -941,7 +941,7 @@ discard block |
||
| 941 | 941 | 'text', |
| 942 | 942 | 'mediumtext', |
| 943 | 943 | 'longtext']; |
| 944 | - $parts = ['whitespace' => '(?<whitespace>\s+)', |
|
| 944 | + $parts = ['whitespace' => '(?<whitespace>\s+)', |
|
| 945 | 945 | 'type_list' => str_replace('type-list', |
| 946 | 946 | implode('|', $types), |
| 947 | 947 | '(?<datatype>(type-list).*)'), |
@@ -974,7 +974,7 @@ discard block |
||
| 974 | 974 | $matches['nullable'], |
| 975 | 975 | $matches['punctuation'], |
| 976 | 976 | $matches['hint']); |
| 977 | - $this->typeHints[$hint] = $actualType; |
|
| 977 | + $this->typeHints[$hint] = $actualType; |
|
| 978 | 978 | } |
| 979 | 979 | } |
| 980 | 980 | |