Fix coding standard spacing issues

- Fixes one line doc comments
- Fixes parent call spacing
- Fixes constant spacing

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
Maurício Meneghini Fauth 2023-02-24 21:06:17 -03:00
parent 77957a69a5
commit 556594b4cd
No known key found for this signature in database
GPG Key ID: 6A16FD38AFC89CC8
578 changed files with 1712 additions and 3447 deletions

View File

@ -156,17 +156,13 @@ class Advisor
$this->rules = array_merge($genericRules, $extraRules);
}
/**
* @return array{fired: array, notfired: array, unchecked: array, errors: array}
*/
/** @return array{fired: array, notfired: array, unchecked: array, errors: array} */
public function getRunResult(): array
{
return $this->runResult;
}
/**
* @psalm-return array{fired:array, notfired:array, unchecked:array, errors:array}
*/
/** @psalm-return array{fired:array, notfired:array, unchecked:array, errors:array} */
public function run(): array
{
$this->setVariables();

View File

@ -210,9 +210,7 @@ class Bookmark
return $bookmark;
}
/**
* @param array $row Resource used to build the bookmark
*/
/** @param array $row Resource used to build the bookmark */
protected static function createFromRow(DatabaseInterface $dbi, array $row): Bookmark
{
$bookmark = new Bookmark($dbi, new Relation($dbi));

View File

@ -86,9 +86,7 @@ final class Collation
$this->description = $this->buildDescription();
}
/**
* @param string[] $state State obtained from the database server
*/
/** @param string[] $state State obtained from the database server */
public static function fromServer(array $state): self
{
return new self(
@ -233,9 +231,7 @@ final class Collation
return $this->buildName($name, $variant, $suffixes);
}
/**
* @param string[] $suffixes
*/
/** @param string[] $suffixes */
private function buildName(string $result, string|null $variant, array $suffixes): string
{
if ($variant !== null) {

View File

@ -598,9 +598,7 @@ class Config
$this->source = trim($source);
}
/**
* @throws ConfigException
*/
/** @throws ConfigException */
public function checkConfigSource(): bool
{
if (! $this->getSource()) {

View File

@ -51,9 +51,7 @@ class Descriptions
return Sanitize::sanitizeMessage($value);
}
/**
* @return array<string, string>
*/
/** @return array<string, string> */
private static function getComments(): array
{
/** @var array<string, string> $commentsMap */
@ -70,9 +68,7 @@ class Descriptions
];
}
/**
* @return array<string, string>
*/
/** @return array<string, string> */
private static function getDescriptions(): array
{
/** @var array<string, string> $descriptionsMap */
@ -599,9 +595,7 @@ class Descriptions
];
}
/**
* @return array<string, string>
*/
/** @return array<string, string> */
private static function getNames(): array
{
/** @var array<string, string> $namesMap */

View File

@ -105,9 +105,7 @@ class FormDisplay
private FormDisplayTemplate $formDisplayTemplate;
/**
* @param ConfigFile $cf Config file instance
*/
/** @param ConfigFile $cf Config file instance */
public function __construct(ConfigFile $cf)
{
$this->formDisplayTemplate = new FormDisplayTemplate($GLOBALS['config']);

View File

@ -24,6 +24,7 @@ abstract class BaseForm extends FormDisplay
final public function __construct(ConfigFile $cf, $serverId = null)
{
parent::__construct($cf);
foreach (static::getForms() as $formName => $form) {
$this->registerForm($formName, $form, $serverId);
}

View File

@ -25,17 +25,13 @@ class BaseFormList
/** @var BaseForm[] */
private $forms;
/**
* @return string[]
*/
/** @return string[] */
public static function getAllFormNames(): array
{
return array_keys(static::$all);
}
/**
* @param string $name Name
*/
/** @param string $name Name */
public static function isValid(string $name): bool
{
return array_key_exists($name, static::$all);
@ -55,9 +51,7 @@ class BaseFormList
return null;
}
/**
* @param ConfigFile $cf Config file instance
*/
/** @param ConfigFile $cf Config file instance */
final public function __construct(ConfigFile $cf)
{
$this->forms = [];

View File

@ -12,9 +12,7 @@ use PhpMyAdmin\Config\Forms\User\MainForm;
class BrowseForm extends BaseForm
{
/**
* @return array
*/
/** @return array */
public static function getForms(): array
{
return [

View File

@ -12,9 +12,7 @@ use PhpMyAdmin\Config\Forms\User\MainForm;
class DbStructureForm extends BaseForm
{
/**
* @return array
*/
/** @return array */
public static function getForms(): array
{
return [

View File

@ -13,9 +13,7 @@ use PhpMyAdmin\Config\Forms\User\MainForm;
class EditForm extends BaseForm
{
/**
* @return array
*/
/** @return array */
public static function getForms(): array
{
return [

View File

@ -12,9 +12,7 @@ use PhpMyAdmin\Config\Forms\User\MainForm;
class TableStructureForm extends BaseForm
{
/**
* @return array
*/
/** @return array */
public static function getForms(): array
{
return [

View File

@ -11,9 +11,7 @@ use PhpMyAdmin\Config\Forms\BaseForm;
class ConfigForm extends BaseForm
{
/**
* @return array
*/
/** @return array */
public static function getForms(): array
{
return [

View File

@ -11,9 +11,7 @@ use function array_diff;
class FeaturesForm extends \PhpMyAdmin\Config\Forms\User\FeaturesForm
{
/**
* @return array
*/
/** @return array */
public static function getForms(): array
{
// phpcs:disable Squiz.Arrays.ArrayDeclaration.KeySpecified,Squiz.Arrays.ArrayDeclaration.NoKeySpecified

View File

@ -9,9 +9,7 @@ namespace PhpMyAdmin\Config\Forms\Setup;
class MainForm extends \PhpMyAdmin\Config\Forms\User\MainForm
{
/**
* @return array
*/
/** @return array */
public static function getForms(): array
{
$result = parent::getForms();

View File

@ -13,9 +13,7 @@ use function __;
class ServersForm extends BaseForm
{
/**
* @return array
*/
/** @return array */
public static function getForms(): array
{
// phpcs:disable Squiz.Arrays.ArrayDeclaration.KeySpecified,Squiz.Arrays.ArrayDeclaration.NoKeySpecified

View File

@ -9,9 +9,7 @@ namespace PhpMyAdmin\Config\Forms\Setup;
class SqlForm extends \PhpMyAdmin\Config\Forms\User\SqlForm
{
/**
* @return array
*/
/** @return array */
public static function getForms(): array
{
$result = parent::getForms();

View File

@ -13,9 +13,7 @@ use function __;
class ExportForm extends BaseForm
{
/**
* @return array
*/
/** @return array */
public static function getForms(): array
{
// phpcs:disable Squiz.Arrays.ArrayDeclaration.KeySpecified,Squiz.Arrays.ArrayDeclaration.NoKeySpecified

View File

@ -13,9 +13,7 @@ use function __;
class FeaturesForm extends BaseForm
{
/**
* @return array
*/
/** @return array */
public static function getForms(): array
{
$result = [

View File

@ -13,9 +13,7 @@ use function __;
class ImportForm extends BaseForm
{
/**
* @return array
*/
/** @return array */
public static function getForms(): array
{
return [

View File

@ -13,9 +13,7 @@ use function __;
class MainForm extends BaseForm
{
/**
* @return array
*/
/** @return array */
public static function getForms(): array
{
return [

View File

@ -13,9 +13,7 @@ use function __;
class NaviForm extends BaseForm
{
/**
* @return array
*/
/** @return array */
public static function getForms(): array
{
return [

View File

@ -13,9 +13,7 @@ use function __;
class SqlForm extends BaseForm
{
/**
* @return array
*/
/** @return array */
public static function getForms(): array
{
return [

View File

@ -33,9 +33,7 @@ class ServerConfigChecks
/** @var ConfigFile configurations being checked */
protected ConfigFile $cfg;
/**
* @param ConfigFile $cfg Configuration
*/
/** @param ConfigFile $cfg Configuration */
public function __construct(ConfigFile $cfg)
{
$this->cfg = $cfg;

File diff suppressed because it is too large Load Diff

View File

@ -8,9 +8,7 @@ use function in_array;
// phpcs:disable Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
/**
* @psalm-immutable
*/
/** @psalm-immutable */
final class Console
{
/** @var bool */
@ -55,9 +53,7 @@ final class Console
*/
public $Order;
/**
* @param mixed[] $console
*/
/** @param mixed[] $console */
public function __construct(array $console = [])
{
$this->StartHistory = $this->setStartHistory($console);
@ -72,9 +68,7 @@ final class Console
$this->Order = $this->setOrder($console);
}
/**
* @param mixed[] $console
*/
/** @param mixed[] $console */
private function setStartHistory(array $console): bool
{
if (isset($console['StartHistory'])) {
@ -84,9 +78,7 @@ final class Console
return false;
}
/**
* @param mixed[] $console
*/
/** @param mixed[] $console */
private function setAlwaysExpand(array $console): bool
{
if (isset($console['AlwaysExpand'])) {
@ -96,9 +88,7 @@ final class Console
return false;
}
/**
* @param mixed[] $console
*/
/** @param mixed[] $console */
private function setCurrentQuery(array $console): bool
{
if (isset($console['CurrentQuery'])) {
@ -108,9 +98,7 @@ final class Console
return true;
}
/**
* @param mixed[] $console
*/
/** @param mixed[] $console */
private function setEnterExecutes(array $console): bool
{
if (isset($console['EnterExecutes'])) {
@ -120,9 +108,7 @@ final class Console
return false;
}
/**
* @param mixed[] $console
*/
/** @param mixed[] $console */
private function setDarkTheme(array $console): bool
{
if (isset($console['DarkTheme'])) {
@ -163,9 +149,7 @@ final class Console
return 92;
}
/**
* @param mixed[] $console
*/
/** @param mixed[] $console */
private function setGroupQueries(array $console): bool
{
if (isset($console['GroupQueries'])) {

View File

@ -4,9 +4,7 @@ declare(strict_types=1);
namespace PhpMyAdmin\Config\Settings;
/**
* @psalm-immutable
*/
/** @psalm-immutable */
final class Debug
{
/**
@ -37,9 +35,7 @@ final class Debug
*/
public $simple2fa;
/**
* @param mixed[] $debug
*/
/** @param mixed[] $debug */
public function __construct(array $debug = [])
{
$this->sql = $this->setSql($debug);
@ -48,33 +44,25 @@ final class Debug
$this->simple2fa = $this->setSimple2fa($debug);
}
/**
* @param mixed[] $debug
*/
/** @param mixed[] $debug */
private function setSql(array $debug): bool
{
return isset($debug['sql']) && $debug['sql'];
}
/**
* @param mixed[] $debug
*/
/** @param mixed[] $debug */
private function setSqlLog(array $debug): bool
{
return isset($debug['sqllog']) && $debug['sqllog'];
}
/**
* @param mixed[] $debug
*/
/** @param mixed[] $debug */
private function setDemo(array $debug): bool
{
return isset($debug['demo']) && $debug['demo'];
}
/**
* @param mixed[] $debug
*/
/** @param mixed[] $debug */
private function setSimple2fa(array $debug): bool
{
return isset($debug['simple2fa']) && $debug['simple2fa'];

View File

@ -472,9 +472,7 @@ final class Export
/** @var bool */
public $remove_definer_from_definitions;
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
public function __construct(array $export = [])
{
$this->format = $this->setFormat($export);
@ -645,9 +643,7 @@ final class Export
return $export['compression'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setLockTables(array $export): bool
{
if (! isset($export['lock_tables'])) {
@ -657,9 +653,7 @@ final class Export
return (bool) $export['lock_tables'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setAsSeparateFiles(array $export): bool
{
if (! isset($export['as_separate_files'])) {
@ -669,9 +663,7 @@ final class Export
return (bool) $export['as_separate_files'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setAsFile(array $export): bool
{
if (! isset($export['asfile'])) {
@ -681,9 +673,7 @@ final class Export
return (bool) $export['asfile'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setCharset(array $export): string
{
if (! isset($export['charset'])) {
@ -693,9 +683,7 @@ final class Export
return (string) $export['charset'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setOnServer(array $export): bool
{
if (! isset($export['onserver'])) {
@ -705,9 +693,7 @@ final class Export
return (bool) $export['onserver'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setOnServerOverwrite(array $export): bool
{
if (! isset($export['onserver_overwrite'])) {
@ -717,9 +703,7 @@ final class Export
return (bool) $export['onserver_overwrite'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setQuickExportOnServer(array $export): bool
{
if (! isset($export['quick_export_onserver'])) {
@ -729,9 +713,7 @@ final class Export
return (bool) $export['quick_export_onserver'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setQuickExportOnServerOverwrite(array $export): bool
{
if (! isset($export['quick_export_onserver_overwrite'])) {
@ -741,9 +723,7 @@ final class Export
return (bool) $export['quick_export_onserver_overwrite'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setRememberFileTemplate(array $export): bool
{
if (! isset($export['remember_file_template'])) {
@ -753,9 +733,7 @@ final class Export
return (bool) $export['remember_file_template'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setFileTemplateTable(array $export): string
{
if (! isset($export['file_template_table'])) {
@ -765,9 +743,7 @@ final class Export
return (string) $export['file_template_table'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setFileTemplateDatabase(array $export): string
{
if (! isset($export['file_template_database'])) {
@ -777,9 +753,7 @@ final class Export
return (string) $export['file_template_database'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setFileTemplateServer(array $export): string
{
if (! isset($export['file_template_server'])) {
@ -822,9 +796,7 @@ final class Export
return $codegenFormat === 1 ? 1 : 0;
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setOdsColumns(array $export): bool
{
if (! isset($export['ods_columns'])) {
@ -834,9 +806,7 @@ final class Export
return (bool) $export['ods_columns'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setOdsNull(array $export): string
{
if (! isset($export['ods_null'])) {
@ -863,9 +833,7 @@ final class Export
return $export['odt_structure_or_data'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setOdtColumns(array $export): bool
{
if (! isset($export['odt_columns'])) {
@ -875,9 +843,7 @@ final class Export
return (bool) $export['odt_columns'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setOdtRelation(array $export): bool
{
if (! isset($export['odt_relation'])) {
@ -887,9 +853,7 @@ final class Export
return (bool) $export['odt_relation'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setOdtComments(array $export): bool
{
if (! isset($export['odt_comments'])) {
@ -899,9 +863,7 @@ final class Export
return (bool) $export['odt_comments'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setOdtMime(array $export): bool
{
if (! isset($export['odt_mime'])) {
@ -911,9 +873,7 @@ final class Export
return (bool) $export['odt_mime'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setOdtNull(array $export): string
{
if (! isset($export['odt_null'])) {
@ -940,9 +900,7 @@ final class Export
return $export['htmlword_structure_or_data'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setHtmlwordColumns(array $export): bool
{
if (! isset($export['htmlword_columns'])) {
@ -952,9 +910,7 @@ final class Export
return (bool) $export['htmlword_columns'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setHtmlwordNull(array $export): string
{
if (! isset($export['htmlword_null'])) {
@ -981,9 +937,7 @@ final class Export
return $export['texytext_structure_or_data'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setTexytextColumns(array $export): bool
{
if (! isset($export['texytext_columns'])) {
@ -993,9 +947,7 @@ final class Export
return (bool) $export['texytext_columns'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setTexytextNull(array $export): string
{
if (! isset($export['texytext_null'])) {
@ -1005,9 +957,7 @@ final class Export
return (string) $export['texytext_null'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setCsvColumns(array $export): bool
{
if (! isset($export['csv_columns'])) {
@ -1034,9 +984,7 @@ final class Export
return $export['csv_structure_or_data'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setCsvNull(array $export): string
{
if (! isset($export['csv_null'])) {
@ -1046,9 +994,7 @@ final class Export
return (string) $export['csv_null'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setCsvSeparator(array $export): string
{
if (! isset($export['csv_separator'])) {
@ -1058,9 +1004,7 @@ final class Export
return (string) $export['csv_separator'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setCsvEnclosed(array $export): string
{
if (! isset($export['csv_enclosed'])) {
@ -1070,9 +1014,7 @@ final class Export
return (string) $export['csv_enclosed'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setCsvEscaped(array $export): string
{
if (! isset($export['csv_escaped'])) {
@ -1082,9 +1024,7 @@ final class Export
return (string) $export['csv_escaped'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setCsvTerminated(array $export): string
{
if (! isset($export['csv_terminated'])) {
@ -1094,9 +1034,7 @@ final class Export
return (string) $export['csv_terminated'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setCsvRemoveCRLF(array $export): bool
{
if (! isset($export['csv_removeCRLF'])) {
@ -1106,9 +1044,7 @@ final class Export
return (bool) $export['csv_removeCRLF'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setExcelColumns(array $export): bool
{
if (! isset($export['excel_columns'])) {
@ -1118,9 +1054,7 @@ final class Export
return (bool) $export['excel_columns'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setExcelNull(array $export): string
{
if (! isset($export['excel_null'])) {
@ -1147,9 +1081,7 @@ final class Export
return $export['excel_edition'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setExcelRemoveCRLF(array $export): bool
{
if (! isset($export['excel_removeCRLF'])) {
@ -1193,9 +1125,7 @@ final class Export
return $export['latex_structure_or_data'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setLatexColumns(array $export): bool
{
if (! isset($export['latex_columns'])) {
@ -1205,9 +1135,7 @@ final class Export
return (bool) $export['latex_columns'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setLatexRelation(array $export): bool
{
if (! isset($export['latex_relation'])) {
@ -1217,9 +1145,7 @@ final class Export
return (bool) $export['latex_relation'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setLatexComments(array $export): bool
{
if (! isset($export['latex_comments'])) {
@ -1229,9 +1155,7 @@ final class Export
return (bool) $export['latex_comments'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setLatexMime(array $export): bool
{
if (! isset($export['latex_mime'])) {
@ -1241,9 +1165,7 @@ final class Export
return (bool) $export['latex_mime'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setLatexNull(array $export): string
{
if (! isset($export['latex_null'])) {
@ -1253,9 +1175,7 @@ final class Export
return (string) $export['latex_null'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setLatexCaption(array $export): bool
{
if (! isset($export['latex_caption'])) {
@ -1265,9 +1185,7 @@ final class Export
return (bool) $export['latex_caption'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setLatexStructureCaption(array $export): string
{
if (! isset($export['latex_structure_caption'])) {
@ -1277,9 +1195,7 @@ final class Export
return (string) $export['latex_structure_caption'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setLatexStructureContinuedCaption(array $export): string
{
if (! isset($export['latex_structure_continued_caption'])) {
@ -1289,9 +1205,7 @@ final class Export
return (string) $export['latex_structure_continued_caption'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setLatexDataCaption(array $export): string
{
if (! isset($export['latex_data_caption'])) {
@ -1301,9 +1215,7 @@ final class Export
return (string) $export['latex_data_caption'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setLatexDataContinuedCaption(array $export): string
{
if (! isset($export['latex_data_continued_caption'])) {
@ -1313,9 +1225,7 @@ final class Export
return (string) $export['latex_data_continued_caption'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setLatexDataLabel(array $export): string
{
if (! isset($export['latex_data_label'])) {
@ -1325,9 +1235,7 @@ final class Export
return (string) $export['latex_data_label'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setLatexStructureLabel(array $export): string
{
if (! isset($export['latex_structure_label'])) {
@ -1354,9 +1262,7 @@ final class Export
return $export['mediawiki_structure_or_data'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setMediawikiCaption(array $export): bool
{
if (! isset($export['mediawiki_caption'])) {
@ -1366,9 +1272,7 @@ final class Export
return (bool) $export['mediawiki_caption'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setMediawikiHeaders(array $export): bool
{
if (! isset($export['mediawiki_headers'])) {
@ -1446,9 +1350,7 @@ final class Export
return $export['json_structure_or_data'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setJsonPrettyPrint(array $export): bool
{
if (! isset($export['json_pretty_print'])) {
@ -1458,9 +1360,7 @@ final class Export
return (bool) $export['json_pretty_print'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setJsonUnicode(array $export): bool
{
if (! isset($export['json_unicode'])) {
@ -1512,9 +1412,7 @@ final class Export
return $export['sql_compatibility'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setSqlIncludeComments(array $export): bool
{
if (! isset($export['sql_include_comments'])) {
@ -1524,9 +1422,7 @@ final class Export
return (bool) $export['sql_include_comments'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setSqlDisableFk(array $export): bool
{
if (! isset($export['sql_disable_fk'])) {
@ -1536,9 +1432,7 @@ final class Export
return (bool) $export['sql_disable_fk'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setSqlViewsAsTables(array $export): bool
{
if (! isset($export['sql_views_as_tables'])) {
@ -1548,9 +1442,7 @@ final class Export
return (bool) $export['sql_views_as_tables'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setSqlMetadata(array $export): bool
{
if (! isset($export['sql_metadata'])) {
@ -1560,9 +1452,7 @@ final class Export
return (bool) $export['sql_metadata'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setSqlUseTransaction(array $export): bool
{
if (! isset($export['sql_use_transaction'])) {
@ -1572,9 +1462,7 @@ final class Export
return (bool) $export['sql_use_transaction'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setSqlCreateDatabase(array $export): bool
{
if (! isset($export['sql_create_database'])) {
@ -1584,9 +1472,7 @@ final class Export
return (bool) $export['sql_create_database'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setSqlDropDatabase(array $export): bool
{
if (! isset($export['sql_drop_database'])) {
@ -1596,9 +1482,7 @@ final class Export
return (bool) $export['sql_drop_database'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setSqlDropTable(array $export): bool
{
if (! isset($export['sql_drop_table'])) {
@ -1608,9 +1492,7 @@ final class Export
return (bool) $export['sql_drop_table'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setSqlIfNotExists(array $export): bool
{
if (! isset($export['sql_if_not_exists'])) {
@ -1620,9 +1502,7 @@ final class Export
return (bool) $export['sql_if_not_exists'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setSqlViewCurrentUser(array $export): bool
{
if (! isset($export['sql_view_current_user'])) {
@ -1632,9 +1512,7 @@ final class Export
return (bool) $export['sql_view_current_user'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setSqlOrReplaceView(array $export): bool
{
if (! isset($export['sql_or_replace_view'])) {
@ -1644,9 +1522,7 @@ final class Export
return (bool) $export['sql_or_replace_view'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setSqlProcedureFunction(array $export): bool
{
if (! isset($export['sql_procedure_function'])) {
@ -1656,9 +1532,7 @@ final class Export
return (bool) $export['sql_procedure_function'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setSqlCreateTable(array $export): bool
{
if (! isset($export['sql_create_table'])) {
@ -1668,9 +1542,7 @@ final class Export
return (bool) $export['sql_create_table'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setSqlCreateView(array $export): bool
{
if (! isset($export['sql_create_view'])) {
@ -1680,9 +1552,7 @@ final class Export
return (bool) $export['sql_create_view'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setSqlCreateTrigger(array $export): bool
{
if (! isset($export['sql_create_trigger'])) {
@ -1692,9 +1562,7 @@ final class Export
return (bool) $export['sql_create_trigger'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setSqlAutoIncrement(array $export): bool
{
if (! isset($export['sql_auto_increment'])) {
@ -1704,9 +1572,7 @@ final class Export
return (bool) $export['sql_auto_increment'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setSqlBackquotes(array $export): bool
{
if (! isset($export['sql_backquotes'])) {
@ -1716,9 +1582,7 @@ final class Export
return (bool) $export['sql_backquotes'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setSqlDates(array $export): bool
{
if (! isset($export['sql_dates'])) {
@ -1728,9 +1592,7 @@ final class Export
return (bool) $export['sql_dates'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setSqlRelation(array $export): bool
{
if (! isset($export['sql_relation'])) {
@ -1740,9 +1602,7 @@ final class Export
return (bool) $export['sql_relation'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setSqlTruncate(array $export): bool
{
if (! isset($export['sql_truncate'])) {
@ -1752,9 +1612,7 @@ final class Export
return (bool) $export['sql_truncate'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setSqlDelayed(array $export): bool
{
if (! isset($export['sql_delayed'])) {
@ -1764,9 +1622,7 @@ final class Export
return (bool) $export['sql_delayed'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setSqlIgnore(array $export): bool
{
if (! isset($export['sql_ignore'])) {
@ -1776,9 +1632,7 @@ final class Export
return (bool) $export['sql_ignore'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setSqlUtcTime(array $export): bool
{
if (! isset($export['sql_utc_time'])) {
@ -1788,9 +1642,7 @@ final class Export
return (bool) $export['sql_utc_time'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setSqlHexForBinary(array $export): bool
{
if (! isset($export['sql_hex_for_binary'])) {
@ -1830,9 +1682,7 @@ final class Export
return $maxQuerySize >= 0 ? $maxQuerySize : 50000;
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setSqlMime(array $export): bool
{
if (! isset($export['sql_mime'])) {
@ -1842,9 +1692,7 @@ final class Export
return (bool) $export['sql_mime'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setSqlHeaderComment(array $export): string
{
if (! isset($export['sql_header_comment'])) {
@ -1871,9 +1719,7 @@ final class Export
return $export['sql_insert_syntax'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setPdfReportTitle(array $export): string
{
if (! isset($export['pdf_report_title'])) {
@ -1900,9 +1746,7 @@ final class Export
return $export['xml_structure_or_data'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setXmlExportStruc(array $export): bool
{
if (! isset($export['xml_export_struc'])) {
@ -1912,9 +1756,7 @@ final class Export
return (bool) $export['xml_export_struc'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setXmlExportEvents(array $export): bool
{
if (! isset($export['xml_export_events'])) {
@ -1924,9 +1766,7 @@ final class Export
return (bool) $export['xml_export_events'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setXmlExportFunctions(array $export): bool
{
if (! isset($export['xml_export_functions'])) {
@ -1936,9 +1776,7 @@ final class Export
return (bool) $export['xml_export_functions'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setXmlExportProcedures(array $export): bool
{
if (! isset($export['xml_export_procedures'])) {
@ -1948,9 +1786,7 @@ final class Export
return (bool) $export['xml_export_procedures'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setXmlExportTables(array $export): bool
{
if (! isset($export['xml_export_tables'])) {
@ -1960,9 +1796,7 @@ final class Export
return (bool) $export['xml_export_tables'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setXmlExportTriggers(array $export): bool
{
if (! isset($export['xml_export_triggers'])) {
@ -1972,9 +1806,7 @@ final class Export
return (bool) $export['xml_export_triggers'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setXmlExportViews(array $export): bool
{
if (! isset($export['xml_export_views'])) {
@ -1984,9 +1816,7 @@ final class Export
return (bool) $export['xml_export_views'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setXmlExportContents(array $export): bool
{
if (! isset($export['xml_export_contents'])) {
@ -2013,9 +1843,7 @@ final class Export
return $export['yaml_structure_or_data'];
}
/**
* @param array<int|string, mixed> $export
*/
/** @param array<int|string, mixed> $export */
private function setRemoveDefinerClause(array $export): bool
{
if (! isset($export['remove_definer_from_definitions'])) {

View File

@ -8,9 +8,7 @@ namespace PhpMyAdmin\Config\Settings;
use function in_array;
/**
* @psalm-immutable
*/
/** @psalm-immutable */
final class Import
{
/**
@ -112,9 +110,7 @@ final class Import
/** @var bool */
public $ods_recognize_currency;
/**
* @param array<int|string, mixed> $import
*/
/** @param array<int|string, mixed> $import */
public function __construct(array $import = [])
{
$this->format = $this->setFormat($import);
@ -160,9 +156,7 @@ final class Import
return $import['format'];
}
/**
* @param array<int|string, mixed> $import
*/
/** @param array<int|string, mixed> $import */
private function setCharset(array $import): string
{
if (! isset($import['charset'])) {
@ -172,9 +166,7 @@ final class Import
return (string) $import['charset'];
}
/**
* @param array<int|string, mixed> $import
*/
/** @param array<int|string, mixed> $import */
private function setAllowInterrupt(array $import): bool
{
if (! isset($import['allow_interrupt'])) {
@ -220,9 +212,7 @@ final class Import
return $import['sql_compatibility'];
}
/**
* @param array<int|string, mixed> $import
*/
/** @param array<int|string, mixed> $import */
private function setSqlNoAutoValueOnZero(array $import): bool
{
if (! isset($import['sql_no_auto_value_on_zero'])) {
@ -232,9 +222,7 @@ final class Import
return (bool) $import['sql_no_auto_value_on_zero'];
}
/**
* @param array<int|string, mixed> $import
*/
/** @param array<int|string, mixed> $import */
private function setSqlReadAsMultibytes(array $import): bool
{
if (! isset($import['sql_read_as_multibytes'])) {
@ -244,9 +232,7 @@ final class Import
return (bool) $import['sql_read_as_multibytes'];
}
/**
* @param array<int|string, mixed> $import
*/
/** @param array<int|string, mixed> $import */
private function setCsvReplace(array $import): bool
{
if (! isset($import['csv_replace'])) {
@ -256,9 +242,7 @@ final class Import
return (bool) $import['csv_replace'];
}
/**
* @param array<int|string, mixed> $import
*/
/** @param array<int|string, mixed> $import */
private function setCsvIgnore(array $import): bool
{
if (! isset($import['csv_ignore'])) {
@ -268,9 +252,7 @@ final class Import
return (bool) $import['csv_ignore'];
}
/**
* @param array<int|string, mixed> $import
*/
/** @param array<int|string, mixed> $import */
private function setCsvTerminated(array $import): string
{
if (! isset($import['csv_terminated'])) {
@ -280,9 +262,7 @@ final class Import
return (string) $import['csv_terminated'];
}
/**
* @param array<int|string, mixed> $import
*/
/** @param array<int|string, mixed> $import */
private function setCsvEnclosed(array $import): string
{
if (! isset($import['csv_enclosed'])) {
@ -292,9 +272,7 @@ final class Import
return (string) $import['csv_enclosed'];
}
/**
* @param array<int|string, mixed> $import
*/
/** @param array<int|string, mixed> $import */
private function setCsvEscaped(array $import): string
{
if (! isset($import['csv_escaped'])) {
@ -304,9 +282,7 @@ final class Import
return (string) $import['csv_escaped'];
}
/**
* @param array<int|string, mixed> $import
*/
/** @param array<int|string, mixed> $import */
private function setCsvNewLine(array $import): string
{
if (! isset($import['csv_new_line'])) {
@ -316,9 +292,7 @@ final class Import
return (string) $import['csv_new_line'];
}
/**
* @param array<int|string, mixed> $import
*/
/** @param array<int|string, mixed> $import */
private function setCsvColumns(array $import): string
{
if (! isset($import['csv_columns'])) {
@ -328,9 +302,7 @@ final class Import
return (string) $import['csv_columns'];
}
/**
* @param array<int|string, mixed> $import
*/
/** @param array<int|string, mixed> $import */
private function setCsvColNames(array $import): bool
{
if (! isset($import['csv_col_names'])) {
@ -340,9 +312,7 @@ final class Import
return (bool) $import['csv_col_names'];
}
/**
* @param array<int|string, mixed> $import
*/
/** @param array<int|string, mixed> $import */
private function setLdiReplace(array $import): bool
{
if (! isset($import['ldi_replace'])) {
@ -352,9 +322,7 @@ final class Import
return (bool) $import['ldi_replace'];
}
/**
* @param array<int|string, mixed> $import
*/
/** @param array<int|string, mixed> $import */
private function setLdiIgnore(array $import): bool
{
if (! isset($import['ldi_ignore'])) {
@ -364,9 +332,7 @@ final class Import
return (bool) $import['ldi_ignore'];
}
/**
* @param array<int|string, mixed> $import
*/
/** @param array<int|string, mixed> $import */
private function setLdiTerminated(array $import): string
{
if (! isset($import['ldi_terminated'])) {
@ -376,9 +342,7 @@ final class Import
return (string) $import['ldi_terminated'];
}
/**
* @param array<int|string, mixed> $import
*/
/** @param array<int|string, mixed> $import */
private function setLdiEnclosed(array $import): string
{
if (! isset($import['ldi_enclosed'])) {
@ -388,9 +352,7 @@ final class Import
return (string) $import['ldi_enclosed'];
}
/**
* @param array<int|string, mixed> $import
*/
/** @param array<int|string, mixed> $import */
private function setLdiEscaped(array $import): string
{
if (! isset($import['ldi_escaped'])) {
@ -400,9 +362,7 @@ final class Import
return (string) $import['ldi_escaped'];
}
/**
* @param array<int|string, mixed> $import
*/
/** @param array<int|string, mixed> $import */
private function setLdiNewLine(array $import): string
{
if (! isset($import['ldi_new_line'])) {
@ -412,9 +372,7 @@ final class Import
return (string) $import['ldi_new_line'];
}
/**
* @param array<int|string, mixed> $import
*/
/** @param array<int|string, mixed> $import */
private function setLdiColumns(array $import): string
{
if (! isset($import['ldi_columns'])) {
@ -438,9 +396,7 @@ final class Import
return (bool) $import['ldi_local_option'];
}
/**
* @param array<int|string, mixed> $import
*/
/** @param array<int|string, mixed> $import */
private function setOdsColNames(array $import): bool
{
if (! isset($import['ods_col_names'])) {
@ -450,9 +406,7 @@ final class Import
return (bool) $import['ods_col_names'];
}
/**
* @param array<int|string, mixed> $import
*/
/** @param array<int|string, mixed> $import */
private function setOdsEmptyRows(array $import): bool
{
if (! isset($import['ods_empty_rows'])) {
@ -462,9 +416,7 @@ final class Import
return (bool) $import['ods_empty_rows'];
}
/**
* @param array<int|string, mixed> $import
*/
/** @param array<int|string, mixed> $import */
private function setOdsRecognizePercentages(array $import): bool
{
if (! isset($import['ods_recognize_percentages'])) {
@ -474,9 +426,7 @@ final class Import
return (bool) $import['ods_recognize_percentages'];
}
/**
* @param array<int|string, mixed> $import
*/
/** @param array<int|string, mixed> $import */
private function setOdsRecognizeCurrency(array $import): bool
{
if (! isset($import['ods_recognize_currency'])) {

View File

@ -8,9 +8,7 @@ namespace PhpMyAdmin\Config\Settings;
use function in_array;
/**
* @psalm-immutable
*/
/** @psalm-immutable */
final class Schema
{
/**
@ -88,9 +86,7 @@ final class Schema
/** @var bool */
public $svg_all_tables_same_width;
/**
* @param array<int|string, mixed> $schema
*/
/** @param array<int|string, mixed> $schema */
public function __construct(array $schema = [])
{
$this->format = $this->setFormat($schema);
@ -129,9 +125,7 @@ final class Schema
return 'pdf';
}
/**
* @param array<int|string, mixed> $schema
*/
/** @param array<int|string, mixed> $schema */
private function setPdfShowColor(array $schema): bool
{
if (isset($schema['pdf_show_color'])) {
@ -141,9 +135,7 @@ final class Schema
return true;
}
/**
* @param array<int|string, mixed> $schema
*/
/** @param array<int|string, mixed> $schema */
private function setPdfShowKeys(array $schema): bool
{
if (isset($schema['pdf_show_keys'])) {
@ -153,9 +145,7 @@ final class Schema
return false;
}
/**
* @param array<int|string, mixed> $schema
*/
/** @param array<int|string, mixed> $schema */
private function setPdfAllTablesSameWidth(array $schema): bool
{
if (isset($schema['pdf_all_tables_same_width'])) {
@ -179,9 +169,7 @@ final class Schema
return 'L';
}
/**
* @param array<int|string, mixed> $schema
*/
/** @param array<int|string, mixed> $schema */
private function setPdfPaper(array $schema): string
{
if (isset($schema['pdf_paper'])) {
@ -191,9 +179,7 @@ final class Schema
return 'A4';
}
/**
* @param array<int|string, mixed> $schema
*/
/** @param array<int|string, mixed> $schema */
private function setPdfShowGrid(array $schema): bool
{
if (isset($schema['pdf_show_grid'])) {
@ -203,9 +189,7 @@ final class Schema
return false;
}
/**
* @param array<int|string, mixed> $schema
*/
/** @param array<int|string, mixed> $schema */
private function setPdfWithDoc(array $schema): bool
{
if (isset($schema['pdf_with_doc'])) {
@ -231,9 +215,7 @@ final class Schema
return '';
}
/**
* @param array<int|string, mixed> $schema
*/
/** @param array<int|string, mixed> $schema */
private function setDiaShowColor(array $schema): bool
{
if (isset($schema['dia_show_color'])) {
@ -243,9 +225,7 @@ final class Schema
return true;
}
/**
* @param array<int|string, mixed> $schema
*/
/** @param array<int|string, mixed> $schema */
private function setDiaShowKeys(array $schema): bool
{
if (isset($schema['dia_show_keys'])) {
@ -269,9 +249,7 @@ final class Schema
return 'L';
}
/**
* @param array<int|string, mixed> $schema
*/
/** @param array<int|string, mixed> $schema */
private function setDiaPaper(array $schema): string
{
if (isset($schema['dia_paper'])) {
@ -281,9 +259,7 @@ final class Schema
return 'A4';
}
/**
* @param array<int|string, mixed> $schema
*/
/** @param array<int|string, mixed> $schema */
private function setEpsShowColor(array $schema): bool
{
if (isset($schema['eps_show_color'])) {
@ -293,9 +269,7 @@ final class Schema
return true;
}
/**
* @param array<int|string, mixed> $schema
*/
/** @param array<int|string, mixed> $schema */
private function setEpsShowKeys(array $schema): bool
{
if (isset($schema['eps_show_keys'])) {
@ -305,9 +279,7 @@ final class Schema
return false;
}
/**
* @param array<int|string, mixed> $schema
*/
/** @param array<int|string, mixed> $schema */
private function setEpsAllTablesSameWidth(array $schema): bool
{
if (isset($schema['eps_all_tables_same_width'])) {
@ -331,9 +303,7 @@ final class Schema
return 'L';
}
/**
* @param array<int|string, mixed> $schema
*/
/** @param array<int|string, mixed> $schema */
private function setSvgShowColor(array $schema): bool
{
if (isset($schema['svg_show_color'])) {
@ -343,9 +313,7 @@ final class Schema
return true;
}
/**
* @param array<int|string, mixed> $schema
*/
/** @param array<int|string, mixed> $schema */
private function setSvgShowKeys(array $schema): bool
{
if (isset($schema['svg_show_keys'])) {
@ -355,9 +323,7 @@ final class Schema
return false;
}
/**
* @param array<int|string, mixed> $schema
*/
/** @param array<int|string, mixed> $schema */
private function setSvgAllTablesSameWidth(array $schema): bool
{
if (isset($schema['svg_all_tables_same_width'])) {

View File

@ -10,9 +10,7 @@ use function is_array;
// phpcs:disable Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
/**
* @psalm-immutable
*/
/** @psalm-immutable */
final class Server
{
/**
@ -509,9 +507,7 @@ final class Server
*/
public $hide_connection_errors;
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
public function __construct(array $server = [])
{
$this->host = $this->setHost($server);
@ -575,9 +571,7 @@ final class Server
$this->hide_connection_errors = $this->setHideConnectionErrors($server);
}
/**
* @return static
*/
/** @return static */
public function withSSL(bool $ssl): Server
{
$clone = clone $this;
@ -586,9 +580,7 @@ final class Server
return $clone;
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setHost(array $server): string
{
if (isset($server['host'])) {
@ -598,9 +590,7 @@ final class Server
return 'localhost';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setPort(array $server): string
{
if (isset($server['port'])) {
@ -610,9 +600,7 @@ final class Server
return '';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setSocket(array $server): string
{
if (isset($server['socket'])) {
@ -622,9 +610,7 @@ final class Server
return '';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setSsl(array $server): bool
{
if (isset($server['ssl'])) {
@ -634,9 +620,7 @@ final class Server
return false;
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setSslKey(array $server): string|null
{
if (isset($server['ssl_key'])) {
@ -646,9 +630,7 @@ final class Server
return null;
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setSslCert(array $server): string|null
{
if (isset($server['ssl_cert'])) {
@ -658,9 +640,7 @@ final class Server
return null;
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setSslCa(array $server): string|null
{
if (isset($server['ssl_ca'])) {
@ -670,9 +650,7 @@ final class Server
return null;
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setSslCaPath(array $server): string|null
{
if (isset($server['ssl_ca_path'])) {
@ -682,9 +660,7 @@ final class Server
return null;
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setSslCiphers(array $server): string|null
{
if (isset($server['ssl_ciphers'])) {
@ -694,9 +670,7 @@ final class Server
return null;
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setSslVerify(array $server): bool
{
if (isset($server['ssl_verify'])) {
@ -706,9 +680,7 @@ final class Server
return true;
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setCompress(array $server): bool
{
if (isset($server['compress'])) {
@ -718,9 +690,7 @@ final class Server
return false;
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setControlhost(array $server): string
{
if (isset($server['controlhost'])) {
@ -730,9 +700,7 @@ final class Server
return '';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setControlport(array $server): string
{
if (isset($server['controlport'])) {
@ -742,9 +710,7 @@ final class Server
return '';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setControluser(array $server): string
{
if (isset($server['controluser'])) {
@ -754,9 +720,7 @@ final class Server
return '';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setControlpass(array $server): string
{
if (isset($server['controlpass'])) {
@ -780,9 +744,7 @@ final class Server
return 'cookie';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setAuthHttpRealm(array $server): string
{
if (isset($server['auth_http_realm'])) {
@ -792,9 +754,7 @@ final class Server
return '';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setUser(array $server): string
{
if (isset($server['user'])) {
@ -804,9 +764,7 @@ final class Server
return 'root';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setPassword(array $server): string
{
if (isset($server['password'])) {
@ -816,9 +774,7 @@ final class Server
return '';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setSignonSession(array $server): string
{
if (isset($server['SignonSession'])) {
@ -874,9 +830,7 @@ final class Server
return $params;
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setSignonScript(array $server): string
{
if (isset($server['SignonScript'])) {
@ -886,9 +840,7 @@ final class Server
return '';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setSignonUrl(array $server): string
{
if (isset($server['SignonURL'])) {
@ -898,9 +850,7 @@ final class Server
return '';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setLogoutUrl(array $server): string
{
if (isset($server['LogoutURL'])) {
@ -933,9 +883,7 @@ final class Server
return $onlyDb;
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setHideDb(array $server): string
{
if (isset($server['hide_db'])) {
@ -945,9 +893,7 @@ final class Server
return '';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setVerbose(array $server): string
{
if (isset($server['verbose'])) {
@ -957,9 +903,7 @@ final class Server
return '';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setPmadb(array $server): string
{
if (isset($server['pmadb'])) {
@ -969,9 +913,7 @@ final class Server
return '';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setBookmarktable(array $server): false|string
{
if (isset($server['bookmarktable'])) {
@ -981,9 +923,7 @@ final class Server
return '';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setRelation(array $server): false|string
{
if (isset($server['relation'])) {
@ -993,9 +933,7 @@ final class Server
return '';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setTableInfo(array $server): false|string
{
if (isset($server['table_info'])) {
@ -1005,9 +943,7 @@ final class Server
return '';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setTableCoords(array $server): false|string
{
if (isset($server['table_coords'])) {
@ -1017,9 +953,7 @@ final class Server
return '';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setPdfPages(array $server): false|string
{
if (isset($server['pdf_pages'])) {
@ -1029,9 +963,7 @@ final class Server
return '';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setColumnInfo(array $server): false|string
{
if (isset($server['column_info'])) {
@ -1041,9 +973,7 @@ final class Server
return '';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setHistory(array $server): false|string
{
if (isset($server['history'])) {
@ -1053,9 +983,7 @@ final class Server
return '';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setRecent(array $server): false|string
{
if (isset($server['recent'])) {
@ -1065,9 +993,7 @@ final class Server
return '';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setFavorite(array $server): false|string
{
if (isset($server['favorite'])) {
@ -1077,9 +1003,7 @@ final class Server
return '';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setTableUiprefs(array $server): false|string
{
if (isset($server['table_uiprefs'])) {
@ -1089,9 +1013,7 @@ final class Server
return '';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setTracking(array $server): false|string
{
if (isset($server['tracking'])) {
@ -1101,9 +1023,7 @@ final class Server
return '';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setUserconfig(array $server): false|string
{
if (isset($server['userconfig'])) {
@ -1113,9 +1033,7 @@ final class Server
return '';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setUsers(array $server): false|string
{
if (isset($server['users'])) {
@ -1125,9 +1043,7 @@ final class Server
return '';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setUsergroups(array $server): false|string
{
if (isset($server['usergroups'])) {
@ -1137,9 +1053,7 @@ final class Server
return '';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setNavigationhiding(array $server): false|string
{
if (isset($server['navigationhiding'])) {
@ -1151,9 +1065,7 @@ final class Server
return '';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setSavedsearches(array $server): false|string
{
if (isset($server['savedsearches'])) {
@ -1163,9 +1075,7 @@ final class Server
return '';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setCentralColumns(array $server): false|string
{
if (isset($server['central_columns'])) {
@ -1175,9 +1085,7 @@ final class Server
return '';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setDesignerSettings(array $server): false|string
{
if (isset($server['designer_settings'])) {
@ -1189,9 +1097,7 @@ final class Server
return '';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setExportTemplates(array $server): false|string
{
if (isset($server['export_templates'])) {
@ -1220,9 +1126,7 @@ final class Server
return 100;
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setSessionTimeZone(array $server): string
{
if (isset($server['SessionTimeZone'])) {
@ -1232,9 +1136,7 @@ final class Server
return '';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setAllowRoot(array $server): bool
{
if (isset($server['AllowRoot'])) {
@ -1244,9 +1146,7 @@ final class Server
return true;
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setAllowNoPassword(array $server): bool
{
if (isset($server['AllowNoPassword'])) {
@ -1284,9 +1184,7 @@ final class Server
return $allowDeny;
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setDisableIs(array $server): bool
{
if (isset($server['DisableIS'])) {
@ -1296,9 +1194,7 @@ final class Server
return false;
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setTrackingVersionAutoCreate(array $server): bool
{
if (isset($server['tracking_version_auto_create'])) {
@ -1308,9 +1204,7 @@ final class Server
return false;
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setTrackingDefaultStatements(array $server): string
{
if (isset($server['tracking_default_statements'])) {
@ -1321,9 +1215,7 @@ final class Server
. 'TRUNCATE,REPLACE,CREATE VIEW,ALTER VIEW,DROP VIEW,CREATE DATABASE,ALTER DATABASE,DROP DATABASE';
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setTrackingAddDropView(array $server): bool
{
if (isset($server['tracking_add_drop_view'])) {
@ -1333,9 +1225,7 @@ final class Server
return true;
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setTrackingAddDropTable(array $server): bool
{
if (isset($server['tracking_add_drop_table'])) {
@ -1345,9 +1235,7 @@ final class Server
return true;
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setTrackingAddDropDatabase(array $server): bool
{
if (isset($server['tracking_add_drop_database'])) {
@ -1357,9 +1245,7 @@ final class Server
return true;
}
/**
* @param array<int|string, mixed> $server
*/
/** @param array<int|string, mixed> $server */
private function setHideConnectionErrors(array $server): bool
{
if (isset($server['hide_connection_errors'])) {

View File

@ -6,9 +6,7 @@ namespace PhpMyAdmin\Config\Settings;
// phpcs:disable Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
/**
* @psalm-immutable
*/
/** @psalm-immutable */
final class SqlQueryBox
{
/**
@ -39,9 +37,7 @@ final class SqlQueryBox
*/
public $Refresh;
/**
* @param mixed[] $sqlQueryBox
*/
/** @param mixed[] $sqlQueryBox */
public function __construct(array $sqlQueryBox = [])
{
$this->Edit = $this->setEdit($sqlQueryBox);
@ -50,33 +46,25 @@ final class SqlQueryBox
$this->Refresh = $this->setRefresh($sqlQueryBox);
}
/**
* @param mixed[] $sqlQueryBox
*/
/** @param mixed[] $sqlQueryBox */
private function setEdit(array $sqlQueryBox): bool
{
return ! isset($sqlQueryBox['Edit']) || $sqlQueryBox['Edit'];
}
/**
* @param mixed[] $sqlQueryBox
*/
/** @param mixed[] $sqlQueryBox */
private function setExplain(array $sqlQueryBox): bool
{
return ! isset($sqlQueryBox['Explain']) || $sqlQueryBox['Explain'];
}
/**
* @param mixed[] $sqlQueryBox
*/
/** @param mixed[] $sqlQueryBox */
private function setShowAsPHP(array $sqlQueryBox): bool
{
return ! isset($sqlQueryBox['ShowAsPHP']) || $sqlQueryBox['ShowAsPHP'];
}
/**
* @param mixed[] $sqlQueryBox
*/
/** @param mixed[] $sqlQueryBox */
private function setRefresh(array $sqlQueryBox): bool
{
return ! isset($sqlQueryBox['Refresh']) || $sqlQueryBox['Refresh'];

View File

@ -8,9 +8,7 @@ use function is_array;
// phpcs:disable Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
/**
* @psalm-immutable
*/
/** @psalm-immutable */
final class Transformations
{
/**
@ -116,9 +114,7 @@ final class Transformations
*/
public $TextLink;
/**
* @param array<int|string, mixed> $transformations
*/
/** @param array<int|string, mixed> $transformations */
public function __construct(array $transformations = [])
{
$this->Substring = $this->setSubstring($transformations);

View File

@ -7,9 +7,7 @@ namespace PhpMyAdmin\ConfigStorage\Features;
use PhpMyAdmin\Dbal\DatabaseName;
use PhpMyAdmin\Dbal\TableName;
/**
* @psalm-immutable
*/
/** @psalm-immutable */
final class BookmarkFeature
{
/** @var DatabaseName */

View File

@ -7,9 +7,7 @@ namespace PhpMyAdmin\ConfigStorage\Features;
use PhpMyAdmin\Dbal\DatabaseName;
use PhpMyAdmin\Dbal\TableName;
/**
* @psalm-immutable
*/
/** @psalm-immutable */
final class BrowserTransformationFeature
{
/** @var DatabaseName */

View File

@ -7,9 +7,7 @@ namespace PhpMyAdmin\ConfigStorage\Features;
use PhpMyAdmin\Dbal\DatabaseName;
use PhpMyAdmin\Dbal\TableName;
/**
* @psalm-immutable
*/
/** @psalm-immutable */
final class CentralColumnsFeature
{
/** @var DatabaseName */

View File

@ -7,9 +7,7 @@ namespace PhpMyAdmin\ConfigStorage\Features;
use PhpMyAdmin\Dbal\DatabaseName;
use PhpMyAdmin\Dbal\TableName;
/**
* @psalm-immutable
*/
/** @psalm-immutable */
final class ColumnCommentsFeature
{
/** @var DatabaseName */

View File

@ -7,9 +7,7 @@ namespace PhpMyAdmin\ConfigStorage\Features;
use PhpMyAdmin\Dbal\DatabaseName;
use PhpMyAdmin\Dbal\TableName;
/**
* @psalm-immutable
*/
/** @psalm-immutable */
final class ConfigurableMenusFeature
{
/** @var DatabaseName */

View File

@ -7,9 +7,7 @@ namespace PhpMyAdmin\ConfigStorage\Features;
use PhpMyAdmin\Dbal\DatabaseName;
use PhpMyAdmin\Dbal\TableName;
/**
* @psalm-immutable
*/
/** @psalm-immutable */
final class DatabaseDesignerSettingsFeature
{
/** @var DatabaseName */

View File

@ -7,9 +7,7 @@ namespace PhpMyAdmin\ConfigStorage\Features;
use PhpMyAdmin\Dbal\DatabaseName;
use PhpMyAdmin\Dbal\TableName;
/**
* @psalm-immutable
*/
/** @psalm-immutable */
final class DisplayFeature
{
/** @var DatabaseName */

View File

@ -7,9 +7,7 @@ namespace PhpMyAdmin\ConfigStorage\Features;
use PhpMyAdmin\Dbal\DatabaseName;
use PhpMyAdmin\Dbal\TableName;
/**
* @psalm-immutable
*/
/** @psalm-immutable */
final class ExportTemplatesFeature
{
/** @var DatabaseName */

View File

@ -7,9 +7,7 @@ namespace PhpMyAdmin\ConfigStorage\Features;
use PhpMyAdmin\Dbal\DatabaseName;
use PhpMyAdmin\Dbal\TableName;
/**
* @psalm-immutable
*/
/** @psalm-immutable */
final class FavoriteTablesFeature
{
/** @var DatabaseName */

View File

@ -7,9 +7,7 @@ namespace PhpMyAdmin\ConfigStorage\Features;
use PhpMyAdmin\Dbal\DatabaseName;
use PhpMyAdmin\Dbal\TableName;
/**
* @psalm-immutable
*/
/** @psalm-immutable */
final class NavigationItemsHidingFeature
{
/** @var DatabaseName */

View File

@ -7,9 +7,7 @@ namespace PhpMyAdmin\ConfigStorage\Features;
use PhpMyAdmin\Dbal\DatabaseName;
use PhpMyAdmin\Dbal\TableName;
/**
* @psalm-immutable
*/
/** @psalm-immutable */
final class PdfFeature
{
/** @var DatabaseName */

View File

@ -7,9 +7,7 @@ namespace PhpMyAdmin\ConfigStorage\Features;
use PhpMyAdmin\Dbal\DatabaseName;
use PhpMyAdmin\Dbal\TableName;
/**
* @psalm-immutable
*/
/** @psalm-immutable */
final class RecentlyUsedTablesFeature
{
/** @var DatabaseName */

View File

@ -7,9 +7,7 @@ namespace PhpMyAdmin\ConfigStorage\Features;
use PhpMyAdmin\Dbal\DatabaseName;
use PhpMyAdmin\Dbal\TableName;
/**
* @psalm-immutable
*/
/** @psalm-immutable */
final class RelationFeature
{
/** @var DatabaseName */

View File

@ -7,9 +7,7 @@ namespace PhpMyAdmin\ConfigStorage\Features;
use PhpMyAdmin\Dbal\DatabaseName;
use PhpMyAdmin\Dbal\TableName;
/**
* @psalm-immutable
*/
/** @psalm-immutable */
final class SavedQueryByExampleSearchesFeature
{
/** @var DatabaseName */

View File

@ -7,9 +7,7 @@ namespace PhpMyAdmin\ConfigStorage\Features;
use PhpMyAdmin\Dbal\DatabaseName;
use PhpMyAdmin\Dbal\TableName;
/**
* @psalm-immutable
*/
/** @psalm-immutable */
final class SqlHistoryFeature
{
/** @var DatabaseName */

View File

@ -7,9 +7,7 @@ namespace PhpMyAdmin\ConfigStorage\Features;
use PhpMyAdmin\Dbal\DatabaseName;
use PhpMyAdmin\Dbal\TableName;
/**
* @psalm-immutable
*/
/** @psalm-immutable */
final class TrackingFeature
{
/** @var DatabaseName */

View File

@ -7,9 +7,7 @@ namespace PhpMyAdmin\ConfigStorage\Features;
use PhpMyAdmin\Dbal\DatabaseName;
use PhpMyAdmin\Dbal\TableName;
/**
* @psalm-immutable
*/
/** @psalm-immutable */
final class UiPreferencesFeature
{
/** @var DatabaseName */

View File

@ -7,9 +7,7 @@ namespace PhpMyAdmin\ConfigStorage\Features;
use PhpMyAdmin\Dbal\DatabaseName;
use PhpMyAdmin\Dbal\TableName;
/**
* @psalm-immutable
*/
/** @psalm-immutable */
final class UserPreferencesFeature
{
/** @var DatabaseName */

View File

@ -18,9 +18,7 @@ class RelationCleanup
/** @var Relation */
public $relation;
/**
* @param DatabaseInterface $dbi
*/
/** @param DatabaseInterface $dbi */
public function __construct(public $dbi, Relation $relation)
{
$this->relation = $relation;

View File

@ -29,14 +29,10 @@ use PhpMyAdmin\Version;
use function is_string;
/**
* @psalm-immutable
*/
/** @psalm-immutable */
final class RelationParameters
{
/**
* @param non-empty-string|null $user
*/
/** @param non-empty-string|null $user */
public function __construct(
public readonly string|null $user,
public readonly DatabaseName|null $db = null,
@ -61,9 +57,7 @@ final class RelationParameters
) {
}
/**
* @param mixed[] $params
*/
/** @param mixed[] $params */
public static function fromArray(array $params): self
{
$user = null;

View File

@ -163,9 +163,7 @@ class UserGroups
return implode(', ', $tabNames);
}
/**
* @param non-empty-string $userGroupName
*/
/** @param non-empty-string $userGroupName */
public static function delete(
DatabaseInterface $dbi,
ConfigurableMenusFeature $configurableMenusFeature,

View File

@ -22,17 +22,13 @@ abstract class AbstractController
{
}
/**
* @param array<string, mixed> $templateData
*/
/** @param array<string, mixed> $templateData */
protected function render(string $templatePath, array $templateData = []): void
{
$this->response->addHTML($this->template->render($templatePath, $templateData));
}
/**
* @param string[] $files
*/
/** @param string[] $files */
protected function addScriptFiles(array $files): void
{
$header = $this->response->getHeader();
@ -88,9 +84,7 @@ abstract class AbstractController
return $GLOBALS['is_db'];
}
/**
* @param array<string, mixed> $params
*/
/** @param array<string, mixed> $params */
protected function redirect(string $route, array $params = []): void
{
if (defined('TESTSUITE')) {
@ -146,9 +140,7 @@ abstract class AbstractController
}
}
/**
* @psalm-param int<400,599> $statusCode
*/
/** @psalm-param int<400,599> $statusCode */
protected function sendErrorResponse(string $message, int $statusCode = 400): void
{
$this->response->setHttpResponseCode($statusCode);

View File

@ -148,9 +148,7 @@ class CentralColumnsController extends AbstractController
$GLOBALS['message'] = $tmp_msg;
}
/**
* @param array $params Request parameters
*/
/** @param array $params Request parameters */
public function main(array $params): void
{
$GLOBALS['text_dir'] ??= null;
@ -252,9 +250,7 @@ class CentralColumnsController extends AbstractController
);
}
/**
* @param array $params Request parameters
*/
/** @param array $params Request parameters */
public function editPage(array $params): void
{
$rows = $this->centralColumns->getHtmlForEditingPage($params['selected_fld'], $params['db']);

View File

@ -198,9 +198,7 @@ class StructureController extends AbstractController
]);
}
/**
* @param array $replicaInfo
*/
/** @param array $replicaInfo */
protected function displayTableList($replicaInfo): string
{
$html = '';

View File

@ -561,9 +561,7 @@ final class ImportController extends AbstractController
$queriesToBeExecuted = [];
if (! $GLOBALS['error']) {
/**
* @var ImportPlugin $import_plugin
*/
/** @var ImportPlugin $import_plugin */
$import_plugin = Plugins::getPlugin('import', $GLOBALS['format'], $GLOBALS['import_type']);
if ($import_plugin == null) {
$GLOBALS['message'] = Message::error(

View File

@ -47,9 +47,7 @@ final class JavaScriptMessagesController
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 3600) . ' GMT');
}
/**
* @return array<string, string>
*/
/** @return array<string, string> */
private function setMessages(): array
{
return [

View File

@ -21,6 +21,7 @@ final class AccountLockController extends AbstractController
public function __construct(ResponseRenderer $response, Template $template, AccountLocking $accountLocking)
{
parent::__construct($response, $template);
$this->model = $accountLocking;
}

View File

@ -21,6 +21,7 @@ final class AccountUnlockController extends AbstractController
public function __construct(ResponseRenderer $response, Template $template, AccountLocking $accountLocking)
{
parent::__construct($response, $template);
$this->model = $accountLocking;
}

View File

@ -25,9 +25,7 @@ final class KillController extends AbstractController
parent::__construct($response, $template, $data);
}
/**
* @param array $params Request parameters
*/
/** @param array $params Request parameters */
public function __invoke(ServerRequest $request, array $params): void
{
if (! $this->response->isAjax()) {

View File

@ -102,9 +102,7 @@ class StatusController extends AbstractController
return (int) $this->dbi->fetchValue('SELECT UNIX_TIMESTAMP() - ' . $this->data->status['Uptime']);
}
/**
* @return array
*/
/** @return array */
private function getTrafficInfo(): array
{
$hourFactor = 3600 / $this->data->status['Uptime'];
@ -149,9 +147,7 @@ class StatusController extends AbstractController
];
}
/**
* @return array
*/
/** @return array */
private function getConnectionsInfo(): array
{
$hourFactor = 3600 / $this->data->status['Uptime'];

View File

@ -160,9 +160,7 @@ class VariablesController extends AbstractController
$this->dbi->query('FLUSH ' . $flush . ';');
}
/**
* @return array
*/
/** @return array */
private function getAlerts(): array
{
// name => max value before alert

View File

@ -22,9 +22,7 @@ final class GetVariableController extends AbstractController
parent::__construct($response, $template);
}
/**
* @param array $params Request parameters
*/
/** @param array $params Request parameters */
public function __invoke(ServerRequest $request, array $params): void
{
if (! $this->response->isAjax()) {

View File

@ -17,9 +17,7 @@ abstract class AbstractController
{
}
/**
* @return array
*/
/** @return array */
protected function getPages(): array
{
$ignored = [

View File

@ -52,9 +52,7 @@ class ServersController extends AbstractController
]);
}
/**
* @param array $params Request parameters
*/
/** @param array $params Request parameters */
public function destroy(array $params): void
{
$id = isset($params['id']) && is_numeric($params['id']) && (int) $params['id'] >= 1 ? (int) $params['id'] : 0;

View File

@ -216,9 +216,7 @@ class SqlController extends AbstractController
));
}
/**
* @param array<string> $bkm_fields
*/
/** @param array<string> $bkm_fields */
private function addBookmark(string $goto, array $bkm_fields, bool $bkm_all_users): void
{
$bookmark = Bookmark::createBookmark(

View File

@ -179,9 +179,7 @@ class ChartController extends AbstractController
}
$parser = new Parser($GLOBALS['sql_query']);
/**
* @var SelectStatement $statement
*/
/** @var SelectStatement $statement */
$statement = $parser->statements[0];
if (empty($statement->limit)) {
$statement->limit = new Limit($_REQUEST['session_max_rows'], $_REQUEST['pos']);

View File

@ -29,6 +29,7 @@ final class AnalyzeController extends AbstractController
Maintenance $maintenance,
) {
parent::__construct($response, $template);
$this->model = $maintenance;
}

View File

@ -29,6 +29,7 @@ final class CheckController extends AbstractController
Maintenance $maintenance,
) {
parent::__construct($response, $template);
$this->model = $maintenance;
}

View File

@ -29,6 +29,7 @@ final class DropController extends AbstractController
Maintenance $maintenance,
) {
parent::__construct($response, $template);
$this->model = $maintenance;
}

View File

@ -29,6 +29,7 @@ final class OptimizeController extends AbstractController
Maintenance $maintenance,
) {
parent::__construct($response, $template);
$this->model = $maintenance;
}

View File

@ -29,6 +29,7 @@ final class RebuildController extends AbstractController
Maintenance $maintenance,
) {
parent::__construct($response, $template);
$this->model = $maintenance;
}

View File

@ -29,6 +29,7 @@ final class RepairController extends AbstractController
Maintenance $maintenance,
) {
parent::__construct($response, $template);
$this->model = $maintenance;
}

View File

@ -29,6 +29,7 @@ final class TruncateController extends AbstractController
Maintenance $maintenance,
) {
parent::__construct($response, $template);
$this->model = $maintenance;
}

View File

@ -398,9 +398,7 @@ final class ReplaceController extends AbstractController
$this->moveBackToCallingScript($gotoInclude, $request);
}
/**
* @param string[][] $mimeMap
*/
/** @param string[][] $mimeMap */
private function doTransformations(array $mimeMap): void
{
if (isset($_POST['rel_fields_list']) && $_POST['rel_fields_list'] != '') {

View File

@ -57,9 +57,7 @@ final class ChangeController extends AbstractController
{
$GLOBALS['num_fields'] ??= null;
/**
* @todo optimize in case of multiple fields to modify
*/
/** @todo optimize in case of multiple fields to modify */
$fields_meta = [];
foreach ($selected as $column) {
$value = $this->dbi->getColumn($GLOBALS['db'], $GLOBALS['table'], $column, true);

View File

@ -34,6 +34,7 @@ final class MoveColumnsController extends AbstractController
private DatabaseInterface $dbi,
) {
parent::__construct($response, $template);
$this->tableObj = $this->dbi->getTable($GLOBALS['db'], $GLOBALS['table']);
}

View File

@ -88,9 +88,7 @@ final class PartitioningController extends AbstractController
}
$parser = new Parser($createTable);
/**
* @var CreateStatement $stmt
*/
/** @var CreateStatement $stmt */
$stmt = $parser->statements[0];
$partitionDetails = [];

View File

@ -283,9 +283,7 @@ final class TrackingController extends AbstractController
return in_array($param, ['schema', 'data'], true) ? $param : 'schema_and_data';
}
/**
* @param mixed $param
*/
/** @param mixed $param */
private function validateDateTimeParam($param): DateTimeImmutable
{
try {

View File

@ -179,9 +179,7 @@ class WrapperController extends AbstractController
}
}
/**
* @param mixed $size
*/
/** @param mixed $size */
private function formatSize($size): int
{
if (! is_numeric($size) || $size < 2) {

View File

@ -160,9 +160,7 @@ class CreateController extends AbstractController
// MySQL 8.0+ - issue #16194
if (empty($viewData['as'])) {
$parser = new Parser($createView);
/**
* @var CreateStatement $stmt
*/
/** @var CreateStatement $stmt */
$stmt = $parser->statements[0];
$viewData['as'] = isset($stmt->body) ? TokensList::build($stmt->body) : $viewData['as'];
}

View File

@ -332,9 +332,7 @@ class Core
return $headers;
}
/**
* @return array<string, string>
*/
/** @return array<string, string> */
public static function getNoCacheHeaders(): array
{
$headers = [];
@ -626,9 +624,7 @@ class Core
$empty = true;
array_walk_recursive(
$value,
/**
* @param mixed $item
*/
/** @param mixed $item */
static function ($item) use (&$empty): void {
$empty = $empty && empty($item);
},

View File

@ -863,9 +863,7 @@ class CentralColumns
return -1;
}
/**
* @return string[]
*/
/** @return string[] */
public function getColumnsNotInCentralList(string $db, string $table): array
{
$existingColumns = $this->getFromTable($db, $table);

View File

@ -62,9 +62,7 @@ class Events
'MINUTE_SECOND',
];
/**
* @param ResponseRenderer $response
*/
/** @param ResponseRenderer $response */
public function __construct(private DatabaseInterface $dbi, private Template $template, private $response)
{
}

View File

@ -57,9 +57,7 @@ class Routines
/** @var array<int, string> */
private $numericOptions = ['UNSIGNED', 'ZEROFILL', 'UNSIGNED ZEROFILL'];
/**
* @param ResponseRenderer $response
*/
/** @param ResponseRenderer $response */
public function __construct(private DatabaseInterface $dbi, private Template $template, private $response)
{
}
@ -571,9 +569,7 @@ class Routines
$parser = new Parser($definition);
/**
* @var CreateStatement $stmt
*/
/** @var CreateStatement $stmt */
$stmt = $parser->statements[0];
// Do not use $routine['ROUTINE_DEFINITION'] because of a MySQL escaping issue: #15370
@ -1473,9 +1469,7 @@ class Routines
if ($definition !== null) {
$parser = new Parser($definition);
/**
* @var CreateStatement $stmt
*/
/** @var CreateStatement $stmt */
$stmt = $parser->statements[0];
$params = Routine::getParameters($stmt);

View File

@ -81,9 +81,7 @@ class Search
/** @var Template */
public $template;
/**
* @param string $db Database name
*/
/** @param string $db Database name */
public function __construct(private DatabaseInterface $dbi, $db, Template $template)
{
$this->db = $db;

View File

@ -37,9 +37,7 @@ class Triggers
/** @var array<int, string> */
private $event = ['INSERT', 'UPDATE', 'DELETE'];
/**
* @param ResponseRenderer $response
*/
/** @param ResponseRenderer $response */
public function __construct(private DatabaseInterface $dbi, private Template $template, private $response)
{
}

View File

@ -79,14 +79,17 @@ class DatabaseInterface implements DbalInterface
* Force STORE_RESULT method, ignored by classic MySQL.
*/
public const QUERY_BUFFERED = 0;
/**
* Do not read all rows immediately.
*/
public const QUERY_UNBUFFERED = 2;
/**
* Get session variable.
*/
public const GETVAR_SESSION = 1;
/**
* Get global variable.
*/
@ -133,9 +136,7 @@ class DatabaseInterface implements DbalInterface
/** @var ListDatabase|null */
private $databaseList = null;
/**
* @param DbiExtension $ext Object to be used for database queries
*/
/** @param DbiExtension $ext Object to be used for database queries */
public function __construct(DbiExtension $ext)
{
$this->extension = $ext;
@ -1506,9 +1507,7 @@ class DatabaseInterface implements DbalInterface
return isset($this->connections[Connection::TYPE_USER]);
}
/**
* @return string[]
*/
/** @return string[] */
private function getCurrentUserGrants(): array
{
/** @var string[] $grants */

View File

@ -12,8 +12,10 @@ final class Connection
{
/** User connection. */
public const TYPE_USER = 0;
/** Control user connection. */
public const TYPE_CONTROL = 1;
/** Auxiliary connection. Used for example for replication setup. */
public const TYPE_AUXILIARY = 2;

View File

@ -8,9 +8,7 @@ use Stringable;
use Webmozart\Assert\Assert;
use Webmozart\Assert\InvalidArgumentException;
/**
* @psalm-immutable
*/
/** @psalm-immutable */
final class DatabaseName implements Stringable
{
/**
@ -63,9 +61,7 @@ final class DatabaseName implements Stringable
return new self($name);
}
/**
* @param mixed $name
*/
/** @param mixed $name */
public static function tryFromValue($name): self|null
{
try {
@ -75,17 +71,13 @@ final class DatabaseName implements Stringable
}
}
/**
* @psalm-return non-empty-string
*/
/** @psalm-return non-empty-string */
public function getName(): string
{
return $this->name;
}
/**
* @psalm-return non-empty-string
*/
/** @psalm-return non-empty-string */
public function __toString(): string
{
return $this->name;

View File

@ -14,9 +14,7 @@ class InvalidDatabaseName extends InvalidIdentifierName
return new self(__('The database name must be a non-empty string.'));
}
/**
* @psalm-param positive-int $length
*/
/** @psalm-param positive-int $length */
public static function fromLongName(int $length): self
{
return new self(sprintf(__('The database name cannot be longer than %d characters.'), $length));

View File

@ -14,9 +14,7 @@ class InvalidTableName extends InvalidIdentifierName
return new self(__('The table name must be a non-empty string.'));
}
/**
* @psalm-param positive-int $length
*/
/** @psalm-param positive-int $length */
public static function fromLongName(int $length): self
{
return new self(sprintf(__('The table name cannot be longer than %d characters.'), $length));

View File

@ -31,9 +31,7 @@ final class MysqliResult implements ResultInterface
*/
private mysqli_result|null $result;
/**
* @param mysqli_result|bool $result
*/
/** @param mysqli_result|bool $result */
public function __construct($result)
{
$this->result = is_bool($result) ? null : $result;

View File

@ -8,9 +8,7 @@ use Stringable;
use Webmozart\Assert\Assert;
use Webmozart\Assert\InvalidArgumentException;
/**
* @psalm-immutable
*/
/** @psalm-immutable */
final class TableName implements Stringable
{
/**
@ -63,9 +61,7 @@ final class TableName implements Stringable
return new self($name);
}
/**
* @param mixed $name
*/
/** @param mixed $name */
public static function tryFromValue($name): self|null
{
try {
@ -75,17 +71,13 @@ final class TableName implements Stringable
}
}
/**
* @psalm-return non-empty-string
*/
/** @psalm-return non-empty-string */
public function getName(): string
{
return $this->name;
}
/**
* @psalm-return non-empty-string
*/
/** @psalm-return non-empty-string */
public function __toString(): string
{
return $this->name;

View File

@ -40,9 +40,7 @@ final class Warning implements Stringable
$this->message = $message;
}
/**
* @param mixed[] $row
*/
/** @param mixed[] $row */
public static function fromArray(array $row): self
{
$level = '';
@ -64,9 +62,7 @@ final class Warning implements Stringable
return new self($level, $code, $message);
}
/**
* @psalm-return non-empty-string
*/
/** @psalm-return non-empty-string */
public function __toString(): string
{
return $this->level . ': #' . $this->code . ($this->message !== '' ? ' ' . $this->message : '');

View File

@ -4,9 +4,7 @@ declare(strict_types=1);
namespace PhpMyAdmin\Display;
/**
* @psalm-immutable
*/
/** @psalm-immutable */
final class DisplayParts
{
public const NO_DELETE = 0;
@ -37,9 +35,7 @@ final class DisplayParts
/** @var bool */
public $hasPrintLink;
/**
* @psalm-param self::NO_DELETE|self::DELETE_ROW|self::KILL_PROCESS $deleteLink
*/
/** @psalm-param self::NO_DELETE|self::DELETE_ROW|self::KILL_PROCESS $deleteLink */
private function __construct(
bool $hasEditLink,
int $deleteLink,

View File

@ -4,9 +4,7 @@ declare(strict_types=1);
namespace PhpMyAdmin;
/**
* @psalm-immutable
*/
/** @psalm-immutable */
final class EditField
{
/** @var string $columnName */

View File

@ -133,6 +133,7 @@ class Error extends Message
public function __construct(int $errno, string $errstr, string $errfile, int $errline)
{
parent::__construct();
$this->setNumber($errno);
$this->setMessage($errstr, false);
$this->setFile($errfile);

Some files were not shown because too many files have changed in this diff Show More