From ca1aeb7f84eacb5c3f95140828922cbe5f3fa33e Mon Sep 17 00:00:00 2001 From: Michael Telgmann Date: Fri, 8 Nov 2024 11:47:49 +0100 Subject: [PATCH 1/2] chore: Update third-party dependencies --- UPGRADE-5.7.md | 2 +- composer.lock | 196 ++++++++++++++++++++++++------------------------- 2 files changed, 99 insertions(+), 99 deletions(-) diff --git a/UPGRADE-5.7.md b/UPGRADE-5.7.md index 74510d73e5b..c0f422a0428 100644 --- a/UPGRADE-5.7.md +++ b/UPGRADE-5.7.md @@ -40,7 +40,7 @@ This changelog references changes done in Shopware 5.7 patch versions. * Updated `symfony/polyfill-php82` to version 1.31.0 * Updated `symfony/polyfill-php83` to version 1.31.0 * Updated `symfony/http-kernel` to version 4.4.51 -* Updated `symfony/serializer` to version 5.4.44 +* Updated `symfony/serializer` to version 5.4.45 * Updated `voku/anti-xss` to version 4.1.42 * Updated `wikimedia/less.php` to version 5.1.1 * Updated several indirect dependencies diff --git a/composer.lock b/composer.lock index 7eb755d03ab..4b4a3ad5aba 100644 --- a/composer.lock +++ b/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "aws/aws-crt-php", - "version": "v1.2.6", + "version": "v1.2.7", "source": { "type": "git", "url": "https://github.com/awslabs/aws-crt-php.git", - "reference": "a63485b65b6b3367039306496d49737cf1995408" + "reference": "d71d9906c7bb63a28295447ba12e74723bd3730e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/awslabs/aws-crt-php/zipball/a63485b65b6b3367039306496d49737cf1995408", - "reference": "a63485b65b6b3367039306496d49737cf1995408", + "url": "https://api.github.com/repos/awslabs/aws-crt-php/zipball/d71d9906c7bb63a28295447ba12e74723bd3730e", + "reference": "d71d9906c7bb63a28295447ba12e74723bd3730e", "shasum": "" }, "require": { @@ -56,22 +56,22 @@ ], "support": { "issues": "https://github.com/awslabs/aws-crt-php/issues", - "source": "https://github.com/awslabs/aws-crt-php/tree/v1.2.6" + "source": "https://github.com/awslabs/aws-crt-php/tree/v1.2.7" }, - "time": "2024-06-13T17:21:28+00:00" + "time": "2024-10-18T22:15:13+00:00" }, { "name": "aws/aws-sdk-php", - "version": "3.324.1", + "version": "3.325.4", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "5b824a9b8015a38f18c53b023975c0f63c7bd3dc" + "reference": "86372984539f25485718059f997a4ea12c05ba0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/5b824a9b8015a38f18c53b023975c0f63c7bd3dc", - "reference": "5b824a9b8015a38f18c53b023975c0f63c7bd3dc", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/86372984539f25485718059f997a4ea12c05ba0a", + "reference": "86372984539f25485718059f997a4ea12c05ba0a", "shasum": "" }, "require": { @@ -154,9 +154,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.324.1" + "source": "https://github.com/aws/aws-sdk-php/tree/3.325.4" }, - "time": "2024-10-11T18:22:01+00:00" + "time": "2024-11-07T19:25:01+00:00" }, { "name": "bcremer/line-reader", @@ -2205,16 +2205,16 @@ }, { "name": "google/longrunning", - "version": "0.4.3", + "version": "0.4.4", "source": { "type": "git", "url": "https://github.com/googleapis/php-longrunning.git", - "reference": "ed718a735e407826c3332b7197a44602eb03e608" + "reference": "ce921cf2a59082b09ab04f36b1afef4686c3a9ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/php-longrunning/zipball/ed718a735e407826c3332b7197a44602eb03e608", - "reference": "ed718a735e407826c3332b7197a44602eb03e608", + "url": "https://api.github.com/repos/googleapis/php-longrunning/zipball/ce921cf2a59082b09ab04f36b1afef4686c3a9ab", + "reference": "ce921cf2a59082b09ab04f36b1afef4686c3a9ab", "shasum": "" }, "require-dev": { @@ -2243,9 +2243,9 @@ ], "description": "Google LongRunning Client for PHP", "support": { - "source": "https://github.com/googleapis/php-longrunning/tree/v0.4.3" + "source": "https://github.com/googleapis/php-longrunning/tree/v0.4.4" }, - "time": "2024-06-01T03:14:01+00:00" + "time": "2024-11-06T21:50:43+00:00" }, { "name": "google/protobuf", @@ -2463,16 +2463,16 @@ }, { "name": "guzzlehttp/promises", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8" + "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8", - "reference": "6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8", + "url": "https://api.github.com/repos/guzzle/promises/zipball/f9c436286ab2892c7db7be8c8da4ef61ccf7b455", + "reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455", "shasum": "" }, "require": { @@ -2526,7 +2526,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.0.3" + "source": "https://github.com/guzzle/promises/tree/2.0.4" }, "funding": [ { @@ -2542,7 +2542,7 @@ "type": "tidelift" } ], - "time": "2024-07-18T10:29:17+00:00" + "time": "2024-10-17T10:06:22+00:00" }, { "name": "guzzlehttp/psr7", @@ -4401,16 +4401,16 @@ }, { "name": "symfony/cache", - "version": "v5.4.44", + "version": "v5.4.46", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "4b3e7bf157b8b5a010865701d9106b5f0a9c99a8" + "reference": "0fe08ee32cec2748fbfea10c52d3ee02049e0f6b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/4b3e7bf157b8b5a010865701d9106b5f0a9c99a8", - "reference": "4b3e7bf157b8b5a010865701d9106b5f0a9c99a8", + "url": "https://api.github.com/repos/symfony/cache/zipball/0fe08ee32cec2748fbfea10c52d3ee02049e0f6b", + "reference": "0fe08ee32cec2748fbfea10c52d3ee02049e0f6b", "shasum": "" }, "require": { @@ -4478,7 +4478,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v5.4.44" + "source": "https://github.com/symfony/cache/tree/v5.4.46" }, "funding": [ { @@ -4494,7 +4494,7 @@ "type": "tidelift" } ], - "time": "2024-09-13T16:57:39+00:00" + "time": "2024-11-04T11:43:55+00:00" }, { "name": "symfony/cache-contracts", @@ -5734,16 +5734,16 @@ }, { "name": "symfony/intl", - "version": "v5.4.44", + "version": "v5.4.46", "source": { "type": "git", "url": "https://github.com/symfony/intl.git", - "reference": "e4171a01aaa3789f351b5d58f9567b0fb81a0918" + "reference": "d74763310045ccf2bf485549f8ba942184e31087" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/intl/zipball/e4171a01aaa3789f351b5d58f9567b0fb81a0918", - "reference": "e4171a01aaa3789f351b5d58f9567b0fb81a0918", + "url": "https://api.github.com/repos/symfony/intl/zipball/d74763310045ccf2bf485549f8ba942184e31087", + "reference": "d74763310045ccf2bf485549f8ba942184e31087", "shasum": "" }, "require": { @@ -5804,7 +5804,7 @@ "localization" ], "support": { - "source": "https://github.com/symfony/intl/tree/v5.4.44" + "source": "https://github.com/symfony/intl/tree/v5.4.46" }, "funding": [ { @@ -5820,20 +5820,20 @@ "type": "tidelift" } ], - "time": "2024-09-20T07:56:40+00:00" + "time": "2024-11-05T14:12:18+00:00" }, { "name": "symfony/mime", - "version": "v5.4.43", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "a02711d6ce461edada8c0f8641aa536709b99b47" + "reference": "8c1b9b3e5b52981551fc6044539af1d974e39064" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/a02711d6ce461edada8c0f8641aa536709b99b47", - "reference": "a02711d6ce461edada8c0f8641aa536709b99b47", + "url": "https://api.github.com/repos/symfony/mime/zipball/8c1b9b3e5b52981551fc6044539af1d974e39064", + "reference": "8c1b9b3e5b52981551fc6044539af1d974e39064", "shasum": "" }, "require": { @@ -5889,7 +5889,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v5.4.43" + "source": "https://github.com/symfony/mime/tree/v5.4.45" }, "funding": [ { @@ -5905,7 +5905,7 @@ "type": "tidelift" } ], - "time": "2024-08-13T10:38:38+00:00" + "time": "2024-10-23T20:18:32+00:00" }, { "name": "symfony/options-resolver", @@ -6588,16 +6588,16 @@ }, { "name": "symfony/property-access", - "version": "v5.4.43", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/property-access.git", - "reference": "2d751866b976a02e22743359733edc55cd20e9fd" + "reference": "111e7ed617509f1a9139686055d234aad6e388e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-access/zipball/2d751866b976a02e22743359733edc55cd20e9fd", - "reference": "2d751866b976a02e22743359733edc55cd20e9fd", + "url": "https://api.github.com/repos/symfony/property-access/zipball/111e7ed617509f1a9139686055d234aad6e388e0", + "reference": "111e7ed617509f1a9139686055d234aad6e388e0", "shasum": "" }, "require": { @@ -6649,7 +6649,7 @@ "reflection" ], "support": { - "source": "https://github.com/symfony/property-access/tree/v5.4.43" + "source": "https://github.com/symfony/property-access/tree/v5.4.45" }, "funding": [ { @@ -6665,20 +6665,20 @@ "type": "tidelift" } ], - "time": "2024-08-29T08:50:14+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/property-info", - "version": "v5.4.42", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/property-info.git", - "reference": "825aa937f6e8cd63dcc118d0af84d7d4979cddf4" + "reference": "cec75362b20263758c9c7af4c2f9af82614195ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-info/zipball/825aa937f6e8cd63dcc118d0af84d7d4979cddf4", - "reference": "825aa937f6e8cd63dcc118d0af84d7d4979cddf4", + "url": "https://api.github.com/repos/symfony/property-info/zipball/cec75362b20263758c9c7af4c2f9af82614195ae", + "reference": "cec75362b20263758c9c7af4c2f9af82614195ae", "shasum": "" }, "require": { @@ -6740,7 +6740,7 @@ "validator" ], "support": { - "source": "https://github.com/symfony/property-info/tree/v5.4.42" + "source": "https://github.com/symfony/property-info/tree/v5.4.45" }, "funding": [ { @@ -6756,20 +6756,20 @@ "type": "tidelift" } ], - "time": "2024-07-22T18:03:36+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/serializer", - "version": "v5.4.44", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "0f100dfa5b3bc8b052d15940d1168e5fa1e1a59a" + "reference": "460c5df9fb6c39d10d5b7f386e4feae4b6370221" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/0f100dfa5b3bc8b052d15940d1168e5fa1e1a59a", - "reference": "0f100dfa5b3bc8b052d15940d1168e5fa1e1a59a", + "url": "https://api.github.com/repos/symfony/serializer/zipball/460c5df9fb6c39d10d5b7f386e4feae4b6370221", + "reference": "460c5df9fb6c39d10d5b7f386e4feae4b6370221", "shasum": "" }, "require": { @@ -6843,7 +6843,7 @@ "description": "Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/serializer/tree/v5.4.44" + "source": "https://github.com/symfony/serializer/tree/v5.4.45" }, "funding": [ { @@ -6859,7 +6859,7 @@ "type": "tidelift" } ], - "time": "2024-09-20T07:56:40+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/service-contracts", @@ -6946,16 +6946,16 @@ }, { "name": "symfony/string", - "version": "v5.4.44", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "832caa16b6d9aac6bf11747315225f5aba384c24" + "reference": "7f6807add88b1e2635f3c6de5e1ace631ed7cad2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/832caa16b6d9aac6bf11747315225f5aba384c24", - "reference": "832caa16b6d9aac6bf11747315225f5aba384c24", + "url": "https://api.github.com/repos/symfony/string/zipball/7f6807add88b1e2635f3c6de5e1ace631ed7cad2", + "reference": "7f6807add88b1e2635f3c6de5e1ace631ed7cad2", "shasum": "" }, "require": { @@ -7012,7 +7012,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.44" + "source": "https://github.com/symfony/string/tree/v5.4.45" }, "funding": [ { @@ -7028,7 +7028,7 @@ "type": "tidelift" } ], - "time": "2024-09-20T07:56:40+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/translation-contracts", @@ -7216,16 +7216,16 @@ }, { "name": "symfony/var-dumper", - "version": "v5.4.43", + "version": "v5.4.46", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "6be6a6a8af4818564e3726fc65cf936f34743cef" + "reference": "f51f11e4fc5ca24fa0defcdf4df027078950b9e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/6be6a6a8af4818564e3726fc65cf936f34743cef", - "reference": "6be6a6a8af4818564e3726fc65cf936f34743cef", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/f51f11e4fc5ca24fa0defcdf4df027078950b9e0", + "reference": "f51f11e4fc5ca24fa0defcdf4df027078950b9e0", "shasum": "" }, "require": { @@ -7285,7 +7285,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.4.43" + "source": "https://github.com/symfony/var-dumper/tree/v5.4.46" }, "funding": [ { @@ -7301,20 +7301,20 @@ "type": "tidelift" } ], - "time": "2024-08-30T16:01:46+00:00" + "time": "2024-11-05T14:17:06+00:00" }, { "name": "symfony/var-exporter", - "version": "v5.4.40", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", - "reference": "6a13d37336d512927986e09f19a4bed24178baa6" + "reference": "862700068db0ddfd8c5b850671e029a90246ec75" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/6a13d37336d512927986e09f19a4bed24178baa6", - "reference": "6a13d37336d512927986e09f19a4bed24178baa6", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/862700068db0ddfd8c5b850671e029a90246ec75", + "reference": "862700068db0ddfd8c5b850671e029a90246ec75", "shasum": "" }, "require": { @@ -7358,7 +7358,7 @@ "serialize" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v5.4.40" + "source": "https://github.com/symfony/var-exporter/tree/v5.4.45" }, "funding": [ { @@ -7374,7 +7374,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/web-link", @@ -10472,16 +10472,16 @@ }, { "name": "symfony/browser-kit", - "version": "v5.4.40", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "92c8ba1e5ee12d07120744c90898516132b4e58b" + "reference": "03cce39764429e07fbab9b989a1182a24578341d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/92c8ba1e5ee12d07120744c90898516132b4e58b", - "reference": "92c8ba1e5ee12d07120744c90898516132b4e58b", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/03cce39764429e07fbab9b989a1182a24578341d", + "reference": "03cce39764429e07fbab9b989a1182a24578341d", "shasum": "" }, "require": { @@ -10524,7 +10524,7 @@ "description": "Simulates the behavior of a web browser, allowing you to make requests, click on links and submit forms programmatically", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/browser-kit/tree/v5.4.40" + "source": "https://github.com/symfony/browser-kit/tree/v5.4.45" }, "funding": [ { @@ -10540,20 +10540,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-10-22T13:05:35+00:00" }, { "name": "symfony/css-selector", - "version": "v5.4.40", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "ea43887e9afd2029509662d4f95e8b5ef6fc9bbb" + "reference": "4f7f3c35fba88146b56d0025d20ace3f3901f097" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/ea43887e9afd2029509662d4f95e8b5ef6fc9bbb", - "reference": "ea43887e9afd2029509662d4f95e8b5ef6fc9bbb", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/4f7f3c35fba88146b56d0025d20ace3f3901f097", + "reference": "4f7f3c35fba88146b56d0025d20ace3f3901f097", "shasum": "" }, "require": { @@ -10590,7 +10590,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v5.4.40" + "source": "https://github.com/symfony/css-selector/tree/v5.4.45" }, "funding": [ { @@ -10606,20 +10606,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/dom-crawler", - "version": "v5.4.44", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "4c76e4176a5472c5afe504194d7bbef5cfdd1703" + "reference": "89647a57db280f9f93c27271fea58babb77bb473" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/4c76e4176a5472c5afe504194d7bbef5cfdd1703", - "reference": "4c76e4176a5472c5afe504194d7bbef5cfdd1703", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/89647a57db280f9f93c27271fea58babb77bb473", + "reference": "89647a57db280f9f93c27271fea58babb77bb473", "shasum": "" }, "require": { @@ -10665,7 +10665,7 @@ "description": "Eases DOM navigation for HTML and XML documents", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dom-crawler/tree/v5.4.44" + "source": "https://github.com/symfony/dom-crawler/tree/v5.4.45" }, "funding": [ { @@ -10681,7 +10681,7 @@ "type": "tidelift" } ], - "time": "2024-09-11T06:50:28+00:00" + "time": "2024-10-22T13:05:35+00:00" }, { "name": "symfony/translation", @@ -10900,7 +10900,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { @@ -10927,6 +10927,6 @@ "lib-libxml": "*", "composer-runtime-api": "^2.0" }, - "platform-dev": [], + "platform-dev": {}, "plugin-api-version": "2.6.0" } From cd34d77c2c4862edfec478797a0dc7a20fb5f78b Mon Sep 17 00:00:00 2001 From: Michael Telgmann Date: Wed, 13 Nov 2024 16:56:34 +0100 Subject: [PATCH 2/2] chore: Update PHPStan and its plugins --- .phpstan-baseline.neon | 94 +------------------ composer.json | 8 +- composer.lock | 54 +++++------ .../ShortForeachResolver.php | 15 +-- .../Commands/FirstRunWizardDisableCommand.php | 20 ++-- .../Commands/FirstRunWizardEnableCommand.php | 20 ++-- .../Components/AddLinkHeaderSubscriber.php | 39 +++----- .../Cart/ConditionalLineItemService.php | 37 +++----- .../Components/Plugin/CronjobSynchronizer.php | 26 ++--- .../Shopware/Controllers/Frontend/Forms.php | 2 +- .../Controllers/Backend/SwagUpdate.php | 6 +- .../StoreFrontBundle/ListProductTest.php | 7 +- .../Privacy/CookieRemoveSubscriberTest.php | 2 +- .../SitemapBundle/SitemapListenerTest.php | 3 +- 14 files changed, 109 insertions(+), 224 deletions(-) diff --git a/.phpstan-baseline.neon b/.phpstan-baseline.neon index 7fb526c8f98..4565c3865e9 100644 --- a/.phpstan-baseline.neon +++ b/.phpstan-baseline.neon @@ -3220,11 +3220,6 @@ parameters: count: 1 path: engine/Library/Enlight/Template/Plugins/block.stripLines.php - - - message: "#^Function smarty_block_stripLines\\(\\) never returns void so it can be removed from the return type\\.$#" - count: 1 - path: engine/Library/Enlight/Template/Plugins/block.stripLines.php - - message: "#^Method Smarty_Compiler_Config\\:\\:compile\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#" count: 1 @@ -11855,36 +11850,6 @@ parameters: count: 1 path: engine/Shopware/Commands/DatabaseSetupCommand.php - - - message: "#^Method Shopware\\\\Commands\\\\FirstRunWizardDisableCommand\\:\\:configure\\(\\) has no return type specified\\.$#" - count: 1 - path: engine/Shopware/Commands/FirstRunWizardDisableCommand.php - - - - message: "#^Query error\\: Column \"s_core_config_values\\.element_id\" expects value type int, got type mixed$#" - count: 2 - path: engine/Shopware/Commands/FirstRunWizardDisableCommand.php - - - - message: "#^Query error\\: Column \"s_core_config_values\\.id\" expects value type int, got type mixed~0\\|0\\.0\\|''\\|'0'\\|array\\{\\}\\|false\\|null$#" - count: 1 - path: engine/Shopware/Commands/FirstRunWizardDisableCommand.php - - - - message: "#^Method Shopware\\\\Commands\\\\FirstRunWizardEnableCommand\\:\\:configure\\(\\) has no return type specified\\.$#" - count: 1 - path: engine/Shopware/Commands/FirstRunWizardEnableCommand.php - - - - message: "#^Query error\\: Column \"s_core_config_values\\.element_id\" expects value type int, got type mixed$#" - count: 2 - path: engine/Shopware/Commands/FirstRunWizardEnableCommand.php - - - - message: "#^Query error\\: Column \"s_core_config_values\\.id\" expects value type int, got type mixed~0\\|0\\.0\\|''\\|'0'\\|array\\{\\}\\|false\\|null$#" - count: 1 - path: engine/Shopware/Commands/FirstRunWizardEnableCommand.php - - message: "#^Method Shopware\\\\Commands\\\\GenerateAttributesCommand\\:\\:configure\\(\\) has no return type specified\\.$#" count: 1 @@ -12685,11 +12650,6 @@ parameters: count: 1 path: engine/Shopware/Components/Acl.php - - - message: "#^Access to an undefined property Enlight_Controller_Response_Response\\:\\:\\$headers\\.$#" - count: 1 - path: engine/Shopware/Components/AddLinkHeaderSubscriber.php - - message: "#^Cannot call method setAcl\\(\\) on object\\|null\\.$#" count: 1 @@ -14125,21 +14085,6 @@ parameters: count: 1 path: engine/Shopware/Components/Cart/CartPersistService.php - - - message: "#^Query error\\: Column \"s_order_basket\\.currencyFactor\" expects value type float\\|int, got type mixed~0\\|0\\.0\\|''\\|'0'\\|array\\{\\}\\|false\\|null$#" - count: 1 - path: engine/Shopware/Components/Cart/ConditionalLineItemService.php - - - - message: "#^Query error\\: Column \"s_order_basket\\.sessionID\" expects value type string\\|null, got type mixed$#" - count: 1 - path: engine/Shopware/Components/Cart/ConditionalLineItemService.php - - - - message: "#^Query error\\: Column \"s_order_basket_attributes\\.basketID\" expects value type int\\|null, got type int\\|string\\|false$#" - count: 1 - path: engine/Shopware/Components/Cart/ConditionalLineItemService.php - - message: "#^Parameter \\#4 \\$path of class Symfony\\\\Component\\\\HttpFoundation\\\\Cookie constructor expects string\\|null, string\\|false given\\.$#" count: 1 @@ -17956,47 +17901,12 @@ parameters: path: engine/Shopware/Components/Plugin/Configuration/ReaderInterface.php - - message: "#^Method Shopware\\\\Components\\\\Plugin\\\\CronjobSynchronizer\\:\\:addCronjob\\(\\) has no return type specified\\.$#" - count: 1 - path: engine/Shopware/Components/Plugin/CronjobSynchronizer.php - - - - message: "#^Method Shopware\\\\Components\\\\Plugin\\\\CronjobSynchronizer\\:\\:addCronjob\\(\\) has parameter \\$cronjob with no value type specified in iterable type array\\.$#" - count: 1 - path: engine/Shopware/Components/Plugin/CronjobSynchronizer.php - - - - message: "#^Method Shopware\\\\Components\\\\Plugin\\\\CronjobSynchronizer\\:\\:removeNotExistingEntries\\(\\) has no return type specified\\.$#" - count: 1 - path: engine/Shopware/Components/Plugin/CronjobSynchronizer.php - - - - message: "#^Method Shopware\\\\Components\\\\Plugin\\\\CronjobSynchronizer\\:\\:removeNotExistingEntries\\(\\) has parameter \\$cronjobActions with no value type specified in iterable type array\\.$#" - count: 1 - path: engine/Shopware/Components/Plugin/CronjobSynchronizer.php - - - - message: "#^Method Shopware\\\\Components\\\\Plugin\\\\CronjobSynchronizer\\:\\:synchronize\\(\\) has no return type specified\\.$#" - count: 1 - path: engine/Shopware/Components/Plugin/CronjobSynchronizer.php - - - - message: "#^Method Shopware\\\\Components\\\\Plugin\\\\CronjobSynchronizer\\:\\:synchronize\\(\\) has parameter \\$cronjobs with no value type specified in iterable type array\\.$#" - count: 1 - path: engine/Shopware/Components/Plugin/CronjobSynchronizer.php - - - - message: "#^Query error\\: Argument \\#1 is not a constant array, got array\\&hasOffsetValue\\('pluginID', int\\)$#" - count: 1 - path: engine/Shopware/Components/Plugin/CronjobSynchronizer.php - - - - message: "#^Query error\\: Argument \\#1 is not a constant array, got hasOffsetValue\\('end', DateTime\\)&hasOffsetValue\\('next', DateTime\\)&hasOffsetValue\\('pluginID', int\\)&non\\-empty\\-array$#" + message: "#^Query error\\: Argument \\#1 is not a constant array, got array\\&hasOffsetValue\\('pluginID', int\\)$#" count: 1 path: engine/Shopware/Components/Plugin/CronjobSynchronizer.php - - message: "#^Query error\\: Column \"s_crontab\\.id\" expects value type int, got type mixed~0\\|0\\.0\\|''\\|'0'\\|array\\{\\}\\|false\\|null$#" + message: "#^Query error\\: Argument \\#1 is not a constant array, got non\\-empty\\-array\\&hasOffsetValue\\('end', DateTime\\)&hasOffsetValue\\('next', DateTime\\)&hasOffsetValue\\('pluginID', int\\)$#" count: 1 path: engine/Shopware/Components/Plugin/CronjobSynchronizer.php diff --git a/composer.json b/composer.json index 38d87b32d72..081db649faa 100644 --- a/composer.json +++ b/composer.json @@ -112,10 +112,10 @@ "friends-of-behat/mink-extension": "2.7.5", "php-parallel-lint/php-var-dump-check": "^0.5", "phpstan/extension-installer": "1.4.3", - "phpstan/phpstan": "1.12.0", - "phpstan/phpstan-doctrine": "1.5.3", - "phpstan/phpstan-phpunit": "1.4.0", - "phpstan/phpstan-symfony": "1.4.11", + "phpstan/phpstan": "1.12.10", + "phpstan/phpstan-doctrine": "1.5.6", + "phpstan/phpstan-phpunit": "1.4.1", + "phpstan/phpstan-symfony": "1.4.12", "phpunit/phpunit": "^9.6", "sensiolabs/behat-page-object-extension": "2.3.7", "staabm/phpstan-dba": "0.2.81", diff --git a/composer.lock b/composer.lock index 4b4a3ad5aba..b55982ececd 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "94ebce4f23a81a22ab4a0d904fb0de9f", + "content-hash": "8946aa35e29d29bbfbb2157eeb4db359", "packages": [ { "name": "aws/aws-crt-php", @@ -8682,16 +8682,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.12.0", + "version": "1.12.10", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "384af967d35b2162f69526c7276acadce534d0e1" + "reference": "fc463b5d0fe906dcf19689be692c65c50406a071" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/384af967d35b2162f69526c7276acadce534d0e1", - "reference": "384af967d35b2162f69526c7276acadce534d0e1", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/fc463b5d0fe906dcf19689be692c65c50406a071", + "reference": "fc463b5d0fe906dcf19689be692c65c50406a071", "shasum": "" }, "require": { @@ -8736,25 +8736,25 @@ "type": "github" } ], - "time": "2024-08-27T09:18:05+00:00" + "time": "2024-11-11T15:37:09+00:00" }, { "name": "phpstan/phpstan-doctrine", - "version": "1.5.3", + "version": "1.5.6", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-doctrine.git", - "reference": "38db3bad8f1567d7bf64806738d724261f8a2b5c" + "reference": "8ba022846e79238872e315fff61e19b42ba2f139" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-doctrine/zipball/38db3bad8f1567d7bf64806738d724261f8a2b5c", - "reference": "38db3bad8f1567d7bf64806738d724261f8a2b5c", + "url": "https://api.github.com/repos/phpstan/phpstan-doctrine/zipball/8ba022846e79238872e315fff61e19b42ba2f139", + "reference": "8ba022846e79238872e315fff61e19b42ba2f139", "shasum": "" }, "require": { "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.11.7" + "phpstan/phpstan": "^1.12.6" }, "conflict": { "doctrine/collections": "<1.0", @@ -8781,7 +8781,7 @@ "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/phpstan-phpunit": "^1.3.13", "phpstan/phpstan-strict-rules": "^1.5.1", - "phpunit/phpunit": "^9.6.16", + "phpunit/phpunit": "^9.6.20", "ramsey/uuid": "^4.2", "symfony/cache": "^5.4" }, @@ -8806,27 +8806,27 @@ "description": "Doctrine extensions for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-doctrine/issues", - "source": "https://github.com/phpstan/phpstan-doctrine/tree/1.5.3" + "source": "https://github.com/phpstan/phpstan-doctrine/tree/1.5.6" }, - "time": "2024-09-01T13:17:34+00:00" + "time": "2024-11-09T17:34:01+00:00" }, { "name": "phpstan/phpstan-phpunit", - "version": "1.4.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "f3ea021866f4263f07ca3636bf22c64be9610c11" + "reference": "11d4235fbc6313ecbf93708606edfd3222e44949" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/f3ea021866f4263f07ca3636bf22c64be9610c11", - "reference": "f3ea021866f4263f07ca3636bf22c64be9610c11", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/11d4235fbc6313ecbf93708606edfd3222e44949", + "reference": "11d4235fbc6313ecbf93708606edfd3222e44949", "shasum": "" }, "require": { "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.11" + "phpstan/phpstan": "^1.12" }, "conflict": { "phpunit/phpunit": "<7.0" @@ -8858,22 +8858,22 @@ "description": "PHPUnit extensions and rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-phpunit/issues", - "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.4.0" + "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.4.1" }, - "time": "2024-04-20T06:39:00+00:00" + "time": "2024-11-12T12:43:59+00:00" }, { "name": "phpstan/phpstan-symfony", - "version": "1.4.11", + "version": "1.4.12", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-symfony.git", - "reference": "270c2ee1478d1f8dc5121f539e890017bd64b04c" + "reference": "c7b7e7f520893621558bfbfdb2694d4364565c1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/270c2ee1478d1f8dc5121f539e890017bd64b04c", - "reference": "270c2ee1478d1f8dc5121f539e890017bd64b04c", + "url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/c7b7e7f520893621558bfbfdb2694d4364565c1d", + "reference": "c7b7e7f520893621558bfbfdb2694d4364565c1d", "shasum": "" }, "require": { @@ -8930,9 +8930,9 @@ "description": "Symfony Framework extensions and rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-symfony/issues", - "source": "https://github.com/phpstan/phpstan-symfony/tree/1.4.11" + "source": "https://github.com/phpstan/phpstan-symfony/tree/1.4.12" }, - "time": "2024-10-30T12:07:21+00:00" + "time": "2024-11-06T10:13:18+00:00" }, { "name": "phpunit/php-code-coverage", diff --git a/engine/Shopware/Bundle/MailBundle/AutocompleteResolver/ShortForeachResolver.php b/engine/Shopware/Bundle/MailBundle/AutocompleteResolver/ShortForeachResolver.php index 0c909bf1621..7ada589c442 100644 --- a/engine/Shopware/Bundle/MailBundle/AutocompleteResolver/ShortForeachResolver.php +++ b/engine/Shopware/Bundle/MailBundle/AutocompleteResolver/ShortForeachResolver.php @@ -1,4 +1,7 @@ getValueFromPath($context, $match['arrayName']); if ($value === null) { @@ -46,14 +45,10 @@ public function completer(array $context, string $smartyCode): array if (\count($value)) { $key = array_keys($value)[0]; $context[$match['value']] = $value[$key]; - if (isset($match['key'])) { - $context[$match['key']] = $key; - } + $context[$match['key']] = $key; } else { $context[$match['value']] = []; - if (isset($match['key'])) { - $context[$match['key']] = 0; - } + $context[$match['key']] = 0; } } } diff --git a/engine/Shopware/Commands/FirstRunWizardDisableCommand.php b/engine/Shopware/Commands/FirstRunWizardDisableCommand.php index e2342ec711e..03060b8215a 100644 --- a/engine/Shopware/Commands/FirstRunWizardDisableCommand.php +++ b/engine/Shopware/Commands/FirstRunWizardDisableCommand.php @@ -1,4 +1,7 @@ container->get(\Doctrine\DBAL\Connection::class); - $elementId = $conn->fetchColumn('SELECT id FROM s_core_config_elements WHERE name LIKE "firstRunWizardEnabled"'); - $valueid = $conn->fetchColumn('SELECT id FROM s_core_config_values WHERE element_id = :elementId', ['elementId' => $elementId]); + $conn = $this->container->get(Connection::class); + $elementId = (int) $conn->fetchOne('SELECT id FROM s_core_config_elements WHERE name LIKE "firstRunWizardEnabled"'); + $valueId = (int) $conn->fetchOne('SELECT id FROM s_core_config_values WHERE element_id = :elementId', ['elementId' => $elementId]); $data = [ 'element_id' => $elementId, @@ -54,18 +59,17 @@ protected function execute(InputInterface $input, OutputInterface $output) 'value' => serialize(false), ]; - if ($valueid) { + if ($valueId) { $conn->update( 's_core_config_values', $data, - ['id' => $valueid] + ['id' => $valueId] ); } else { $conn->insert('s_core_config_values', $data); } - /** @var \Shopware\Components\CacheManager $cacheManager */ - $cacheManager = $this->container->get(\Shopware\Components\CacheManager::class); + $cacheManager = $this->container->get(CacheManager::class); $cacheManager->clearConfigCache(); $output->writeln('First Run Wizard disabled'); diff --git a/engine/Shopware/Commands/FirstRunWizardEnableCommand.php b/engine/Shopware/Commands/FirstRunWizardEnableCommand.php index 4a35ce47ebc..ee96fd0d47f 100644 --- a/engine/Shopware/Commands/FirstRunWizardEnableCommand.php +++ b/engine/Shopware/Commands/FirstRunWizardEnableCommand.php @@ -1,4 +1,7 @@ container->get(\Doctrine\DBAL\Connection::class); - $elementId = $conn->fetchColumn('SELECT id FROM s_core_config_elements WHERE name LIKE "firstRunWizardEnabled"'); - $valueid = $conn->fetchColumn('SELECT id FROM s_core_config_values WHERE element_id = :elementId', ['elementId' => $elementId]); + $conn = $this->container->get(Connection::class); + $elementId = (int) $conn->fetchOne('SELECT id FROM s_core_config_elements WHERE name LIKE "firstRunWizardEnabled"'); + $valueId = (int) $conn->fetchOne('SELECT id FROM s_core_config_values WHERE element_id = :elementId', ['elementId' => $elementId]); $data = [ 'element_id' => $elementId, @@ -54,18 +59,17 @@ protected function execute(InputInterface $input, OutputInterface $output) 'value' => serialize(true), ]; - if ($valueid) { + if ($valueId) { $conn->update( 's_core_config_values', $data, - ['id' => $valueid] + ['id' => $valueId] ); } else { $conn->insert('s_core_config_values', $data); } - /** @var \Shopware\Components\CacheManager $cacheManager */ - $cacheManager = $this->container->get(\Shopware\Components\CacheManager::class); + $cacheManager = $this->container->get(CacheManager::class); $cacheManager->clearConfigCache(); $output->writeln('First Run Wizard enabled'); diff --git a/engine/Shopware/Components/AddLinkHeaderSubscriber.php b/engine/Shopware/Components/AddLinkHeaderSubscriber.php index 41d4c7c4085..e15625308a0 100644 --- a/engine/Shopware/Components/AddLinkHeaderSubscriber.php +++ b/engine/Shopware/Components/AddLinkHeaderSubscriber.php @@ -1,4 +1,7 @@ get('request'); + if (!$request instanceof Enlight_Controller_Request_Request) { + return; + } // Only use Server Push if it is enabled in the settings and the current module is "frontend" if (!$this->pushEnabled @@ -79,20 +73,13 @@ public function onDispatchLoopShutdown(Enlight_Event_EventArgs $args): void return; } - /** @var Enlight_Controller_Response_Response $response */ $response = $args->get('response'); - - $linkProvider = $this->webLinkManager->getLinkProvider(); - if (!$linkProvider instanceof LinkProviderInterface) { - return; - } - - $links = $linkProvider->getLinks(); - if (is_countable($links) && \count($links) === 0) { + if (!$response instanceof Response) { return; } - if ($links instanceof Traversable && iterator_count($links) === 0) { + $links = $this->webLinkManager->getLinkProvider()->getLinks(); + if (empty($links)) { return; } diff --git a/engine/Shopware/Components/Cart/ConditionalLineItemService.php b/engine/Shopware/Components/Cart/ConditionalLineItemService.php index 8d9212415a3..ef05333fffc 100644 --- a/engine/Shopware/Components/Cart/ConditionalLineItemService.php +++ b/engine/Shopware/Components/Cart/ConditionalLineItemService.php @@ -31,33 +31,22 @@ class ConditionalLineItemService implements ConditionalLineItemServiceInterface { - /** - * @var System - */ - private $system; + private System $system; - /** - * @var Session - */ - private $session; + private Session $session; - /** - * @var Config - */ - private $config; + private Config $config; - /** - * @var BasketHelperInterface - */ - private $basketHelper; + private BasketHelperInterface $basketHelper; - /** - * @var Connection - */ - private $connection; + private Connection $connection; public function __construct( - System $sSystem, Session $session, Config $config, BasketHelperInterface $basketHelper, Connection $connection + System $sSystem, + Session $session, + Config $config, + BasketHelperInterface $basketHelper, + Connection $connection ) { $this->system = $sSystem; $this->session = $session; @@ -68,9 +57,9 @@ public function __construct( public function addConditionalLineItem(string $name, string $orderNumber, float $price, float $tax, int $mode): void { - $currencyFactor = empty($this->system->sCurrency['factor']) ? 1 : $this->system->sCurrency['factor']; + $currencyFactor = (float) (empty($this->system->sCurrency['factor']) ? 1 : $this->system->sCurrency['factor']); $taxFree = empty($this->system->sUSERGROUPDATA['tax']) && !empty($this->system->sUSERGROUPDATA['id']); - $sessionId = $this->session->get('sessionId'); + $sessionId = (string) $this->session->get('sessionId'); if ($taxFree) { $netPrice = $price; @@ -109,7 +98,7 @@ public function addConditionalLineItem(string $name, string $orderNumber, float ] ); - $this->connection->insert('s_order_basket_attributes', ['basketID' => $this->connection->lastInsertId()]); + $this->connection->insert('s_order_basket_attributes', ['basketID' => (int) $this->connection->lastInsertId()]); } } } diff --git a/engine/Shopware/Components/Plugin/CronjobSynchronizer.php b/engine/Shopware/Components/Plugin/CronjobSynchronizer.php index f5fff249b95..b8ba5b2b3e6 100644 --- a/engine/Shopware/Components/Plugin/CronjobSynchronizer.php +++ b/engine/Shopware/Components/Plugin/CronjobSynchronizer.php @@ -1,4 +1,7 @@ > $cronjobs + * * @throws InvalidArgumentException + * + * @return void */ public function synchronize(Plugin $plugin, array $cronjobs) { @@ -53,9 +57,9 @@ public function synchronize(Plugin $plugin, array $cronjobs) } /** - * @param array $cronjob + * @param array $cronjob */ - private function addCronjob(Plugin $plugin, $cronjob) + private function addCronjob(Plugin $plugin, array $cronjob): void { $cronjob['pluginID'] = $plugin->getId(); @@ -72,16 +76,16 @@ private function addCronjob(Plugin $plugin, $cronjob) $plugin->getId(), ]; - $id = $this->connection->fetchColumn($selectStatement, $params); + $id = (int) $this->connection->fetchOne($selectStatement, $params); /* * Check if this cronjob's action is named without a preceding 'Shopware_CronJob_', * which is valid but after first run, every cronjob gets prefixed with that, so we might not have gotten * the id because we were asking for the wrong action. */ - if (!$id && strpos($action, 'Shopware_CronJob_') !== 0) { + if (!$id && !str_starts_with($action, 'Shopware_CronJob_')) { $params[0] = 'Shopware_CronJob_' . $action; - $id = $this->connection->fetchColumn($selectStatement, $params); + $id = (int) $this->connection->fetchOne($selectStatement, $params); } if ($id) { @@ -97,9 +101,9 @@ private function addCronjob(Plugin $plugin, $cronjob) } /** - * @param int $pluginId + * @param list $cronjobActions */ - private function removeNotExistingEntries($pluginId, array $cronjobActions) + private function removeNotExistingEntries(int $pluginId, array $cronjobActions): void { $builder = $this->connection->createQueryBuilder(); $builder->delete('s_crontab'); diff --git a/engine/Shopware/Controllers/Frontend/Forms.php b/engine/Shopware/Controllers/Frontend/Forms.php index de339b9ad1f..bc317bb1894 100644 --- a/engine/Shopware/Controllers/Frontend/Forms.php +++ b/engine/Shopware/Controllers/Frontend/Forms.php @@ -636,7 +636,7 @@ protected function _validateInput(array $inputs, array $elements) $valid = false; break; } - $host = trim(substr($value, strpos($value, '@') + 1)); + $host = trim(substr($value, strpos($value, '@') + 1) ?: ''); if (empty($host) || !gethostbyname($host)) { unset($value); $valid = false; diff --git a/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Controllers/Backend/SwagUpdate.php b/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Controllers/Backend/SwagUpdate.php index 0b8cd0321d3..c302dca602f 100644 --- a/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Controllers/Backend/SwagUpdate.php +++ b/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Controllers/Backend/SwagUpdate.php @@ -446,9 +446,7 @@ private function createDestinationFromVersion(Version $version): string */ private function mapResult($result): array { - $mapper = new ExtJsResultMapper(); - - return $mapper->toExtJs($result); + return (new ExtJsResultMapper())->toExtJs($result); } private function getUserLanguage(stdClass $user): string @@ -456,7 +454,7 @@ private function getUserLanguage(stdClass $user): string $locale = $user->locale; $locale = strtolower($locale->getLocale()); - return substr($locale, 0, 2); + return substr($locale, 0, 2) ?: 'en'; } private function checkSecurityPlugin(): bool diff --git a/tests/Functional/Bundle/StoreFrontBundle/ListProductTest.php b/tests/Functional/Bundle/StoreFrontBundle/ListProductTest.php index 1f7930888a8..835f7c0e2d9 100644 --- a/tests/Functional/Bundle/StoreFrontBundle/ListProductTest.php +++ b/tests/Functional/Bundle/StoreFrontBundle/ListProductTest.php @@ -57,9 +57,7 @@ public function testProductRequirements(): void static::assertNotEmpty($product->getVariantId()); static::assertNotEmpty($product->getName()); static::assertNotEmpty($product->getNumber()); - static::assertNotEmpty($product->getManufacturer()); static::assertNotEmpty($product->getTax()); - static::assertNotEmpty($product->getUnit()); static::assertInstanceOf(Unit::class, $product->getUnit()); static::assertInstanceOf(Manufacturer::class, $product->getManufacturer()); @@ -67,14 +65,11 @@ public function testProductRequirements(): void static::assertNotEmpty($product->getPrices()); static::assertNotEmpty($product->getPriceRules()); foreach ($product->getPrices() as $price) { - static::assertInstanceOf(Price::class, $price); static::assertInstanceOf(Unit::class, $price->getUnit()); static::assertGreaterThanOrEqual(1, $price->getUnit()->getMinPurchase()); } - foreach ($product->getPriceRules() as $price) { - static::assertInstanceOf(PriceRule::class, $price); - } + static::assertCount(3, $product->getPriceRules()); static::assertInstanceOf(Price::class, $product->getCheapestPrice()); static::assertInstanceOf(PriceRule::class, $product->getCheapestPriceRule()); diff --git a/tests/Functional/Components/Privacy/CookieRemoveSubscriberTest.php b/tests/Functional/Components/Privacy/CookieRemoveSubscriberTest.php index 9615290f9a1..813c82bf4c5 100644 --- a/tests/Functional/Components/Privacy/CookieRemoveSubscriberTest.php +++ b/tests/Functional/Components/Privacy/CookieRemoveSubscriberTest.php @@ -61,7 +61,7 @@ public function testPostDispatchDoesNothingRemovalInactive(): void $cookieRemoveSubscriber->onPostDispatch($this->getEventArgs($controller)); // More code than allowed got executed if this fails - static::assertNotEmpty($controller->Response()->getCookies()); + static::assertCount(2, $controller->Response()->getCookies()); } public function testPostDispatchDoesNothingAllowAllModeCookieSet(): void diff --git a/tests/Unit/Bundle/SitemapBundle/SitemapListenerTest.php b/tests/Unit/Bundle/SitemapBundle/SitemapListenerTest.php index 88c08155fc8..d17607f2c8d 100644 --- a/tests/Unit/Bundle/SitemapBundle/SitemapListenerTest.php +++ b/tests/Unit/Bundle/SitemapBundle/SitemapListenerTest.php @@ -30,7 +30,6 @@ use Shopware\Bundle\MediaBundle\Adapters\LocalAdapterFactory; use Shopware\Bundle\SitemapBundle\Service\SitemapLister; use Shopware\Bundle\SitemapBundle\Service\SitemapNameGenerator; -use Shopware\Bundle\SitemapBundle\Struct\Sitemap; use Shopware\Components\DependencyInjection\Container; use Shopware\Components\Filesystem\PublicUrlGenerator; @@ -78,7 +77,7 @@ public function testListWithSitemap(): void $sitemaps = $this->listener->getSitemaps(1); static::assertNotEmpty($sitemaps); - static::assertInstanceOf(Sitemap::class, $sitemaps[0]); + static::assertStringStartsWith('foo/', $sitemaps[0]->getFilename()); // Subshop specific sitemaps static::assertEmpty($this->listener->getSitemaps(2));