Fix: #19987: Reopening a function removes charset
- Psalm & PHPStan issues addressed - Unused ignores from PHPStan baseline removed Signed-off-by: Declan Boylan <declan.boylan@gmail.com>
This commit is contained in:
parent
d6b2f2d92d
commit
a5c12bb286
@ -623,19 +623,34 @@ class Routines
|
||||
$retval['item_returnopts_num'] = '';
|
||||
$retval['item_returnopts_text'] = '';
|
||||
|
||||
if (! empty($routine['DTD_IDENTIFIER'])) {
|
||||
$options = [];
|
||||
foreach ($stmt->return->options->options as $opt) {
|
||||
$options[] = is_string($opt) ? $opt : $opt['value'];
|
||||
}
|
||||
|
||||
if (! empty($routine['DTD_IDENTIFIER']) && $stmt->return !== null) {
|
||||
$retval['item_returntype'] = $stmt->return->name;
|
||||
$retval['item_returnlength'] = implode(',', $stmt->return->parameters);
|
||||
$retval['item_returnopts_num'] = implode(' ', $options);
|
||||
$retval['item_returnopts_text'] = implode(' ', $options);
|
||||
|
||||
// Extract charset (CHARSET or CHARACTER SET) separately from numeric options
|
||||
/** @var string|false $charset */
|
||||
$charset = $stmt->return->options->has('CHARSET');
|
||||
if ($charset === false) {
|
||||
/** @var string|false $charset */
|
||||
$charset = $stmt->return->options->has('CHARACTER SET');
|
||||
}
|
||||
|
||||
$retval['item_returnopts_text'] = is_string($charset) ? mb_strtolower($charset) : '';
|
||||
|
||||
// Extract numeric options (UNSIGNED, ZEROFILL, UNSIGNED ZEROFILL.)
|
||||
$numericOpts = [];
|
||||
foreach ($stmt->return->options->options as $opt) {
|
||||
if (! is_string($opt) || ! in_array($opt, $this->numericOptions, true)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$numericOpts[] = $opt;
|
||||
}
|
||||
|
||||
$retval['item_returnopts_num'] = implode(' ', $numericOpts);
|
||||
}
|
||||
|
||||
$retval['item_definer'] = $stmt->options->has('DEFINER');
|
||||
$retval['item_definer'] = $stmt->options !== null ? $stmt->options->has('DEFINER') : false;
|
||||
$retval['item_definition'] = $body;
|
||||
$retval['item_isdeterministic'] = '';
|
||||
if ($routine['IS_DETERMINISTIC'] === 'YES') {
|
||||
|
||||
@ -13845,11 +13845,6 @@ parameters:
|
||||
count: 2
|
||||
path: libraries/classes/Database/Routines.php
|
||||
|
||||
-
|
||||
message: "#^Cannot access offset 'value' on mixed\\.$#"
|
||||
count: 1
|
||||
path: libraries/classes/Database/Routines.php
|
||||
|
||||
-
|
||||
message: "#^Cannot access offset \\(float\\|int\\) on mixed\\.$#"
|
||||
count: 6
|
||||
@ -13900,21 +13895,6 @@ parameters:
|
||||
count: 9
|
||||
path: libraries/classes/Database/Routines.php
|
||||
|
||||
-
|
||||
message: "#^Cannot access property \\$name on PhpMyAdmin\\\\SqlParser\\\\Components\\\\DataType\\|null\\.$#"
|
||||
count: 1
|
||||
path: libraries/classes/Database/Routines.php
|
||||
|
||||
-
|
||||
message: "#^Cannot access property \\$options on PhpMyAdmin\\\\SqlParser\\\\Components\\\\DataType\\|null\\.$#"
|
||||
count: 1
|
||||
path: libraries/classes/Database/Routines.php
|
||||
|
||||
-
|
||||
message: "#^Cannot access property \\$parameters on PhpMyAdmin\\\\SqlParser\\\\Components\\\\DataType\\|null\\.$#"
|
||||
count: 1
|
||||
path: libraries/classes/Database/Routines.php
|
||||
|
||||
-
|
||||
message: "#^Cannot access property \\$types on mixed\\.$#"
|
||||
count: 4
|
||||
@ -13925,11 +13905,6 @@ parameters:
|
||||
count: 4
|
||||
path: libraries/classes/Database/Routines.php
|
||||
|
||||
-
|
||||
message: "#^Cannot call method has\\(\\) on PhpMyAdmin\\\\SqlParser\\\\Components\\\\OptionsArray\\|null\\.$#"
|
||||
count: 1
|
||||
path: libraries/classes/Database/Routines.php
|
||||
|
||||
-
|
||||
message: "#^Cannot call method isSuccess\\(\\) on mixed\\.$#"
|
||||
count: 1
|
||||
|
||||
@ -94,7 +94,7 @@
|
||||
<option value="">{% trans 'Charset' %}</option>
|
||||
<option value=""></option>
|
||||
{% for charset in charsets %}
|
||||
<option value="{{ charset.getName() }}" title="{{ charset.getDescription() }}"{{ routine.item_returnopts_text == charset.getName() ? ' selected' }}>{{ charset.getName() }}</option>
|
||||
<option value="{{ charset.getName() }}" title="{{ charset.getDescription() }}"{{ routine.item_returnopts_text|lower == charset.getName() ? ' selected' }}>{{ charset.getName() }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user