diff --git a/.github/workflows/diagnostics.yml b/.github/workflows/diagnostics.yml index 9cc2cf8..ddb119f 100644 --- a/.github/workflows/diagnostics.yml +++ b/.github/workflows/diagnostics.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - php: [ '8.1', '8.2', '8.3' ] + php: [ '8.2', '8.3' ] contao: [ '~4.13.0' ] phpcq_install: [ 'update' ] output: [ '-o github-action -o default' ] diff --git a/.phpcq.yaml.dist b/.phpcq.yaml.dist index 538ce32..3345178 100644 --- a/.phpcq.yaml.dist +++ b/.phpcq.yaml.dist @@ -12,6 +12,9 @@ phpcq: phpunit: version: ^1.0 signed: false + requirements: + phpunit: + version: ^11.5.48 psalm: version: ^1.0 signed: false @@ -39,22 +42,30 @@ phpcq: trusted-keys: # composer-require-checker - 033E5F8D801A2F8D + - B2BDAAAC6F1FDE528CD9EEC9033E5F8D801A2F8D # sb@sebastian-bergmann.de - 4AA394086372C20A + - D8406D0D82947747293778314AA394086372C20A # psalm - 8A03EA3B385DBAA1 - 12CE0F1D262429A5 + - 2DE50EB60C013FFFA831040D12CE0F1D262429A5 # magl@magll.net - D2CCAC42F6295E7D # PHP_CodeSniffer - 31C7E470E2138192 - 5E6DDE998AB73B8E - A978220305CD5C32 + - 689DAD778FF08760E046228BA978220305CD5C32 + - 97B02DD8E5071466 + - D91D86963AF3A29B6520462297B02DD8E5071466 # Composer normalize - C00543248C87FB13 + - 0FDE18AE1D09E19F60F6B1CBC00543248C87FB13 # phpmd - A4E55EA12C7C085C - 9093F8B32E4815AA + - E7A745102ECC980F7338B3079093F8B32E4815AA tasks: fix: diff --git a/src/EventListener/BackendEventListener.php b/src/EventListener/BackendEventListener.php index 2bba74f..6fea4ba 100644 --- a/src/EventListener/BackendEventListener.php +++ b/src/EventListener/BackendEventListener.php @@ -145,11 +145,18 @@ private function duplicateContentEntries(string $strTable, int $intSourceId, int $arrContent['pid'] = $intDestinationId; unset($arrContent['id']); + $parameters = []; + foreach (array_keys($arrContent) as $key) { + $parameters[$key] = '?'; + } + $this->connection ->createQueryBuilder() ->insert('tl_content') - ->setParameters($arrContent) - ->executeQuery(); + ->values($parameters) + ->setParameters(array_values($arrContent)) + ->executeStatement() + ; } } } diff --git a/tests/Widgets/ContentArticleWidgetTest.php b/tests/Widgets/ContentArticleWidgetTest.php index 59f0066..71a8216 100644 --- a/tests/Widgets/ContentArticleWidgetTest.php +++ b/tests/Widgets/ContentArticleWidgetTest.php @@ -63,9 +63,9 @@ public function testNewInstance(): void ->getMock(); $widget - ->expects(self::any()) + ->expects($this->never()) ->method('import') - ->withConsecutive([Config::class, 'Config']); + ->with(Config::class, 'Config'); self::assertEmpty($widget->getAttributes()); }