diff --git a/libraries/classes/Plugins/Schema/Dia/DiaRelationSchema.php b/libraries/classes/Plugins/Schema/Dia/DiaRelationSchema.php index 3ea05f109b..ff73ba3635 100644 --- a/libraries/classes/Plugins/Schema/Dia/DiaRelationSchema.php +++ b/libraries/classes/Plugins/Schema/Dia/DiaRelationSchema.php @@ -24,7 +24,7 @@ use function in_array; * inherits ExportRelationSchema class has common functionality added * to this class * - * @property Dia $diagram + * @extends ExportRelationSchema */ class DiaRelationSchema extends ExportRelationSchema { diff --git a/libraries/classes/Plugins/Schema/Eps/EpsRelationSchema.php b/libraries/classes/Plugins/Schema/Eps/EpsRelationSchema.php index 2366a0bc7e..72b55fba05 100644 --- a/libraries/classes/Plugins/Schema/Eps/EpsRelationSchema.php +++ b/libraries/classes/Plugins/Schema/Eps/EpsRelationSchema.php @@ -27,7 +27,7 @@ use function sprintf; * This class inherits ExportRelationSchema class has common functionality added * to this class * - * @property Eps $diagram + * @extends ExportRelationSchema */ class EpsRelationSchema extends ExportRelationSchema { diff --git a/libraries/classes/Plugins/Schema/ExportRelationSchema.php b/libraries/classes/Plugins/Schema/ExportRelationSchema.php index 3f6d5250f1..af6bb690e2 100644 --- a/libraries/classes/Plugins/Schema/ExportRelationSchema.php +++ b/libraries/classes/Plugins/Schema/ExportRelationSchema.php @@ -21,12 +21,11 @@ use function rawurldecode; * This class is inherited by all schema classes * It contains those methods which are common in them * it works like factory pattern + * + * @template T */ class ExportRelationSchema { - /** @var Dia\Dia|Eps\Eps|Pdf\Pdf|Svg\Svg|null */ - protected $diagram; - /** @var bool */ protected $showColor = false; @@ -54,11 +53,10 @@ class ExportRelationSchema protected Relation $relation; /** - * @param Pdf\Pdf|Svg\Svg|Eps\Eps|Dia\Dia|null $diagram schema diagram + * @param T $diagram */ - public function __construct(protected DatabaseName $db, $diagram) + public function __construct(protected DatabaseName $db, protected $diagram) { - $this->diagram = $diagram; $this->setPageNumber((int) $_REQUEST['page_number']); $this->setOffline(isset($_REQUEST['offline_export'])); $this->relation = new Relation($GLOBALS['dbi']); diff --git a/libraries/classes/Plugins/Schema/Pdf/PdfRelationSchema.php b/libraries/classes/Plugins/Schema/Pdf/PdfRelationSchema.php index f684440783..8b7ca8fe82 100644 --- a/libraries/classes/Plugins/Schema/Pdf/PdfRelationSchema.php +++ b/libraries/classes/Plugins/Schema/Pdf/PdfRelationSchema.php @@ -45,7 +45,7 @@ if (getcwd() == __DIR__) { * This class inherits ExportRelationSchema class has common functionality added * to this class * - * @property Pdf $diagram + * @extends ExportRelationSchema */ class PdfRelationSchema extends ExportRelationSchema { diff --git a/libraries/classes/Plugins/Schema/Svg/SvgRelationSchema.php b/libraries/classes/Plugins/Schema/Svg/SvgRelationSchema.php index 3daf66ca08..d7f3324a7b 100644 --- a/libraries/classes/Plugins/Schema/Svg/SvgRelationSchema.php +++ b/libraries/classes/Plugins/Schema/Svg/SvgRelationSchema.php @@ -32,7 +32,7 @@ use function sprintf; * inherits ExportRelationSchema class has common functionality added * to this class * - * @property Svg $diagram + * @extends ExportRelationSchema */ class SvgRelationSchema extends ExportRelationSchema { diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 701c3ad26a..b8a70c0089 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -36,9 +36,6 @@ 4 - - 4 - 4 diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index f9a0d965b4..82ae107634 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -7006,7 +7006,7 @@ parameters: path: libraries/classes/Plugins/Schema/Pdf/PdfRelationSchema.php - - message: "#^Property PhpMyAdmin\\\\Plugins\\\\Schema\\\\ExportRelationSchema\\:\\:\\$orientation \\(string\\) in isset\\(\\) is not nullable\\.$#" + message: "#^Property PhpMyAdmin\\\\Plugins\\\\Schema\\\\ExportRelationSchema\\\\:\\:\\$orientation \\(string\\) in isset\\(\\) is not nullable\\.$#" count: 1 path: libraries/classes/Plugins/Schema/Pdf/PdfRelationSchema.php diff --git a/psalm-baseline.xml b/psalm-baseline.xml index fedc6dcd8f..e6d692720f 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -12548,17 +12548,10 @@ $one_key $rel - - diagram]]> - - - endDiaDoc - startDiaDoc - $bottomMargin $leftMargin @@ -12605,7 +12598,6 @@ tables[$foreignTable]]]> tables[$masterTable]]]> - 10 tables[$foreignTable]]]> @@ -12617,12 +12609,6 @@ - diagram->getFont()]]> - diagram->getFont()]]> - diagram->getFont()]]> - diagram->getFontSize()]]> - diagram->getFontSize()]]> - diagram->getFontSize()]]> $master_field @@ -12646,26 +12632,9 @@ $one_key $rel - - diagram]]> - - - endEpsDoc - getFont - getFont - getFont - getFontSize - getFontSize - getFontSize - setAuthor - setDate - setFont - setOrientation - setTitle - @@ -12828,15 +12797,9 @@ $table $table $table - diagram->PageNo()]]> - diagram->customLinks['RT']['-']]]> diagram->customLinks['RT']['-']]]> diagram->customLinks['doc'][$table][$field_name]]]> diagram->customLinks['doc'][$table]['-']]]> - xMax - $this->xMin) / $innerWidth, - ($this->yMax - $this->yMin) / $innerHeight - ) * 100]]> $master_field @@ -12896,8 +12859,6 @@ $field_name $foreignTable $index - $innerHeight - $innerWidth $links[0] $links[6] $one_field @@ -12915,15 +12876,9 @@ - $innerHeight - $innerWidth $show_comment $table $table - xMax - $this->xMin) / $innerWidth, - ($this->yMax - $this->yMin) / $innerHeight - )]]> null @@ -12932,7 +12887,6 @@ - diagram]]> @@ -12940,38 +12894,8 @@ - diagram->customLinks['RT']['-']]]> orientation]]> - - diagram->customLinks['RT']]]> - diagram->customLinks['RT']['-']]]> - - - diagram->customLinks]]> - - - AddPage - Bookmark - Open - PageNo - getPageHeight - getPageWidth - setAlias - setAutoPageBreak - setAutoPageBreak - setAutoPageBreak - setCMargin - setCMargin - setCMargin - setFontSize - setFontSizeScale - setLineWidthScale - setLink - setOffline - setScale - setTitle - @@ -13197,12 +13121,6 @@ - diagram->getFont()]]> - diagram->getFont()]]> - diagram->getFont()]]> - diagram->getFontSize()]]> - diagram->getFontSize()]]> - diagram->getFontSize()]]> $master_field @@ -13227,29 +13145,13 @@ $rel - diagram]]> tables[$table]]]> xMax + $border]]> xMin - $border]]> yMax + $border]]> yMin - $border]]> - - endSvgDoc - getFont - getFont - getFont - getFontSize - getFontSize - getFontSize - setAuthor - setFont - setFontSize - setTitle - startSvgDoc - - setFont tableDraw tableDraw diff --git a/test/classes/Plugins/Schema/ExportRelationSchemaTest.php b/test/classes/Plugins/Schema/ExportRelationSchemaTest.php index d3a4013cae..3197ce5940 100644 --- a/test/classes/Plugins/Schema/ExportRelationSchemaTest.php +++ b/test/classes/Plugins/Schema/ExportRelationSchemaTest.php @@ -13,7 +13,7 @@ use PhpMyAdmin\Tests\AbstractTestCase; */ class ExportRelationSchemaTest extends AbstractTestCase { - /** @var ExportRelationSchema */ + /** @var ExportRelationSchema */ protected $object; /**