diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index ddf73c726ea..2c1cc28a207 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -23,3 +23,6 @@ e1d0b23fba81d3c80e80f2881ab38bf9d7f6397a # New license header 3a73921085d70b87f9a71ff46c4c9035beec8ca0 633e5ec44fabdbbbf73580a0ec857a4fb14030f9 + +# Update PHP-CS-Fixer +cbbc9a6e6896903f7bd6d26730c05256f3d3563b diff --git a/.github/workflows/check-php-code.yml b/.github/workflows/check-php-code.yml index 2f219a0c222..a50ed2a47e8 100644 --- a/.github/workflows/check-php-code.yml +++ b/.github/workflows/check-php-code.yml @@ -39,7 +39,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '7.4' - name: Cache CS-Fixer uses: actions/cache@v4 diff --git a/.phpstan-baseline.neon b/.phpstan-baseline.neon index 4565c3865e9..16d91c325bc 100644 --- a/.phpstan-baseline.neon +++ b/.phpstan-baseline.neon @@ -24920,11 +24920,6 @@ parameters: count: 1 path: engine/Shopware/Core/sAdmin.php - - - message: "#^Binary operation \"\\-\" between int\\|string and 1 results in an error\\.$#" - count: 1 - path: engine/Shopware/Core/sArticles.php - - message: "#^Cannot call method getId\\(\\) on Shopware\\\\Bundle\\\\StoreFrontBundle\\\\Struct\\\\Media\\|null\\.$#" count: 1 @@ -34500,11 +34495,6 @@ parameters: count: 1 path: engine/Shopware/Plugins/Default/Core/RestApi/Bootstrap.php - - - message: "#^Parameter \\#1 \\$encodedValue of static method Zend_Json\\:\\:decode\\(\\) expects string, string\\|false given\\.$#" - count: 1 - path: engine/Shopware/Plugins/Default/Core/RestApi/Bootstrap.php - - message: "#^Parameter \\#1 \\$request of method ShopwarePlugins\\\\RestApi\\\\Components\\\\Router\\:\\:assembleRoute\\(\\) expects Enlight_Controller_Request_RequestHttp, Enlight_Controller_Request_Request\\|null given\\.$#" count: 1 diff --git a/UPGRADE-5.7.md b/UPGRADE-5.7.md index 8e8de48035f..04c5a186db2 100644 --- a/UPGRADE-5.7.md +++ b/UPGRADE-5.7.md @@ -17,33 +17,34 @@ This changelog references changes done in Shopware 5.7 patch versions. * Changed the test kernel, so PHPUnit tests do no longer ignore PHP warnings and notices and are failing instead * Changed the `plugin.xsd` complexType `pluginType` so it could be validated again with newer `libxml2` versions +* Updated `beberlei/assert` to version 3.3.3 * Updated `beberlei/doctrineextensions` to version 1.4.0 * Updated `cocur/slugify` to version 4.6.0 for PHP 8.0 and newer * Updated `doctrine/annotations` to version 1.14.4 -* Updated `doctrine/common` to version 3.4.5 +* Updated `doctrine/common` to version 3.5.0 * Updated `doctrine/inflector` to version 2.0.10 * Updated `doctrine/orm` to version 2.15.5 -* Updated `doctrine/persistence` to version 3.3.3 +* Updated `doctrine/persistence` to version 3.4.0 * Updated `friendsofphp/proxy-manager-lts` to version 1.0.18 * Updated `google/cloud-storage` to version 1.39.0 * Updated `guzzlehttp/guzzle` to version 7.9.2 * Updated `guzzlehttp/psr7` to version 2.7.0 -* Updated `monolog/monolog` to version 2.9.3 +* Updated `monolog/monolog` to version 2.10.0 * Updated `mpdf/mpdf` to version 8.2.4 -* Updated `laminas/laminas-code` to version 4.15.1 for PHP 8.1 and newer +* Updated `laminas/laminas-code` to version 4.16.0 for PHP 8.1 and newer * Updated `laminas/laminas-escaper` to version 2.15.0 for PHP 8.1 and newer * Updated `phpunit/phpunit` to version 9.6.21 * Updated `setasign/fpdf` to version 1.8.6 -* Updated `setasign/fpdi` to version 2.6.1 +* Updated `setasign/fpdi` to version 2.6.2 * Updated `symfony/polyfill-php80` to version 1.31.0 * Updated `symfony/polyfill-php81` to version 1.31.0 * Updated `symfony/polyfill-php82` to version 1.31.0 * Updated `symfony/polyfill-php83` to version 1.31.0 -* Updated `symfony/process` to version 5.4.46 +* Updated `symfony/process` to version 5.4.47 * Updated `symfony/http-kernel` to version 4.4.51 * 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 `wikimedia/less.php` to version 5.1.2 * Updated several indirect dependencies * Updated npm dependencies in `themes/package.json` * Updated npm dependencies in `themes/Frontend/Responsive/package.json` diff --git a/_sql/migrations/101-add-extended-editor-field.php b/_sql/migrations/101-add-extended-editor-field.php index 7c5b375b3a6..0f10e8b550f 100644 --- a/_sql/migrations/101-add-extended-editor-field.php +++ b/_sql/migrations/101-add-extended-editor-field.php @@ -1,4 +1,5 @@ addSql($sql); } diff --git a/_sql/migrations/1215-form-active-status.php b/_sql/migrations/1215-form-active-status.php index 5d085cdc724..7a86aaf9abf 100644 --- a/_sql/migrations/1215-form-active-status.php +++ b/_sql/migrations/1215-form-active-status.php @@ -1,4 +1,5 @@ 'off', ], ]); - $sql = sprintf( + $sql = \sprintf( "UPDATE `s_core_config_elements` SET options = '%s' WHERE name = 'mailer_password' AND options IS NULL;", $inputType ); diff --git a/_sql/migrations/1218-change-privacy-options.php b/_sql/migrations/1218-change-privacy-options.php index 0d5a2c046a1..7753ed6cb99 100644 --- a/_sql/migrations/1218-change-privacy-options.php +++ b/_sql/migrations/1218-change-privacy-options.php @@ -1,4 +1,5 @@ addSql( - sprintf( + \sprintf( 'SET @resourceId = (%s);', "SELECT id FROM `s_core_acl_resources` WHERE name = 'benchmark' LIMIT 1" ) diff --git a/_sql/migrations/1415-add-necessary-columns-to-bi.php b/_sql/migrations/1415-add-necessary-columns-to-bi.php index 59547b8fd06..78cf84247e0 100644 --- a/_sql/migrations/1415-add-necessary-columns-to-bi.php +++ b/_sql/migrations/1415-add-necessary-columns-to-bi.php @@ -1,4 +1,5 @@ addSql(sprintf($sql, serialize($settings))); + $this->addSql(\sprintf($sql, serialize($settings))); } } diff --git a/_sql/migrations/1435-update-esd-helptext.php b/_sql/migrations/1435-update-esd-helptext.php index 484d93c9fe0..b9a83cd01fd 100644 --- a/_sql/migrations/1435-update-esd-helptext.php +++ b/_sql/migrations/1435-update-esd-helptext.php @@ -1,4 +1,5 @@ addSql(sprintf('UPDATE s_core_config_elements SET options = \'%s\', type = "combo", description = NULL WHERE `name` = "mailer_mailer"', serialize($this->mailer))); - $this->addSql(sprintf('UPDATE s_core_config_elements SET options = \'%s\', type = "combo", description = NULL WHERE `name` = "mailer_smtpsecure"', serialize($this->mailerSecure))); - $this->addSql(sprintf('UPDATE s_core_config_elements SET options = \'%s\', type = "combo", description = NULL WHERE `name` = "mailer_auth"', serialize($this->mailerAuth))); + $this->addSql(\sprintf('UPDATE s_core_config_elements SET options = \'%s\', type = "combo", description = NULL WHERE `name` = "mailer_mailer"', serialize($this->mailer))); + $this->addSql(\sprintf('UPDATE s_core_config_elements SET options = \'%s\', type = "combo", description = NULL WHERE `name` = "mailer_smtpsecure"', serialize($this->mailerSecure))); + $this->addSql(\sprintf('UPDATE s_core_config_elements SET options = \'%s\', type = "combo", description = NULL WHERE `name` = "mailer_auth"', serialize($this->mailerAuth))); } } diff --git a/_sql/migrations/1445-add-delete-document-right.php b/_sql/migrations/1445-add-delete-document-right.php index 22893ae768f..76cf2363a03 100644 --- a/_sql/migrations/1445-add-delete-document-right.php +++ b/_sql/migrations/1445-add-delete-document-right.php @@ -1,4 +1,5 @@ addSql(sprintf($sql, serialize($options))); + $this->addSql(\sprintf($sql, serialize($options))); } } diff --git a/_sql/migrations/146-http-cache-events.php b/_sql/migrations/146-http-cache-events.php index 7a77badc9b1..2137722298d 100644 --- a/_sql/migrations/146-http-cache-events.php +++ b/_sql/migrations/146-http-cache-events.php @@ -1,4 +1,5 @@ addSql(sprintf($sql, serialize($options))); + $this->addSql(\sprintf($sql, serialize($options))); if ($modus === self::MODUS_UPDATE) { $sql = "INSERT INTO `s_core_config_values` (`element_id`, `shop_id`, `value`) diff --git a/_sql/migrations/1461-change-no-customer-account-configs.php b/_sql/migrations/1461-change-no-customer-account-configs.php index cb1294d2bf8..bfbebcc782e 100644 --- a/_sql/migrations/1461-change-no-customer-account-configs.php +++ b/_sql/migrations/1461-change-no-customer-account-configs.php @@ -1,4 +1,5 @@ addSql(sprintf($sql, serialize($options))); + $this->addSql(\sprintf($sql, serialize($options))); } } diff --git a/_sql/migrations/1462-add-i-am-select-field-options.php b/_sql/migrations/1462-add-i-am-select-field-options.php index bb95cc718fb..43b164a6b2b 100644 --- a/_sql/migrations/1462-add-i-am-select-field-options.php +++ b/_sql/migrations/1462-add-i-am-select-field-options.php @@ -1,4 +1,5 @@ addSql(sprintf($sql, serialize($options))); + $this->addSql(\sprintf($sql, serialize($options))); } } diff --git a/_sql/migrations/1463-invalidate-http-cache-on-entity-removal-subscriber.php b/_sql/migrations/1463-invalidate-http-cache-on-entity-removal-subscriber.php index 09ce6502606..99d46709b62 100644 --- a/_sql/migrations/1463-invalidate-http-cache-on-entity-removal-subscriber.php +++ b/_sql/migrations/1463-invalidate-http-cache-on-entity-removal-subscriber.php @@ -1,4 +1,5 @@ addSql(sprintf($sql, serialize($options))); + $this->addSql(\sprintf($sql, serialize($options))); if ($modus === self::MODUS_UPDATE) { $sql = <<<'SQL' diff --git a/_sql/migrations/1608-add-voucher-configs.php b/_sql/migrations/1608-add-voucher-configs.php index 39a391eb3b5..d8963c981a3 100644 --- a/_sql/migrations/1608-add-voucher-configs.php +++ b/_sql/migrations/1608-add-voucher-configs.php @@ -1,4 +1,5 @@ addSql(sprintf($sql, serialize($options))); + $this->addSql(\sprintf($sql, serialize($options))); if ($modus === self::MODUS_UPDATE) { $sql = "INSERT INTO `s_core_config_values` (`element_id`, `shop_id`, `value`) diff --git a/_sql/migrations/1609-allow-longer-customergroup-keys.php b/_sql/migrations/1609-allow-longer-customergroup-keys.php index 313157ee3d0..819bc4bb600 100644 --- a/_sql/migrations/1609-allow-longer-customergroup-keys.php +++ b/_sql/migrations/1609-allow-longer-customergroup-keys.php @@ -1,4 +1,5 @@ addSql(sprintf("UPDATE `s_core_config_elements` SET `value` = '%s' WHERE `name` = 'update-api-endpoint'", serialize('https://update-api.shopware.com/v1/'))); - $this->addSql(sprintf("UPDATE `s_core_config_elements` SET `value` = '%s' WHERE `name` = 'update-feedback-api-endpoint'", serialize('https://feedback.update-api.shopware.com/v1/'))); + $this->addSql(\sprintf("UPDATE `s_core_config_elements` SET `value` = '%s' WHERE `name` = 'update-api-endpoint'", serialize('https://update-api.shopware.com/v1/'))); + $this->addSql(\sprintf("UPDATE `s_core_config_elements` SET `value` = '%s' WHERE `name` = 'update-feedback-api-endpoint'", serialize('https://feedback.update-api.shopware.com/v1/'))); } } diff --git a/_sql/migrations/1646-remove-sitemap-from-settings.php b/_sql/migrations/1646-remove-sitemap-from-settings.php index 283114bd95e..35bce44ee88 100644 --- a/_sql/migrations/1646-remove-sitemap-from-settings.php +++ b/_sql/migrations/1646-remove-sitemap-from-settings.php @@ -1,4 +1,5 @@ addSql(sprintf($sql, $this->shouldPageActive())); + $this->addSql(\sprintf($sql, $this->shouldPageActive())); $sql = <<connection->query(sprintf('SELECT id, value FROM s_core_config_elements WHERE name = "%s" LIMIT 1', $name))->fetch(PDO::FETCH_ASSOC); + $config = $this->connection->query(\sprintf('SELECT id, value FROM s_core_config_elements WHERE name = "%s" LIMIT 1', $name))->fetch(PDO::FETCH_ASSOC); $configId = (int) $config['id']; $default = unserialize($config['value'], ['allowed_classes' => false]); - $value = $this->connection->query(sprintf('SELECT `value` FROM s_core_config_values WHERE element_id = %d LIMIT 1', $configId))->fetchColumn(); + $value = $this->connection->query(\sprintf('SELECT `value` FROM s_core_config_values WHERE element_id = %d LIMIT 1', $configId))->fetchColumn(); if (!$value) { return $default; @@ -80,7 +80,7 @@ private function getConfigValue(string $name) private function enableOnInstallation(): void { - $this->connection->exec(sprintf('UPDATE s_core_config_elements SET value = "%s" WHERE name = "show_cookie_note"', serialize(true))); - $this->connection->exec(sprintf('UPDATE s_core_config_elements SET value = "%s" WHERE name = "cookie_note_mode"', serialize(1))); + $this->connection->exec(\sprintf('UPDATE s_core_config_elements SET value = "%s" WHERE name = "show_cookie_note"', serialize(true))); + $this->connection->exec(\sprintf('UPDATE s_core_config_elements SET value = "%s" WHERE name = "cookie_note_mode"', serialize(1))); } } diff --git a/_sql/migrations/1650-technical-support-menu.php b/_sql/migrations/1650-technical-support-menu.php index e0e37c7a12d..782e949f9ac 100644 --- a/_sql/migrations/1650-technical-support-menu.php +++ b/_sql/migrations/1650-technical-support-menu.php @@ -1,4 +1,5 @@ addSql('SET @parentFormId = (SELECT id FROM s_core_config_forms WHERE NAME = "Passwörter" AND parent_id=(SELECT id FROM s_core_config_forms WHERE NAME="Core") LIMIT 1)'); $sql = 'INSERT IGNORE INTO `s_core_config_elements` (`form_id`, `name`, `value`, `label`, `description`, `type`, `required`, `position`, `scope`, `options`) VALUES '; - $sql .= sprintf( + $sql .= \sprintf( "(@parentFormId, '%s', '%s', '%s', '%s', 'number', 1, 0, 0, '%s'),", 'argon2MemoryCost', serialize(PASSWORD_ARGON2_DEFAULT_MEMORY_COST), @@ -53,7 +53,7 @@ public function up($modus) 'Ein höherer Speicherverbrauch macht es einem möglichen Angreifer schwerer, ein passendes Klartext-Passwort zu erzeugen.', serialize(['minValue' => (string) (1 << 20), 'maxValue' => (string) (1 << 62)]) ); - $sql .= sprintf( + $sql .= \sprintf( "(@parentFormId, '%s', '%s', '%s', '%s', 'number', 1, 0, 0, '%s'),", 'argon2TimeCost', serialize(PASSWORD_ARGON2_DEFAULT_TIME_COST), @@ -61,7 +61,7 @@ public function up($modus) 'Ein höherer Zeitaufwand macht es einem möglichen Angreifer schwerer, ein passendes Klartext-Passwort zu erzeugen.', serialize(['minValue' => '1', 'maxValue' => '30']) ); - $sql .= sprintf( + $sql .= \sprintf( "(@parentFormId, '%s', '%s', '%s', '%s', 'number', 1, 0, 0, '%s');", 'argon2Threads', serialize(PASSWORD_ARGON2_DEFAULT_THREADS), @@ -79,21 +79,21 @@ public function up($modus) $sql = 'INSERT IGNORE INTO `s_core_config_element_translations` (`element_id`, `locale_id`, `label`, `description`) VALUES '; // memory - $sql .= sprintf( + $sql .= \sprintf( "(@elemArgon2MemoryCost, 2, '%s', '%s'),", 'Argon2 memory', 'Higher memory usage increases the security against attackers.' ); // time - $sql .= sprintf( + $sql .= \sprintf( "(@elemargon2TimeCost, 2, '%s', '%s'),", 'Argon2 time', 'Increasing the required time for hash calculation.' ); // threads - $sql .= sprintf( + $sql .= \sprintf( "(@elemargon2Threads, 2, '%s', '%s');", 'Argon2 threads', 'Use more threads for parallelism and therefore increased security against attackers, based on your setup.' diff --git a/_sql/migrations/1655-disable-html-minification-on-install.php b/_sql/migrations/1655-disable-html-minification-on-install.php index c2f66e73df3..17fe812bc50 100644 --- a/_sql/migrations/1655-disable-html-minification-on-install.php +++ b/_sql/migrations/1655-disable-html-minification-on-install.php @@ -1,4 +1,5 @@ addCacheEntry($row['value']); - $sql = sprintf('UPDATE `s_core_config_values` SET `value` = \'%s\' WHERE id = %d', $value, (int) $row['id']); + $sql = \sprintf('UPDATE `s_core_config_values` SET `value` = \'%s\' WHERE id = %d', $value, (int) $row['id']); $this->addSql($sql); } // Update default $value = $this->connection->query('SELECT `value` FROM s_core_config_elements WHERE `name` = "cacheControllers"')->fetchColumn(); $value = $this->addCacheEntry($value); - $this->addSql(sprintf('UPDATE s_core_config_elements SET `value` = \'%s\' WHERE `name` = "cacheControllers"', $value)); + $this->addSql(\sprintf('UPDATE s_core_config_elements SET `value` = \'%s\' WHERE `name` = "cacheControllers"', $value)); $sql = <<<'EOD' SET @plugin_id = (SELECT id FROM s_core_plugins WHERE name='HttpCache'); diff --git a/_sql/migrations/1702-no-more-invalid-dates.php b/_sql/migrations/1702-no-more-invalid-dates.php index bf86be205bd..a7ddd567a7a 100644 --- a/_sql/migrations/1702-no-more-invalid-dates.php +++ b/_sql/migrations/1702-no-more-invalid-dates.php @@ -1,4 +1,5 @@ addSql($sql); } diff --git a/_sql/migrations/1705-remove-facebook-plugin.php b/_sql/migrations/1705-remove-facebook-plugin.php index f5a89cbad52..9788d78d1c1 100644 --- a/_sql/migrations/1705-remove-facebook-plugin.php +++ b/_sql/migrations/1705-remove-facebook-plugin.php @@ -1,4 +1,5 @@ addSql(sprintf($sql, serialize('nocaptcha'))); + $this->addSql(\sprintf($sql, serialize('nocaptcha'))); // Translation $sql = <<<'EOD' diff --git a/_sql/migrations/1714-add-option-for-email-notification-captcha.php b/_sql/migrations/1714-add-option-for-email-notification-captcha.php index 754bca34dc0..e8b1f6e2701 100644 --- a/_sql/migrations/1714-add-option-for-email-notification-captcha.php +++ b/_sql/migrations/1714-add-option-for-email-notification-captcha.php @@ -1,4 +1,5 @@ addSql(sprintf($sql, serialize('nocaptcha'))); + $this->addSql(\sprintf($sql, serialize('nocaptcha'))); // Translation $sql = <<<'EOD' diff --git a/_sql/migrations/1715-add-collation.php b/_sql/migrations/1715-add-collation.php index 10b94335be3..1496579d390 100644 --- a/_sql/migrations/1715-add-collation.php +++ b/_sql/migrations/1715-add-collation.php @@ -1,4 +1,5 @@ 25, ]; - $sql = sprintf("UPDATE s_core_config_elements SET `options` = '%s' WHERE `name` = 'PageNotFoundDestination'", serialize($data)); + $sql = \sprintf("UPDATE s_core_config_elements SET `options` = '%s' WHERE `name` = 'PageNotFoundDestination'", serialize($data)); $this->addSql($sql); } } diff --git a/_sql/migrations/785-add-connect-default-menu.php b/_sql/migrations/785-add-connect-default-menu.php index 960242535ff..e4f5c27e9ee 100644 --- a/_sql/migrations/785-add-connect-default-menu.php +++ b/_sql/migrations/785-add-connect-default-menu.php @@ -1,4 +1,5 @@ addSql(sprintf($sql, serialize($captchaMethod))); + $this->addSql(\sprintf($sql, serialize($captchaMethod))); } } diff --git a/_sql/migrations/905-add-backend-listing-index.php b/_sql/migrations/905-add-backend-listing-index.php index 89d958e7fa3..6f6e84f1632 100644 --- a/_sql/migrations/905-add-backend-listing-index.php +++ b/_sql/migrations/905-add-backend-listing-index.php @@ -1,4 +1,5 @@ addSql(sprintf($sql, serialize('nocaptcha'))); + $this->addSql(\sprintf($sql, serialize('nocaptcha'))); $sql = <<<'EOD' SET @elementId = (SELECT id FROM `s_core_config_elements` WHERE `name` LIKE 'registerShowCaptcha' LIMIT 1); diff --git a/_sql/migrations/917-add-sorting-module.php b/_sql/migrations/917-add-sorting-module.php index 4e1e0c6484f..2a338a8ae2b 100644 --- a/_sql/migrations/917-add-sorting-module.php +++ b/_sql/migrations/917-add-sorting-module.php @@ -1,4 +1,5 @@ addSql(sprintf($sql, serialize('nocaptcha'))); + $this->addSql(\sprintf($sql, serialize('nocaptcha'))); $sql = <<<'EOD' SET @elementId = (SELECT id FROM `s_core_config_elements` WHERE `name` LIKE 'newsletterShowCaptcha' LIMIT 1); diff --git a/_sql/migrations/929-add-stream-rules.php b/_sql/migrations/929-add-stream-rules.php index 4629cd5fa4d..49a13f76d17 100644 --- a/_sql/migrations/929-add-stream-rules.php +++ b/_sql/migrations/929-add-stream-rules.php @@ -1,4 +1,5 @@ addSql(sprintf( + $this->addSql(\sprintf( "UPDATE `s_core_config_elements` SET `value` = '%s' WHERE `name` = 'noCacheControllers'", serialize($tags) )); @@ -59,7 +60,7 @@ public function up($modus) $controller .= ',slt'; } } - $this->addSql(sprintf( + $this->addSql(\sprintf( "UPDATE s_core_config_values SET value = '%s' WHERE id = " . $value['id'], serialize(implode("\n", $controllers)) )); diff --git a/_sql/migrations/933-add-customer-stream-menu.php b/_sql/migrations/933-add-customer-stream-menu.php index 67be3823fbc..dbf9ec8678c 100644 --- a/_sql/migrations/933-add-customer-stream-menu.php +++ b/_sql/migrations/933-add-customer-stream-menu.php @@ -1,4 +1,5 @@ addSql(sprintf( + $this->addSql(\sprintf( "UPDATE `s_core_config_elements` SET `value` = '%s' WHERE `name` = 'cacheControllers'", serialize($tags) )); @@ -68,7 +69,7 @@ public function up($modus) $value = implode("\n", $value); $value = serialize($value); - $sql = sprintf("UPDATE `s_core_config_values` SET `value` = '%s' WHERE id = " . (int) $row['id'], $value); + $sql = \sprintf("UPDATE `s_core_config_values` SET `value` = '%s' WHERE id = " . (int) $row['id'], $value); $this->addSql($sql); } } diff --git a/_sql/migrations/936-remove-stream-index.php b/_sql/migrations/936-remove-stream-index.php index d1059f9354f..3e5b68d035c 100644 --- a/_sql/migrations/936-remove-stream-index.php +++ b/_sql/migrations/936-remove-stream-index.php @@ -1,4 +1,5 @@ addSql('SET @id = (SELECT `id` FROM `s_core_config_elements` WHERE `name`="routercampaigntemplate");'); - $this->addSql(sprintf("UPDATE `s_core_config_elements` SET `value`='%s' WHERE `id`=@id AND md5(`value`)='bbd170aeaa1f52b8c372b32d8c853e9e'", $template)); - $this->addSql(sprintf("UPDATE `s_core_config_values` SET `value`='%s' WHERE `element_id`=@id AND md5(`value`)='bbd170aeaa1f52b8c372b32d8c853e9e'", $template)); + $this->addSql(\sprintf("UPDATE `s_core_config_elements` SET `value`='%s' WHERE `id`=@id AND md5(`value`)='bbd170aeaa1f52b8c372b32d8c853e9e'", $template)); + $this->addSql(\sprintf("UPDATE `s_core_config_values` SET `value`='%s' WHERE `element_id`=@id AND md5(`value`)='bbd170aeaa1f52b8c372b32d8c853e9e'", $template)); // 'bbd170aeaa1f52b8c372b32d8c853e9e' = md5('s:64:"{sCategoryPath categoryID=$campaign.categoryId}/{$campaign.name}";') } } diff --git a/_sql/migrations/964-translate-slt-setting.php b/_sql/migrations/964-translate-slt-setting.php index 5c37a62e38c..d93cb2b6909 100644 --- a/_sql/migrations/964-translate-slt-setting.php +++ b/_sql/migrations/964-translate-slt-setting.php @@ -1,4 +1,5 @@ connection->query(sprintf('DESCRIBE `%s`', $table))->fetchAll(PDO::FETCH_ASSOC); + $columns = $this->connection->query(\sprintf('DESCRIBE `%s`', $table))->fetchAll(PDO::FETCH_ASSOC); $definition = []; @@ -112,13 +113,13 @@ public function migrateAttributes($table, $keyColumn) private function createColumn(string $table, string $name, string $type): void { - $sql = sprintf('ALTER TABLE `%s` ADD `%s` %s NULL DEFAULT NULL', $table, $name, $type); + $sql = \sprintf('ALTER TABLE `%s` ADD `%s` %s NULL DEFAULT NULL', $table, $name, $type); $this->connection->exec($sql); } private function changeColumn(string $table, string $name, string $type): void { - $sql = sprintf('ALTER TABLE `%s` CHANGE `%s` `%s` %s NULL DEFAULT NULL;', $table, $name, $name, $type); + $sql = \sprintf('ALTER TABLE `%s` CHANGE `%s` `%s` %s NULL DEFAULT NULL;', $table, $name, $name, $type); $this->connection->exec($sql); } diff --git a/composer.json b/composer.json index c3f059de52f..04b5f2be66f 100644 --- a/composer.json +++ b/composer.json @@ -38,36 +38,36 @@ "lib-libxml": "*", "composer-runtime-api": "^2.0", "bcremer/line-reader": "1.3.0", - "beberlei/assert": "3.3.2", + "beberlei/assert": "3.3.3", "beberlei/doctrineextensions": "1.4.0", "cocur/slugify": "4.3.0 || 4.6.0", "doctrine/annotations": "1.14.4", "doctrine/cache": "1.13.0", "doctrine/collections": "1.8.0", - "doctrine/common": "3.4.5", + "doctrine/common": "3.5.0", "doctrine/dbal": "2.13.9", "doctrine/event-manager": "1.2.0", "doctrine/inflector": "2.0.10", "doctrine/orm": "2.15.5", - "doctrine/persistence": "3.3.3", + "doctrine/persistence": "3.4.0", "elasticsearch/elasticsearch": "^7", "fig/link-util": "1.1.2", "friendsofphp/proxy-manager-lts": "1.0.18", "google/cloud-storage": "1.39.0", "guzzlehttp/guzzle": "~7.9.0", "guzzlehttp/psr7": "~2.7.0", - "laminas/laminas-code": "4.7.1 || 4.15.1", + "laminas/laminas-code": "4.7.1 || 4.16.0", "laminas/laminas-escaper": "2.12.0 || 2.15.0", "league/flysystem": "~1.1.4", "league/flysystem-aws-s3-v3": "1.0.30", - "monolog/monolog": "2.9.3", + "monolog/monolog": "2.10.0", "mpdf/mpdf": "8.2.4", "ongr/elasticsearch-dsl": "7.2.2", "psr/link": "1.0.0", "psr/log": "1.1.4", "ramsey/uuid": "4.2.3", "setasign/fpdf": "1.8.6", - "setasign/fpdi": "2.6.1", + "setasign/fpdi": "2.6.2", "stecman/symfony-console-completion": "0.11.0", "superbalist/flysystem-google-storage": "7.2.2", "symfony/config": "~4.4.34", @@ -89,7 +89,7 @@ "symfony/validator": "~4.4.34", "symfony/web-link": "~4.4.27", "voku/anti-xss": "~4.1.41", - "wikimedia/less.php": "5.1.1" + "wikimedia/less.php": "5.1.2" }, "replace": { "paragonie/random_compat": "*", @@ -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.10", - "phpstan/phpstan-doctrine": "1.5.6", - "phpstan/phpstan-phpunit": "1.4.1", - "phpstan/phpstan-symfony": "1.4.12", + "phpstan/phpstan": "1.12.15", + "phpstan/phpstan-doctrine": "1.5.7", + "phpstan/phpstan-phpunit": "1.4.2", + "phpstan/phpstan-symfony": "1.4.13", "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 d471829d5f0..93e53bdd618 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": "e78105472053571c649e96385833fafa", + "content-hash": "2839325710331b36d35f8caed7c2dcd3", "packages": [ { "name": "aws/aws-crt-php", @@ -62,16 +62,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.325.4", + "version": "3.336.12", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "86372984539f25485718059f997a4ea12c05ba0a" + "reference": "a173ab3af8d9186d266e4937d8254597f36a9e15" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/86372984539f25485718059f997a4ea12c05ba0a", - "reference": "86372984539f25485718059f997a4ea12c05ba0a", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/a173ab3af8d9186d266e4937d8254597f36a9e15", + "reference": "a173ab3af8d9186d266e4937d8254597f36a9e15", "shasum": "" }, "require": { @@ -100,8 +100,8 @@ "nette/neon": "^2.3", "paragonie/random_compat": ">= 2", "phpunit/phpunit": "^5.6.3 || ^8.5 || ^9.5", - "psr/cache": "^1.0", - "psr/simple-cache": "^1.0", + "psr/cache": "^1.0 || ^2.0 || ^3.0", + "psr/simple-cache": "^1.0 || ^2.0 || ^3.0", "sebastian/comparator": "^1.2.3 || ^4.0", "yoast/phpunit-polyfills": "^1.0" }, @@ -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.325.4" + "source": "https://github.com/aws/aws-sdk-php/tree/3.336.12" }, - "time": "2024-11-07T19:25:01+00:00" + "time": "2025-01-09T19:04:34+00:00" }, { "name": "bcremer/line-reader", @@ -207,16 +207,16 @@ }, { "name": "beberlei/assert", - "version": "v3.3.2", + "version": "v3.3.3", "source": { "type": "git", "url": "https://github.com/beberlei/assert.git", - "reference": "cb70015c04be1baee6f5f5c953703347c0ac1655" + "reference": "b5fd8eacd8915a1b627b8bfc027803f1939734dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/beberlei/assert/zipball/cb70015c04be1baee6f5f5c953703347c0ac1655", - "reference": "cb70015c04be1baee6f5f5c953703347c0ac1655", + "url": "https://api.github.com/repos/beberlei/assert/zipball/b5fd8eacd8915a1b627b8bfc027803f1939734dd", + "reference": "b5fd8eacd8915a1b627b8bfc027803f1939734dd", "shasum": "" }, "require": { @@ -224,7 +224,7 @@ "ext-json": "*", "ext-mbstring": "*", "ext-simplexml": "*", - "php": "^7.0 || ^8.0" + "php": "^7.1 || ^8.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "*", @@ -268,9 +268,9 @@ ], "support": { "issues": "https://github.com/beberlei/assert/issues", - "source": "https://github.com/beberlei/assert/tree/v3.3.2" + "source": "https://github.com/beberlei/assert/tree/v3.3.3" }, - "time": "2021-12-16T21:41:27+00:00" + "time": "2024-07-15T13:18:35+00:00" }, { "name": "beberlei/doctrineextensions", @@ -713,20 +713,20 @@ }, { "name": "doctrine/common", - "version": "3.4.5", + "version": "3.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/common.git", - "reference": "6c8fef961f67b8bc802ce3e32e3ebd1022907286" + "reference": "d9ea4a54ca2586db781f0265d36bea731ac66ec5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/common/zipball/6c8fef961f67b8bc802ce3e32e3ebd1022907286", - "reference": "6c8fef961f67b8bc802ce3e32e3ebd1022907286", + "url": "https://api.github.com/repos/doctrine/common/zipball/d9ea4a54ca2586db781f0265d36bea731ac66ec5", + "reference": "d9ea4a54ca2586db781f0265d36bea731ac66ec5", "shasum": "" }, "require": { - "doctrine/persistence": "^2.0 || ^3.0", + "doctrine/persistence": "^2.0 || ^3.0 || ^4.0", "php": "^7.1 || ^8.0" }, "require-dev": { @@ -784,7 +784,7 @@ ], "support": { "issues": "https://github.com/doctrine/common/issues", - "source": "https://github.com/doctrine/common/tree/3.4.5" + "source": "https://github.com/doctrine/common/tree/3.5.0" }, "funding": [ { @@ -800,7 +800,7 @@ "type": "tidelift" } ], - "time": "2024-10-08T15:53:43+00:00" + "time": "2025-01-01T22:12:03+00:00" }, { "name": "doctrine/dbal", @@ -913,29 +913,27 @@ }, { "name": "doctrine/deprecations", - "version": "1.1.3", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9", + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", - "phpstan/phpstan": "1.4.10 || 1.10.15", - "phpstan/phpstan-phpunit": "^1.0", + "doctrine/coding-standard": "^9 || ^12", + "phpstan/phpstan": "1.4.10 || 2.0.3", + "phpstan/phpstan-phpunit": "^1.0 || ^2", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "psalm/plugin-phpunit": "0.18.4", - "psr/log": "^1 || ^2 || ^3", - "vimeo/psalm": "4.30.0 || 5.12.0" + "psr/log": "^1 || ^2 || ^3" }, "suggest": { "psr/log": "Allows logging deprecations via PSR-3 logger implementation" @@ -943,7 +941,7 @@ "type": "library", "autoload": { "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + "Doctrine\\Deprecations\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -954,9 +952,9 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.3" + "source": "https://github.com/doctrine/deprecations/tree/1.1.4" }, - "time": "2024-01-30T19:34:25+00:00" + "time": "2024-12-07T21:18:45+00:00" }, { "name": "doctrine/event-manager", @@ -1392,16 +1390,16 @@ }, { "name": "doctrine/persistence", - "version": "3.3.3", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/doctrine/persistence.git", - "reference": "b337726451f5d530df338fc7f68dee8781b49779" + "reference": "0ea965320cec355dba75031c1b23d4c78362e3ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/persistence/zipball/b337726451f5d530df338fc7f68dee8781b49779", - "reference": "b337726451f5d530df338fc7f68dee8781b49779", + "url": "https://api.github.com/repos/doctrine/persistence/zipball/0ea965320cec355dba75031c1b23d4c78362e3ff", + "reference": "0ea965320cec355dba75031c1b23d4c78362e3ff", "shasum": "" }, "require": { @@ -1415,12 +1413,11 @@ "require-dev": { "doctrine/coding-standard": "^12", "doctrine/common": "^3.0", - "phpstan/phpstan": "1.11.1", + "phpstan/phpstan": "1.12.7", "phpstan/phpstan-phpunit": "^1", "phpstan/phpstan-strict-rules": "^1.1", - "phpunit/phpunit": "^8.5 || ^9.5", - "symfony/cache": "^4.4 || ^5.4 || ^6.0", - "vimeo/psalm": "4.30.0 || 5.24.0" + "phpunit/phpunit": "^8.5.38 || ^9.5", + "symfony/cache": "^4.4 || ^5.4 || ^6.0 || ^7.0" }, "type": "library", "autoload": { @@ -1469,7 +1466,7 @@ ], "support": { "issues": "https://github.com/doctrine/persistence/issues", - "source": "https://github.com/doctrine/persistence/tree/3.3.3" + "source": "https://github.com/doctrine/persistence/tree/3.4.0" }, "funding": [ { @@ -1485,7 +1482,7 @@ "type": "tidelift" } ], - "time": "2024-06-20T10:14:30+00:00" + "time": "2024-10-30T19:48:12+00:00" }, { "name": "elasticsearch/elasticsearch", @@ -1821,8 +1818,8 @@ "type": "library", "extra": { "thanks": { - "name": "ocramius/proxy-manager", - "url": "https://github.com/Ocramius/ProxyManager" + "url": "https://github.com/Ocramius/ProxyManager", + "name": "ocramius/proxy-manager" } }, "autoload": { @@ -1872,16 +1869,16 @@ }, { "name": "google/auth", - "version": "v1.37.1", + "version": "v1.37.2", "source": { "type": "git", "url": "https://github.com/googleapis/google-auth-library-php.git", - "reference": "1a7de77b72e6ac60dccf0e6478c4c1005bb0ff46" + "reference": "25eed0045d8cf107424a8b9010c9fdcc0734ceb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/1a7de77b72e6ac60dccf0e6478c4c1005bb0ff46", - "reference": "1a7de77b72e6ac60dccf0e6478c4c1005bb0ff46", + "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/25eed0045d8cf107424a8b9010c9fdcc0734ceb0", + "reference": "25eed0045d8cf107424a8b9010c9fdcc0734ceb0", "shasum": "" }, "require": { @@ -1924,9 +1921,9 @@ "support": { "docs": "https://googleapis.github.io/google-auth-library-php/main/", "issues": "https://github.com/googleapis/google-auth-library-php/issues", - "source": "https://github.com/googleapis/google-auth-library-php/tree/v1.37.1" + "source": "https://github.com/googleapis/google-auth-library-php/tree/v1.37.2" }, - "time": "2024-04-03T18:41:12+00:00" + "time": "2024-12-11T18:15:11+00:00" }, { "name": "google/cloud-core", @@ -1974,9 +1971,9 @@ "extra": { "component": { "id": "cloud-core", - "target": "googleapis/google-cloud-php-core.git", "path": "Core", - "entry": "src/ServiceBuilder.php" + "entry": "src/ServiceBuilder.php", + "target": "googleapis/google-cloud-php-core.git" } }, "autoload": { @@ -2031,9 +2028,9 @@ "extra": { "component": { "id": "cloud-storage", - "target": "googleapis/google-cloud-php-storage.git", "path": "Storage", - "entry": "src/StorageClient.php" + "entry": "src/StorageClient.php", + "target": "googleapis/google-cloud-php-storage.git" } }, "autoload": { @@ -2105,16 +2102,16 @@ }, { "name": "google/gax", - "version": "v1.29.1", + "version": "v1.29.2", "source": { "type": "git", "url": "https://github.com/googleapis/gax-php.git", - "reference": "54a863e63ee318308637adb283f6157ccc3aabbb" + "reference": "e400e2432475f0ab85d3fdd6eddbc995ba787a21" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/gax-php/zipball/54a863e63ee318308637adb283f6157ccc3aabbb", - "reference": "54a863e63ee318308637adb283f6157ccc3aabbb", + "url": "https://api.github.com/repos/googleapis/gax-php/zipball/e400e2432475f0ab85d3fdd6eddbc995ba787a21", + "reference": "e400e2432475f0ab85d3fdd6eddbc995ba787a21", "shasum": "" }, "require": { @@ -2154,9 +2151,9 @@ ], "support": { "issues": "https://github.com/googleapis/gax-php/issues", - "source": "https://github.com/googleapis/gax-php/tree/v1.29.1" + "source": "https://github.com/googleapis/gax-php/tree/v1.29.2" }, - "time": "2024-02-26T19:15:41+00:00" + "time": "2024-12-11T18:10:54+00:00" }, { "name": "google/grpc-gcp", @@ -2205,20 +2202,20 @@ }, { "name": "google/longrunning", - "version": "0.4.4", + "version": "0.4.6", "source": { "type": "git", "url": "https://github.com/googleapis/php-longrunning.git", - "reference": "ce921cf2a59082b09ab04f36b1afef4686c3a9ab" + "reference": "4eb04d47bba8095d5a47f75334b9204c2a4a7ac6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/php-longrunning/zipball/ce921cf2a59082b09ab04f36b1afef4686c3a9ab", - "reference": "ce921cf2a59082b09ab04f36b1afef4686c3a9ab", + "url": "https://api.github.com/repos/googleapis/php-longrunning/zipball/4eb04d47bba8095d5a47f75334b9204c2a4a7ac6", + "reference": "4eb04d47bba8095d5a47f75334b9204c2a4a7ac6", "shasum": "" }, "require-dev": { - "google/gax": "^1.34.0", + "google/gax": "^1.36.0", "phpunit/phpunit": "^9.0" }, "type": "library", @@ -2243,9 +2240,9 @@ ], "description": "Google LongRunning Client for PHP", "support": { - "source": "https://github.com/googleapis/php-longrunning/tree/v0.4.4" + "source": "https://github.com/googleapis/php-longrunning/tree/v0.4.6" }, - "time": "2024-11-06T21:50:43+00:00" + "time": "2024-12-12T21:15:35+00:00" }, { "name": "google/protobuf", @@ -3005,16 +3002,16 @@ }, { "name": "monolog/monolog", - "version": "2.9.3", + "version": "2.10.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "a30bfe2e142720dfa990d0a7e573997f5d884215" + "reference": "5cf826f2991858b54d5c3809bee745560a1042a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/a30bfe2e142720dfa990d0a7e573997f5d884215", - "reference": "a30bfe2e142720dfa990d0a7e573997f5d884215", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/5cf826f2991858b54d5c3809bee745560a1042a7", + "reference": "5cf826f2991858b54d5c3809bee745560a1042a7", "shasum": "" }, "require": { @@ -3091,7 +3088,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/2.9.3" + "source": "https://github.com/Seldaek/monolog/tree/2.10.0" }, "funding": [ { @@ -3103,7 +3100,7 @@ "type": "tidelift" } ], - "time": "2024-04-12T20:52:51+00:00" + "time": "2024-11-12T12:43:37+00:00" }, { "name": "mpdf/mpdf", @@ -3346,16 +3343,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.12.0", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", "shasum": "" }, "require": { @@ -3394,7 +3391,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" }, "funding": [ { @@ -3402,7 +3399,7 @@ "type": "tidelift" } ], - "time": "2024-06-12T14:39:25+00:00" + "time": "2024-11-08T17:47:46+00:00" }, { "name": "ongr/elasticsearch-dsl", @@ -4006,11 +4003,11 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "4.x-dev" - }, "captainhook": { "force-install": true + }, + "branch-alias": { + "dev-main": "4.x-dev" } }, "autoload": { @@ -4229,16 +4226,16 @@ }, { "name": "setasign/fpdi", - "version": "v2.6.1", + "version": "v2.6.2", "source": { "type": "git", "url": "https://github.com/Setasign/FPDI.git", - "reference": "09a816004fcee9ed3405bd164147e3fdbb79a56f" + "reference": "9e013b376939c0d4029f54150d2a16f3c67a5797" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Setasign/FPDI/zipball/09a816004fcee9ed3405bd164147e3fdbb79a56f", - "reference": "09a816004fcee9ed3405bd164147e3fdbb79a56f", + "url": "https://api.github.com/repos/Setasign/FPDI/zipball/9e013b376939c0d4029f54150d2a16f3c67a5797", + "reference": "9e013b376939c0d4029f54150d2a16f3c67a5797", "shasum": "" }, "require": { @@ -4289,7 +4286,7 @@ ], "support": { "issues": "https://github.com/Setasign/FPDI/issues", - "source": "https://github.com/Setasign/FPDI/tree/v2.6.1" + "source": "https://github.com/Setasign/FPDI/tree/v2.6.2" }, "funding": [ { @@ -4297,7 +4294,7 @@ "type": "tidelift" } ], - "time": "2024-09-02T10:17:15+00:00" + "time": "2024-12-10T13:12:19+00:00" }, { "name": "stecman/symfony-console-completion", @@ -4498,16 +4495,16 @@ }, { "name": "symfony/cache-contracts", - "version": "v2.5.3", + "version": "v2.5.4", "source": { "type": "git", "url": "https://github.com/symfony/cache-contracts.git", - "reference": "fee6db04d913094e2fb55ff8e7db5685a8134463" + "reference": "517c3a3619dadfa6952c4651767fcadffb4df65e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/fee6db04d913094e2fb55ff8e7db5685a8134463", - "reference": "fee6db04d913094e2fb55ff8e7db5685a8134463", + "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/517c3a3619dadfa6952c4651767fcadffb4df65e", + "reference": "517c3a3619dadfa6952c4651767fcadffb4df65e", "shasum": "" }, "require": { @@ -4519,12 +4516,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -4557,7 +4554,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/cache-contracts/tree/v2.5.3" + "source": "https://github.com/symfony/cache-contracts/tree/v2.5.4" }, "funding": [ { @@ -4573,7 +4570,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/config", @@ -4900,16 +4897,16 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.3", + "version": "v2.5.4", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "80d075412b557d41002320b96a096ca65aa2c98d" + "reference": "605389f2a7e5625f273b53960dc46aeaf9c62918" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/80d075412b557d41002320b96a096ca65aa2c98d", - "reference": "80d075412b557d41002320b96a096ca65aa2c98d", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/605389f2a7e5625f273b53960dc46aeaf9c62918", + "reference": "605389f2a7e5625f273b53960dc46aeaf9c62918", "shasum": "" }, "require": { @@ -4917,12 +4914,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -4947,7 +4944,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.3" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.4" }, "funding": [ { @@ -4963,7 +4960,7 @@ "type": "tidelift" } ], - "time": "2023-01-24T14:02:46+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/error-handler", @@ -5140,12 +5137,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "1.1-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -5484,16 +5481,16 @@ }, { "name": "symfony/http-client-contracts", - "version": "v2.5.3", + "version": "v2.5.5", "source": { "type": "git", "url": "https://github.com/symfony/http-client-contracts.git", - "reference": "e5cc97c2b4a4db0ba26bebc154f1426e3fd1d2f1" + "reference": "48ef1d0a082885877b664332b9427662065a360c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/e5cc97c2b4a4db0ba26bebc154f1426e3fd1d2f1", - "reference": "e5cc97c2b4a4db0ba26bebc154f1426e3fd1d2f1", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/48ef1d0a082885877b664332b9427662065a360c", + "reference": "48ef1d0a082885877b664332b9427662065a360c", "shasum": "" }, "require": { @@ -5504,12 +5501,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -5542,7 +5539,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/http-client-contracts/tree/v2.5.3" + "source": "https://github.com/symfony/http-client-contracts/tree/v2.5.5" }, "funding": [ { @@ -5558,7 +5555,7 @@ "type": "tidelift" } ], - "time": "2024-03-26T19:42:53+00:00" + "time": "2024-11-28T08:37:04+00:00" }, { "name": "symfony/http-foundation", @@ -5734,16 +5731,16 @@ }, { "name": "symfony/intl", - "version": "v5.4.46", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/intl.git", - "reference": "d74763310045ccf2bf485549f8ba942184e31087" + "reference": "5258476a3ab680cd633a1d23130fcc9e8027e3ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/intl/zipball/d74763310045ccf2bf485549f8ba942184e31087", - "reference": "d74763310045ccf2bf485549f8ba942184e31087", + "url": "https://api.github.com/repos/symfony/intl/zipball/5258476a3ab680cd633a1d23130fcc9e8027e3ff", + "reference": "5258476a3ab680cd633a1d23130fcc9e8027e3ff", "shasum": "" }, "require": { @@ -5804,7 +5801,7 @@ "localization" ], "support": { - "source": "https://github.com/symfony/intl/tree/v5.4.46" + "source": "https://github.com/symfony/intl/tree/v5.4.47" }, "funding": [ { @@ -5820,7 +5817,7 @@ "type": "tidelift" } ], - "time": "2024-11-05T14:12:18+00:00" + "time": "2024-11-08T08:12:23+00:00" }, { "name": "symfony/mime", @@ -5997,8 +5994,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -6076,8 +6073,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -6158,8 +6155,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -6236,8 +6233,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -6316,8 +6313,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -6392,8 +6389,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -6468,8 +6465,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -6526,16 +6523,16 @@ }, { "name": "symfony/process", - "version": "v5.4.46", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "01906871cb9b5e3cf872863b91aba4ec9767daf4" + "reference": "5d1662fb32ebc94f17ddb8d635454a776066733d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/01906871cb9b5e3cf872863b91aba4ec9767daf4", - "reference": "01906871cb9b5e3cf872863b91aba4ec9767daf4", + "url": "https://api.github.com/repos/symfony/process/zipball/5d1662fb32ebc94f17ddb8d635454a776066733d", + "reference": "5d1662fb32ebc94f17ddb8d635454a776066733d", "shasum": "" }, "require": { @@ -6568,7 +6565,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.46" + "source": "https://github.com/symfony/process/tree/v5.4.47" }, "funding": [ { @@ -6584,7 +6581,7 @@ "type": "tidelift" } ], - "time": "2024-11-06T09:18:28+00:00" + "time": "2024-11-06T11:36:42+00:00" }, { "name": "symfony/property-access", @@ -6669,16 +6666,16 @@ }, { "name": "symfony/property-info", - "version": "v5.4.45", + "version": "v5.4.48", "source": { "type": "git", "url": "https://github.com/symfony/property-info.git", - "reference": "cec75362b20263758c9c7af4c2f9af82614195ae" + "reference": "a0396295ad585f95fccd690bc6a281e5bd303902" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-info/zipball/cec75362b20263758c9c7af4c2f9af82614195ae", - "reference": "cec75362b20263758c9c7af4c2f9af82614195ae", + "url": "https://api.github.com/repos/symfony/property-info/zipball/a0396295ad585f95fccd690bc6a281e5bd303902", + "reference": "a0396295ad585f95fccd690bc6a281e5bd303902", "shasum": "" }, "require": { @@ -6695,7 +6692,7 @@ "require-dev": { "doctrine/annotations": "^1.10.4|^2", "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", - "phpstan/phpdoc-parser": "^1.0", + "phpstan/phpdoc-parser": "^1.0|^2.0", "symfony/cache": "^4.4|^5.0|^6.0", "symfony/dependency-injection": "^4.4|^5.0|^6.0", "symfony/serializer": "^4.4|^5.0|^6.0" @@ -6740,7 +6737,7 @@ "validator" ], "support": { - "source": "https://github.com/symfony/property-info/tree/v5.4.45" + "source": "https://github.com/symfony/property-info/tree/v5.4.48" }, "funding": [ { @@ -6756,7 +6753,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:11:13+00:00" + "time": "2024-11-25T16:14:41+00:00" }, { "name": "symfony/serializer", @@ -6863,16 +6860,16 @@ }, { "name": "symfony/service-contracts", - "version": "v2.5.3", + "version": "v2.5.4", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "a2329596ddc8fd568900e3fc76cba42489ecc7f3" + "reference": "f37b419f7aea2e9abf10abd261832cace12e3300" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/a2329596ddc8fd568900e3fc76cba42489ecc7f3", - "reference": "a2329596ddc8fd568900e3fc76cba42489ecc7f3", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f37b419f7aea2e9abf10abd261832cace12e3300", + "reference": "f37b419f7aea2e9abf10abd261832cace12e3300", "shasum": "" }, "require": { @@ -6888,12 +6885,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -6926,7 +6923,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.3" + "source": "https://github.com/symfony/service-contracts/tree/v2.5.4" }, "funding": [ { @@ -6942,20 +6939,20 @@ "type": "tidelift" } ], - "time": "2023-04-21T15:04:16+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/string", - "version": "v5.4.45", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "7f6807add88b1e2635f3c6de5e1ace631ed7cad2" + "reference": "136ca7d72f72b599f2631aca474a4f8e26719799" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/7f6807add88b1e2635f3c6de5e1ace631ed7cad2", - "reference": "7f6807add88b1e2635f3c6de5e1ace631ed7cad2", + "url": "https://api.github.com/repos/symfony/string/zipball/136ca7d72f72b599f2631aca474a4f8e26719799", + "reference": "136ca7d72f72b599f2631aca474a4f8e26719799", "shasum": "" }, "require": { @@ -7012,7 +7009,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.45" + "source": "https://github.com/symfony/string/tree/v5.4.47" }, "funding": [ { @@ -7028,20 +7025,20 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:11:13+00:00" + "time": "2024-11-10T20:33:58+00:00" }, { "name": "symfony/translation-contracts", - "version": "v2.5.3", + "version": "v2.5.4", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "b0073a77ac0b7ea55131020e87b1e3af540f4664" + "reference": "450d4172653f38818657022252f9d81be89ee9a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/b0073a77ac0b7ea55131020e87b1e3af540f4664", - "reference": "b0073a77ac0b7ea55131020e87b1e3af540f4664", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/450d4172653f38818657022252f9d81be89ee9a8", + "reference": "450d4172653f38818657022252f9d81be89ee9a8", "shasum": "" }, "require": { @@ -7052,12 +7049,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -7090,7 +7087,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v2.5.3" + "source": "https://github.com/symfony/translation-contracts/tree/v2.5.4" }, "funding": [ { @@ -7106,7 +7103,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/validator", @@ -7216,16 +7213,16 @@ }, { "name": "symfony/var-dumper", - "version": "v5.4.46", + "version": "v5.4.48", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "f51f11e4fc5ca24fa0defcdf4df027078950b9e0" + "reference": "42f18f170aa86d612c3559cfb3bd11a375df32c8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/f51f11e4fc5ca24fa0defcdf4df027078950b9e0", - "reference": "f51f11e4fc5ca24fa0defcdf4df027078950b9e0", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/42f18f170aa86d612c3559cfb3bd11a375df32c8", + "reference": "42f18f170aa86d612c3559cfb3bd11a375df32c8", "shasum": "" }, "require": { @@ -7285,7 +7282,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.4.46" + "source": "https://github.com/symfony/var-dumper/tree/v5.4.48" }, "funding": [ { @@ -7301,7 +7298,7 @@ "type": "tidelift" } ], - "time": "2024-11-05T14:17:06+00:00" + "time": "2024-11-08T15:21:10+00:00" }, { "name": "symfony/var-exporter", @@ -7550,16 +7547,16 @@ }, { "name": "voku/portable-ascii", - "version": "2.0.1", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/voku/portable-ascii.git", - "reference": "b56450eed252f6801410d810c8e1727224ae0743" + "reference": "b1d923f88091c6bf09699efcd7c8a1b1bfd7351d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/voku/portable-ascii/zipball/b56450eed252f6801410d810c8e1727224ae0743", - "reference": "b56450eed252f6801410d810c8e1727224ae0743", + "url": "https://api.github.com/repos/voku/portable-ascii/zipball/b1d923f88091c6bf09699efcd7c8a1b1bfd7351d", + "reference": "b1d923f88091c6bf09699efcd7c8a1b1bfd7351d", "shasum": "" }, "require": { @@ -7584,7 +7581,7 @@ "authors": [ { "name": "Lars Moelleken", - "homepage": "http://www.moelleken.org/" + "homepage": "https://www.moelleken.org/" } ], "description": "Portable ASCII library - performance optimized (ascii) string functions for php.", @@ -7596,7 +7593,7 @@ ], "support": { "issues": "https://github.com/voku/portable-ascii/issues", - "source": "https://github.com/voku/portable-ascii/tree/2.0.1" + "source": "https://github.com/voku/portable-ascii/tree/2.0.3" }, "funding": [ { @@ -7620,7 +7617,7 @@ "type": "tidelift" } ], - "time": "2022-03-08T17:03:00+00:00" + "time": "2024-11-21T01:49:47+00:00" }, { "name": "voku/portable-utf8", @@ -7727,23 +7724,23 @@ }, { "name": "wikimedia/less.php", - "version": "v5.1.1", + "version": "v5.1.2", "source": { "type": "git", "url": "https://github.com/wikimedia/less.php.git", - "reference": "29e14517d40b321bdbf8823eae1c327fc6b227f5" + "reference": "39b1fbbdd3d95c5279f231d2298f3866fa869fcd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wikimedia/less.php/zipball/29e14517d40b321bdbf8823eae1c327fc6b227f5", - "reference": "29e14517d40b321bdbf8823eae1c327fc6b227f5", + "url": "https://api.github.com/repos/wikimedia/less.php/zipball/39b1fbbdd3d95c5279f231d2298f3866fa869fcd", + "reference": "39b1fbbdd3d95c5279f231d2298f3866fa869fcd", "shasum": "" }, "require": { "php": ">=7.4.3" }, "require-dev": { - "mediawiki/mediawiki-codesniffer": "43.0.0", + "mediawiki/mediawiki-codesniffer": "45.0.0", "mediawiki/mediawiki-phan-config": "0.14.0", "mediawiki/minus-x": "1.1.3", "php-parallel-lint/php-console-highlighter": "1.0.0", @@ -7796,9 +7793,9 @@ ], "support": { "issues": "https://github.com/wikimedia/less.php/issues", - "source": "https://github.com/wikimedia/less.php/tree/v5.1.1" + "source": "https://github.com/wikimedia/less.php/tree/v5.1.2" }, - "time": "2024-08-09T13:59:17+00:00" + "time": "2024-11-13T15:44:20+00:00" } ], "packages-dev": [ @@ -8405,16 +8402,16 @@ }, { "name": "nikic/php-parser", - "version": "v5.3.1", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b" + "reference": "447a020a1f875a434d62f2a401f53b82a396e494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8eea230464783aa9671db8eea6f8c6ac5285794b", - "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494", + "reference": "447a020a1f875a434d62f2a401f53b82a396e494", "shasum": "" }, "require": { @@ -8457,9 +8454,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.3.1" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0" }, - "time": "2024-10-08T18:51:32+00:00" + "time": "2024-12-30T11:07:19+00:00" }, { "name": "phar-io/manifest", @@ -8682,16 +8679,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.12.10", + "version": "1.12.15", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "fc463b5d0fe906dcf19689be692c65c50406a071" + "reference": "c91d4e8bc056f46cf653656e6f71004b254574d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/fc463b5d0fe906dcf19689be692c65c50406a071", - "reference": "fc463b5d0fe906dcf19689be692c65c50406a071", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/c91d4e8bc056f46cf653656e6f71004b254574d1", + "reference": "c91d4e8bc056f46cf653656e6f71004b254574d1", "shasum": "" }, "require": { @@ -8736,25 +8733,25 @@ "type": "github" } ], - "time": "2024-11-11T15:37:09+00:00" + "time": "2025-01-05T16:40:22+00:00" }, { "name": "phpstan/phpstan-doctrine", - "version": "1.5.6", + "version": "1.5.7", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-doctrine.git", - "reference": "8ba022846e79238872e315fff61e19b42ba2f139" + "reference": "231d3f795ed5ef54c98961fd3958868cbe091207" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-doctrine/zipball/8ba022846e79238872e315fff61e19b42ba2f139", - "reference": "8ba022846e79238872e315fff61e19b42ba2f139", + "url": "https://api.github.com/repos/phpstan/phpstan-doctrine/zipball/231d3f795ed5ef54c98961fd3958868cbe091207", + "reference": "231d3f795ed5ef54c98961fd3958868cbe091207", "shasum": "" }, "require": { "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.12.6" + "phpstan/phpstan": "^1.12.12" }, "conflict": { "doctrine/collections": "<1.0", @@ -8806,22 +8803,22 @@ "description": "Doctrine extensions for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-doctrine/issues", - "source": "https://github.com/phpstan/phpstan-doctrine/tree/1.5.6" + "source": "https://github.com/phpstan/phpstan-doctrine/tree/1.5.7" }, - "time": "2024-11-09T17:34:01+00:00" + "time": "2024-12-02T16:47:26+00:00" }, { "name": "phpstan/phpstan-phpunit", - "version": "1.4.1", + "version": "1.4.2", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "11d4235fbc6313ecbf93708606edfd3222e44949" + "reference": "72a6721c9b64b3e4c9db55abbc38f790b318267e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/11d4235fbc6313ecbf93708606edfd3222e44949", - "reference": "11d4235fbc6313ecbf93708606edfd3222e44949", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/72a6721c9b64b3e4c9db55abbc38f790b318267e", + "reference": "72a6721c9b64b3e4c9db55abbc38f790b318267e", "shasum": "" }, "require": { @@ -8858,22 +8855,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.1" + "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.4.2" }, - "time": "2024-11-12T12:43:59+00:00" + "time": "2024-12-17T17:20:49+00:00" }, { "name": "phpstan/phpstan-symfony", - "version": "1.4.12", + "version": "1.4.13", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-symfony.git", - "reference": "c7b7e7f520893621558bfbfdb2694d4364565c1d" + "reference": "dd1aaa7f85f9916222a2ce7e4d21072fe03958f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/c7b7e7f520893621558bfbfdb2694d4364565c1d", - "reference": "c7b7e7f520893621558bfbfdb2694d4364565c1d", + "url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/dd1aaa7f85f9916222a2ce7e4d21072fe03958f4", + "reference": "dd1aaa7f85f9916222a2ce7e4d21072fe03958f4", "shasum": "" }, "require": { @@ -8930,9 +8927,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.12" + "source": "https://github.com/phpstan/phpstan-symfony/tree/1.4.13" }, - "time": "2024-11-06T10:13:18+00:00" + "time": "2025-01-04T13:55:31+00:00" }, { "name": "phpunit/php-code-coverage", @@ -9255,16 +9252,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.21", + "version": "9.6.22", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa" + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa", - "reference": "de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f80235cb4d3caa59ae09be3adf1ded27521d1a9c", + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c", "shasum": "" }, "require": { @@ -9275,7 +9272,7 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.12.0", + "myclabs/deep-copy": "^1.12.1", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=7.3", @@ -9338,7 +9335,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.21" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.22" }, "funding": [ { @@ -9354,7 +9351,7 @@ "type": "tidelift" } ], - "time": "2024-09-19T10:50:18+00:00" + "time": "2024-12-05T13:48:26+00:00" }, { "name": "sebastian/cli-parser", @@ -10610,16 +10607,16 @@ }, { "name": "symfony/dom-crawler", - "version": "v5.4.45", + "version": "v5.4.48", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "89647a57db280f9f93c27271fea58babb77bb473" + "reference": "b57df76f4757a9a8dfbb57ba48d7780cc20776c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/89647a57db280f9f93c27271fea58babb77bb473", - "reference": "89647a57db280f9f93c27271fea58babb77bb473", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/b57df76f4757a9a8dfbb57ba48d7780cc20776c6", + "reference": "b57df76f4757a9a8dfbb57ba48d7780cc20776c6", "shasum": "" }, "require": { @@ -10665,7 +10662,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.45" + "source": "https://github.com/symfony/dom-crawler/tree/v5.4.48" }, "funding": [ { @@ -10681,7 +10678,7 @@ "type": "tidelift" } ], - "time": "2024-10-22T13:05:35+00:00" + "time": "2024-11-13T14:36:38+00:00" }, { "name": "symfony/translation", diff --git a/engine/Library/Enlight/Class.php b/engine/Library/Enlight/Class.php index fd1ddde5565..75b92b31225 100644 --- a/engine/Library/Enlight/Class.php +++ b/engine/Library/Enlight/Class.php @@ -147,7 +147,7 @@ public static function getClassName($class = null) if (\is_object($class)) { $class = \get_class($class); } elseif (!class_exists($class)) { - throw new Enlight_Exception(sprintf('Class "%s" does not exist and could not be loaded', $class)); + throw new Enlight_Exception(\sprintf('Class "%s" does not exist and could not be loaded', $class)); } $classImplements = class_implements($class); diff --git a/engine/Library/Enlight/Components/Db/Adapter/Pdo/Mysql.php b/engine/Library/Enlight/Components/Db/Adapter/Pdo/Mysql.php index ff9caa458eb..845695e3870 100644 --- a/engine/Library/Enlight/Components/Db/Adapter/Pdo/Mysql.php +++ b/engine/Library/Enlight/Components/Db/Adapter/Pdo/Mysql.php @@ -183,7 +183,7 @@ protected function _connect() } if (!$this->dbalConnection) { - throw new RuntimeException(sprintf('Class can only be constructed using %s::createFromDbalConnectionAndConfig().', __CLASS__)); + throw new RuntimeException(\sprintf('Class can only be constructed using %s::createFromDbalConnectionAndConfig().', __CLASS__)); } $this->_connection = $this->dbalConnection->getWrappedConnection(); diff --git a/engine/Library/Enlight/Components/Mail.php b/engine/Library/Enlight/Components/Mail.php index df63e89dcc5..9e72dcb9679 100644 --- a/engine/Library/Enlight/Components/Mail.php +++ b/engine/Library/Enlight/Components/Mail.php @@ -137,7 +137,7 @@ public function __get($name) return $this->_plainBodyText; } - throw new RuntimeException(sprintf('Could not read value for given name: "%s"', $name)); + throw new RuntimeException(\sprintf('Could not read value for given name: "%s"', $name)); } /** diff --git a/engine/Library/Enlight/Config/Format/Ini.php b/engine/Library/Enlight/Config/Format/Ini.php index a7610357a1a..72ce8a87a65 100644 --- a/engine/Library/Enlight/Config/Format/Ini.php +++ b/engine/Library/Enlight/Config/Format/Ini.php @@ -144,7 +144,7 @@ public function __construct($filename, $section = null, $options = false) $dataArray = []; foreach ($section as $sectionName) { if (!isset($iniArray[$sectionName])) { - throw new Enlight_Config_Exception(sprintf("Section '%s' cannot be found in %s", $sectionName, $filename)); + throw new Enlight_Config_Exception(\sprintf("Section '%s' cannot be found in %s", $sectionName, $filename)); } $dataArray = $this->_arrayMergeRecursive($this->_processSection($iniArray, $sectionName), $dataArray); } @@ -214,7 +214,7 @@ protected function _loadIniFile($filename) break; default: - throw new Enlight_Config_Exception(sprintf("Section '%s' may not extend multiple sections in %s", $thisSection, $filename)); + throw new Enlight_Config_Exception(\sprintf("Section '%s' may not extend multiple sections in %s", $thisSection, $filename)); } } @@ -247,7 +247,7 @@ protected function _processSection($iniArray, $section, $config = []) $config = $this->_processSection($iniArray, $value, $config); } } else { - throw new Enlight_Config_Exception(sprintf("Parent section '%s' cannot be found", $section)); + throw new Enlight_Config_Exception(\sprintf("Parent section '%s' cannot be found", $section)); } } else { $config = $this->_processKey($config, $key, $value); @@ -282,11 +282,11 @@ protected function _processKey($config, $key, $value) $config[$pieces[0]] = []; } } elseif (!\is_array($config[$pieces[0]])) { - throw new Enlight_Config_Exception(sprintf("Cannot create sub-key for '%s' as key already exists", $pieces[0])); + throw new Enlight_Config_Exception(\sprintf("Cannot create sub-key for '%s' as key already exists", $pieces[0])); } $config[$pieces[0]] = $this->_processKey($config[$pieces[0]], $pieces[1], $value); } else { - throw new Enlight_Config_Exception(sprintf("Invalid key '%s'", $key)); + throw new Enlight_Config_Exception(\sprintf("Invalid key '%s'", $key)); } } else { $config[$key] = $value; diff --git a/engine/Library/Enlight/Controller/Dispatcher/Default.php b/engine/Library/Enlight/Controller/Dispatcher/Default.php index 4baad56b74b..acb73b534bf 100644 --- a/engine/Library/Enlight/Controller/Dispatcher/Default.php +++ b/engine/Library/Enlight/Controller/Dispatcher/Default.php @@ -433,7 +433,7 @@ public function dispatch( try { Shopware()->Loader()->loadClass($class, $path); } catch (Exception $e) { - throw new Enlight_Exception(sprintf('Controller "%s" could not be loaded', $class)); + throw new Enlight_Exception(\sprintf('Controller "%s" could not be loaded', $class)); } $proxy = Shopware()->Hooks()->getProxy($class); @@ -485,7 +485,7 @@ public function dispatch( private function getControllerServiceId(string $module, string $name): ?string { - $controllerKey = strtolower(sprintf('%s_%s', $module, $name)); + $controllerKey = strtolower(\sprintf('%s_%s', $module, $name)); return $this->controllers[$controllerKey] ?? null; } diff --git a/engine/Library/Enlight/Controller/Plugins/ScriptRenderer/Bootstrap.php b/engine/Library/Enlight/Controller/Plugins/ScriptRenderer/Bootstrap.php index 0f52b3d893f..1bf491ea603 100644 --- a/engine/Library/Enlight/Controller/Plugins/ScriptRenderer/Bootstrap.php +++ b/engine/Library/Enlight/Controller/Plugins/ScriptRenderer/Bootstrap.php @@ -218,7 +218,7 @@ public function setViewRenderer(?Enlight_Controller_Plugins_ViewRenderer_Bootstr */ private function inflectPath($module, $controller, $file) { - return sprintf( + return \sprintf( '%s/%s/%s.js', mb_strtolower($this->camelCaseToUnderScore($module)), mb_strtolower($this->camelCaseToUnderScore($controller)), diff --git a/engine/Library/Enlight/Controller/Request/RequestHttp.php b/engine/Library/Enlight/Controller/Request/RequestHttp.php index 60d35a640e0..41030c24cad 100644 --- a/engine/Library/Enlight/Controller/Request/RequestHttp.php +++ b/engine/Library/Enlight/Controller/Request/RequestHttp.php @@ -725,7 +725,7 @@ public function setPathInfo($pathInfo = null) */ public function setParamSources(array $paramSources = []) { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.8. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.8. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); return $this; } @@ -735,7 +735,7 @@ public function setParamSources(array $paramSources = []) */ public function getParamSources() { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.8. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.8. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); return ['_GET', '_POST']; } @@ -841,7 +841,7 @@ public function isOptions() */ public function isFlashRequest() { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.8', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.8', __CLASS__, __METHOD__), E_USER_DEPRECATED); $userAgent = $this->getHeader('USER_AGENT'); if (empty($userAgent)) { diff --git a/engine/Library/Enlight/Controller/Response/ResponseHttp.php b/engine/Library/Enlight/Controller/Response/ResponseHttp.php index 3cb52094630..04212424744 100644 --- a/engine/Library/Enlight/Controller/Response/ResponseHttp.php +++ b/engine/Library/Enlight/Controller/Response/ResponseHttp.php @@ -220,7 +220,7 @@ public function setRawHeader($value) $parts = self::getRawHeaderParts($value); if (\count($parts) !== 2) { - throw new InvalidArgumentException(sprintf('Given Header "%s" is invalid', $value)); + throw new InvalidArgumentException(\sprintf('Given Header "%s" is invalid', $value)); } $this->headers->set($parts[0], $parts[1]); diff --git a/engine/Library/Enlight/Hook/ProxyFactory.php b/engine/Library/Enlight/Hook/ProxyFactory.php index 122e086b050..f43a51eeb4a 100644 --- a/engine/Library/Enlight/Hook/ProxyFactory.php +++ b/engine/Library/Enlight/Hook/ProxyFactory.php @@ -77,10 +77,10 @@ public function __construct($hookManager, $proxyNamespace, $proxyDir) if (!is_dir($proxyDir)) { if (@mkdir($proxyDir, 0777, true) === false && !is_dir($proxyDir)) { - throw new RuntimeException(sprintf("Unable to create the %s directory (%s)\n", 'Proxy', $proxyDir)); + throw new RuntimeException(\sprintf("Unable to create the %s directory (%s)\n", 'Proxy', $proxyDir)); } } elseif (!is_writable($proxyDir)) { - throw new RuntimeException(sprintf("Unable to write in the %s directory (%s)\n", 'Proxy', $proxyDir)); + throw new RuntimeException(\sprintf("Unable to write in the %s directory (%s)\n", 'Proxy', $proxyDir)); } $proxyDir = rtrim((string) Enlight_Loader::realpath($proxyDir), '\\/') . DIRECTORY_SEPARATOR; @@ -102,7 +102,7 @@ public function getProxy($class) { $classImplements = class_implements($class); if (!\is_array($classImplements) || !\in_array(Enlight_Hook::class, $classImplements, true)) { - trigger_error(sprintf('The class "%s" does not implement the Enlight_Hook Interface. It will be thrown in 5.8.', $class), E_USER_WARNING); + trigger_error(\sprintf('The class "%s" does not implement the Enlight_Hook Interface. It will be thrown in 5.8.', $class), E_USER_WARNING); // throw new Enlight_Hook_Exception('The class' . $class . ' does not implement Enlight_Hook interface.'); } @@ -112,11 +112,11 @@ public function getProxy($class) if (!is_readable($proxyFile)) { if (!file_exists($this->proxyDir)) { if (!mkdir($concurrentDirectory = $this->proxyDir) && !is_dir($concurrentDirectory)) { - throw new RuntimeException(sprintf('Directory "%s" was not created', $concurrentDirectory)); + throw new RuntimeException(\sprintf('Directory "%s" was not created', $concurrentDirectory)); } } if (!is_writable($this->proxyDir)) { - throw new RuntimeException(sprintf('The directory "%s" is not writable.', $this->proxyDir)); + throw new RuntimeException(\sprintf('The directory "%s" is not writable.', $this->proxyDir)); } $content = $this->generateProxyClass($class); @@ -433,6 +433,6 @@ protected function writeProxyClass($fileName, $content) return; } - throw new Enlight_Exception(sprintf('Unable to write file "%s"', $fileName)); + throw new Enlight_Exception(\sprintf('Unable to write file "%s"', $fileName)); } } diff --git a/engine/Library/Enlight/Plugin/Bootstrap.php b/engine/Library/Enlight/Plugin/Bootstrap.php index 1c5fd761102..ea28a96b27f 100644 --- a/engine/Library/Enlight/Plugin/Bootstrap.php +++ b/engine/Library/Enlight/Plugin/Bootstrap.php @@ -118,7 +118,7 @@ public function Application() public function get($name) { if (!$this->collection instanceof Enlight_Plugin_PluginCollection) { - throw new RuntimeException(sprintf('Could not get "%s". Plugin collection is not set.', $name)); + throw new RuntimeException(\sprintf('Could not get "%s". Plugin collection is not set.', $name)); } return $this->collection->Application()->Container()->get($name); diff --git a/engine/Library/Enlight/Template/Plugins/modifier.tax.php b/engine/Library/Enlight/Template/Plugins/modifier.tax.php index abfec44ea4b..61923dc0c11 100644 --- a/engine/Library/Enlight/Template/Plugins/modifier.tax.php +++ b/engine/Library/Enlight/Template/Plugins/modifier.tax.php @@ -26,7 +26,7 @@ function smarty_modifier_tax($value, $locale = null) { if (!is_numeric($value)) { - throw new InvalidArgumentException(sprintf('Input %s must be numeric.', (string) $value)); + throw new InvalidArgumentException(\sprintf('Input %s must be numeric.', (string) $value)); } $format['precision'] = 2; diff --git a/engine/Shopware/Bootstrap.php b/engine/Shopware/Bootstrap.php index f21bc2be68b..1980229067f 100644 --- a/engine/Shopware/Bootstrap.php +++ b/engine/Shopware/Bootstrap.php @@ -1,4 +1,5 @@ getArrayStore(), true); if (!empty($arrayStore)) { foreach ($arrayStore as &$option) { - $optionKey = sprintf('%soptions_store_%s', $key, strtolower($option['key'])); + $optionKey = \sprintf('%soptions_store_%s', $key, strtolower($option['key'])); $option['value'] = $snippets->get($optionKey, $option['value']); } unset($option); diff --git a/engine/Shopware/Bundle/AttributeBundle/Controllers/Backend/Attributes.php b/engine/Shopware/Bundle/AttributeBundle/Controllers/Backend/Attributes.php index a7eaaf48a34..ef7b4644245 100644 --- a/engine/Shopware/Bundle/AttributeBundle/Controllers/Backend/Attributes.php +++ b/engine/Shopware/Bundle/AttributeBundle/Controllers/Backend/Attributes.php @@ -1,4 +1,5 @@ Request()->getParam($columnParamName); if (!$table) { - throw new Exception(sprintf('Required parameter "%s" not found', $tableParamName)); + throw new Exception(\sprintf('Required parameter "%s" not found', $tableParamName)); } if (!$column) { - throw new Exception(sprintf('Required parameter "%s" not found', $columnParamName)); + throw new Exception(\sprintf('Required parameter "%s" not found', $columnParamName)); } $schemaOperator = $this->get(SchemaOperatorInterface::class); diff --git a/engine/Shopware/Bundle/AttributeBundle/Controllers/Backend/EntitySearch.php b/engine/Shopware/Bundle/AttributeBundle/Controllers/Backend/EntitySearch.php index b763d594176..87b2f53e9c8 100644 --- a/engine/Shopware/Bundle/AttributeBundle/Controllers/Backend/EntitySearch.php +++ b/engine/Shopware/Bundle/AttributeBundle/Controllers/Backend/EntitySearch.php @@ -1,4 +1,5 @@ formatColumnName($column); if (!$this->tableMapping->isTableColumn($table, $column)) { - throw new RuntimeException(sprintf('Table %s has no column with name %s', $table, $column)); + throw new RuntimeException(\sprintf('Table %s has no column with name %s', $table, $column)); } $this->schemaOperator->dropColumn($table, $column); diff --git a/engine/Shopware/Bundle/AttributeBundle/Service/DataLoader.php b/engine/Shopware/Bundle/AttributeBundle/Service/DataLoader.php index fe61ce74fc0..314290c0e1f 100644 --- a/engine/Shopware/Bundle/AttributeBundle/Service/DataLoader.php +++ b/engine/Shopware/Bundle/AttributeBundle/Service/DataLoader.php @@ -1,4 +1,5 @@ mapping->isAttributeTable($table)) { - throw new Exception(sprintf('Table %s is no attribute table', $table)); + throw new Exception(\sprintf('Table %s is no attribute table', $table)); } if (!$foreignKey) { diff --git a/engine/Shopware/Bundle/AttributeBundle/Service/DataPersister.php b/engine/Shopware/Bundle/AttributeBundle/Service/DataPersister.php index 5115ba4d20b..d9eb111edf9 100644 --- a/engine/Shopware/Bundle/AttributeBundle/Service/DataPersister.php +++ b/engine/Shopware/Bundle/AttributeBundle/Service/DataPersister.php @@ -1,4 +1,5 @@ mapping->isAttributeTable($table)) { - throw new Exception(sprintf('Table %s is no attribute table', $table)); + throw new Exception(\sprintf('Table %s is no attribute table', $table)); } if (!$foreignKey) { throw new Exception('No foreign key provided'); @@ -93,7 +94,7 @@ public function persist($data, $table, $foreignKey) public function cloneAttribute($table, $sourceForeignKey, $targetForeignKey) { if (!$this->mapping->isAttributeTable($table)) { - throw new Exception(sprintf('Table %s is no attribute table', $table)); + throw new Exception(\sprintf('Table %s is no attribute table', $table)); } if (!$sourceForeignKey) { throw new Exception('No foreign key provided'); @@ -117,7 +118,7 @@ public function cloneAttribute($table, $sourceForeignKey, $targetForeignKey) public function cloneAttributeTranslations($table, $sourceForeignKey, $targetForeignKey) { if (!$this->mapping->isAttributeTable($table)) { - throw new Exception(sprintf('Table %s is no attribute table', $table)); + throw new Exception(\sprintf('Table %s is no attribute table', $table)); } if (!$sourceForeignKey) { throw new Exception('No foreign key provided'); diff --git a/engine/Shopware/Bundle/AttributeBundle/Service/SchemaOperator.php b/engine/Shopware/Bundle/AttributeBundle/Service/SchemaOperator.php index 69ec10c4b4f..29ed3386973 100644 --- a/engine/Shopware/Bundle/AttributeBundle/Service/SchemaOperator.php +++ b/engine/Shopware/Bundle/AttributeBundle/Service/SchemaOperator.php @@ -1,4 +1,5 @@ validateField($newName); $defaultValue = $this->filterDefaultValue($defaultValue); - $sql = sprintf( + $sql = \sprintf( 'ALTER TABLE `%s` CHANGE `%s` `%s` %s NULL DEFAULT %s;', $table, $originalName, @@ -114,10 +115,10 @@ public function dropColumn($table, $column) $this->validate($table, $column); if ($this->tableMapping->isCoreColumn($table, $column)) { - throw new Exception(sprintf('Provided column is an core attribute column: %s', $column)); + throw new Exception(\sprintf('Provided column is an core attribute column: %s', $column)); } - $sql = sprintf('ALTER TABLE `%s` DROP `%s`', $table, $column); + $sql = \sprintf('ALTER TABLE `%s` DROP `%s`', $table, $column); $this->connection->executeQuery($sql); } @@ -132,10 +133,10 @@ public function resetColumn($table, $column) $this->validate($table, $column); if (!$this->tableMapping->isTableColumn($table, $column)) { - throw new Exception(sprintf('Provided column %s does not exist in table %s', $column, $table)); + throw new Exception(\sprintf('Provided column %s does not exist in table %s', $column, $table)); } - $sql = sprintf('UPDATE `%s` SET `%s` = NULL', $table, $column); + $sql = \sprintf('UPDATE `%s` SET `%s` = NULL', $table, $column); $this->connection->executeUpdate($sql); } @@ -158,15 +159,15 @@ private function validate($table, $name): void $this->validateField($name); if (!$this->tableMapping->isAttributeTable($table)) { - throw new Exception(sprintf('Provided table is no attribute table: %s', $table)); + throw new Exception(\sprintf('Provided table is no attribute table: %s', $table)); } if ($this->tableMapping->isIdentifierColumn($table, $name)) { - throw new Exception(sprintf('Provided column is an identifier column: %s', $name)); + throw new Exception(\sprintf('Provided column is an identifier column: %s', $name)); } $lowerCaseName = strtolower($name); if (\in_array($lowerCaseName, $this->nameBlacklist, true)) { - throw new Exception(sprintf('Provided name %s is a reserved keyword.', $name)); + throw new Exception(\sprintf('Provided name %s is a reserved keyword.', $name)); } } @@ -182,7 +183,7 @@ private function validateField($field): void } if (!preg_match('/^[a-zA-Z_][a-zA-Z0-9_]*$/', $field)) { - throw new Exception(sprintf('Invalid chars in %s', $field)); + throw new Exception(\sprintf('Invalid chars in %s', $field)); } } diff --git a/engine/Shopware/Bundle/AttributeBundle/Service/TableMapping.php b/engine/Shopware/Bundle/AttributeBundle/Service/TableMapping.php index 4ad53467a45..2b49b0ffd1a 100644 --- a/engine/Shopware/Bundle/AttributeBundle/Service/TableMapping.php +++ b/engine/Shopware/Bundle/AttributeBundle/Service/TableMapping.php @@ -1,4 +1,5 @@ tables)) { - throw new Exception(sprintf('Table %s is no attribute table', $table)); + throw new Exception(\sprintf('Table %s is no attribute table', $table)); } $config = $this->tables[$table]; $identifiers = isset($config['identifiers']) ? $config['identifiers'] : []; @@ -70,7 +71,7 @@ public function isIdentifierColumn($table, $name) public function isCoreColumn($table, $name) { if (!\array_key_exists($table, $this->tables)) { - throw new Exception(sprintf('Table %s is no attribute table', $table)); + throw new Exception(\sprintf('Table %s is no attribute table', $table)); } $config = $this->tables[$table]; $coreAttributes = isset($config['coreAttributes']) ? $config['coreAttributes'] : []; @@ -138,7 +139,7 @@ public function isTableColumn($table, $column) public function getDependingTables($table) { if (!$this->isAttributeTable($table)) { - throw new Exception(sprintf('Table %s is no supported attribute table', $table)); + throw new Exception(\sprintf('Table %s is no supported attribute table', $table)); } return $this->tables[$table]['dependingTables']; diff --git a/engine/Shopware/Bundle/AttributeBundle/Service/TypeMapping.php b/engine/Shopware/Bundle/AttributeBundle/Service/TypeMapping.php index bad6c9d5e0e..5e9fecb2a7a 100644 --- a/engine/Shopware/Bundle/AttributeBundle/Service/TypeMapping.php +++ b/engine/Shopware/Bundle/AttributeBundle/Service/TypeMapping.php @@ -1,4 +1,5 @@ sync(array_keys($activePlugins), $input->getOption('destructive')); $io = new SymfonyStyle($input, $output); - $io->success(sprintf('Synchronized %d type(s)', \count($types))); + $io->success(\sprintf('Synchronized %d type(s)', \count($types))); return 0; } diff --git a/engine/Shopware/Bundle/ContentTypeBundle/ContentTypeBundle.php b/engine/Shopware/Bundle/ContentTypeBundle/ContentTypeBundle.php index b513929fc2d..f71732a1ecf 100644 --- a/engine/Shopware/Bundle/ContentTypeBundle/ContentTypeBundle.php +++ b/engine/Shopware/Bundle/ContentTypeBundle/ContentTypeBundle.php @@ -1,4 +1,5 @@ repository->findAll($criteria)->items); if (!$result) { - throw new NotFoundException(sprintf('Entity by id %d not found', $id)); + throw new NotFoundException(\sprintf('Entity by id %d not found', $id)); } $this->View()->assign('data', $result); diff --git a/engine/Shopware/Bundle/ContentTypeBundle/Controller/Backend/ContentType.php b/engine/Shopware/Bundle/ContentTypeBundle/Controller/Backend/ContentType.php index d2ad8137ac1..fd22d4710cd 100644 --- a/engine/Shopware/Bundle/ContentTypeBundle/Controller/Backend/ContentType.php +++ b/engine/Shopware/Bundle/ContentTypeBundle/Controller/Backend/ContentType.php @@ -1,4 +1,5 @@ get($snippetName, $snippetName, true), ucfirst(explode('-', $id)[0])); + $label = \sprintf($namespace->get($snippetName, $snippetName, true), ucfirst(explode('-', $id)[0])); } if (($query !== '') && !str_contains(strtolower($name), $query) && !str_contains(strtolower($label), $query)) { diff --git a/engine/Shopware/Bundle/ContentTypeBundle/Controller/Frontend/ContentType.php b/engine/Shopware/Bundle/ContentTypeBundle/Controller/Frontend/ContentType.php index 452a6b1780f..7eed220a21e 100644 --- a/engine/Shopware/Bundle/ContentTypeBundle/Controller/Frontend/ContentType.php +++ b/engine/Shopware/Bundle/ContentTypeBundle/Controller/Frontend/ContentType.php @@ -1,4 +1,5 @@ limit = self::LIMIT; $criteria->sort = [['property' => 'id', 'direction' => 'DESC']]; - $this->get('events')->notify(sprintf('Content_Type_Frontend_Criteria_Creation_%s', $this->type->getInternalName()), [ + $this->get('events')->notify(\sprintf('Content_Type_Frontend_Criteria_Creation_%s', $this->type->getInternalName()), [ 'subject' => $this, 'criteria' => $criteria, ]); @@ -81,7 +82,7 @@ public function detailAction(int $id = 1): void $result = $this->repository->findAll($criteria); if (\count($result->items) === 0) { - throw new Enlight_Controller_Exception(sprintf('Cannot find element with id %d of type \'%s\'', $id, $this->type->getInternalName())); + throw new Enlight_Controller_Exception(\sprintf('Cannot find element with id %d of type \'%s\'', $id, $this->type->getInternalName())); } $item = current($result->items); diff --git a/engine/Shopware/Bundle/ContentTypeBundle/DependencyInjection/RegisterDynamicController.php b/engine/Shopware/Bundle/ContentTypeBundle/DependencyInjection/RegisterDynamicController.php index 42dc03f383d..d54c144976a 100644 --- a/engine/Shopware/Bundle/ContentTypeBundle/DependencyInjection/RegisterDynamicController.php +++ b/engine/Shopware/Bundle/ContentTypeBundle/DependencyInjection/RegisterDynamicController.php @@ -1,4 +1,5 @@ getDefinition($id); if (!isset($options[0]['fieldName'])) { - throw new RuntimeException(sprintf('Service with id "%s" need the tag attribute fieldName to identify the short name', $id)); + throw new RuntimeException(\sprintf('Service with id "%s" need the tag attribute fieldName to identify the short name', $id)); } // To support FQCN ids without class attribute diff --git a/engine/Shopware/Bundle/ContentTypeBundle/DependencyInjection/RegisterTypeRepositories.php b/engine/Shopware/Bundle/ContentTypeBundle/DependencyInjection/RegisterTypeRepositories.php index 2ca10844ff5..6d76cf4a6e8 100644 --- a/engine/Shopware/Bundle/ContentTypeBundle/DependencyInjection/RegisterTypeRepositories.php +++ b/engine/Shopware/Bundle/ContentTypeBundle/DependencyInjection/RegisterTypeRepositories.php @@ -1,4 +1,5 @@ menuRepository->findOneBy($menuItem['parent']); if (!\is_object($parent)) { - throw new InvalidArgumentException(sprintf('Unable to find parent for query %s', print_r($menuItem['parent'], true))); + throw new InvalidArgumentException(\sprintf('Unable to find parent for query %s', print_r($menuItem['parent'], true))); } } diff --git a/engine/Shopware/Bundle/ContentTypeBundle/Services/MenuSynchronizerInterface.php b/engine/Shopware/Bundle/ContentTypeBundle/Services/MenuSynchronizerInterface.php index 3d55e25e085..4d875131a35 100644 --- a/engine/Shopware/Bundle/ContentTypeBundle/Services/MenuSynchronizerInterface.php +++ b/engine/Shopware/Bundle/ContentTypeBundle/Services/MenuSynchronizerInterface.php @@ -1,4 +1,5 @@ orWhere(sprintf('`%s` LIKE :search', $field->getName())); + $query->orWhere(\sprintf('`%s` LIKE :search', $field->getName())); } } else { $where = $item['value']; @@ -225,7 +226,7 @@ protected function buildQuery($offset = 0, $limit = 10, $sort = [], $filters = [ if ($idSearch && \count($filters) === 1) { $idSearch = array_map('intval', $idSearch); - $orderBy = sprintf('FIELD(id, %s)', implode(',', $idSearch)); + $orderBy = \sprintf('FIELD(id, %s)', implode(',', $idSearch)); $query->addOrderBy($orderBy); } @@ -286,7 +287,7 @@ private function validateFields(array $data): void } if (empty($data[$field->getName()])) { - throw new CustomValidationException(sprintf('Field %s is required', $field->getName())); + throw new CustomValidationException(\sprintf('Field %s is required', $field->getName())); } } } diff --git a/engine/Shopware/Bundle/ContentTypeBundle/Services/RepositoryInterface.php b/engine/Shopware/Bundle/ContentTypeBundle/Services/RepositoryInterface.php index c3def4f304a..885934129d8 100644 --- a/engine/Shopware/Bundle/ContentTypeBundle/Services/RepositoryInterface.php +++ b/engine/Shopware/Bundle/ContentTypeBundle/Services/RepositoryInterface.php @@ -1,4 +1,5 @@ types[$name])) { - throw new RuntimeException(sprintf('Requested type "%s" does not exist', $name)); + throw new RuntimeException(\sprintf('Requested type "%s" does not exist', $name)); } return $this->types[$name]; @@ -74,6 +75,6 @@ public function getTypeByControllerName(string $controllerName): Type } } - throw new RuntimeException(sprintf('Cannot find type for controller "%s"', $controllerName)); + throw new RuntimeException(\sprintf('Cannot find type for controller "%s"', $controllerName)); } } diff --git a/engine/Shopware/Bundle/ContentTypeBundle/Services/XmlReader/ContentTypesReader.php b/engine/Shopware/Bundle/ContentTypeBundle/Services/XmlReader/ContentTypesReader.php index 569be48b6a0..364b1a5ef87 100644 --- a/engine/Shopware/Bundle/ContentTypeBundle/Services/XmlReader/ContentTypesReader.php +++ b/engine/Shopware/Bundle/ContentTypeBundle/Services/XmlReader/ContentTypesReader.php @@ -1,4 +1,5 @@ getName())); + throw new RuntimeException(\sprintf('Type %s needs a label', $type->getName())); } } diff --git a/engine/Shopware/Bundle/ContentTypeBundle/Subscriber/SyncSubscriber.php b/engine/Shopware/Bundle/ContentTypeBundle/Subscriber/SyncSubscriber.php index a48fa66ea8b..52b2fb18f16 100644 --- a/engine/Shopware/Bundle/ContentTypeBundle/Subscriber/SyncSubscriber.php +++ b/engine/Shopware/Bundle/ContentTypeBundle/Subscriber/SyncSubscriber.php @@ -1,4 +1,5 @@ getDefinition($id); diff --git a/engine/Shopware/Bundle/ControllerBundle/DependencyInjection/Compiler/RegisterControllerCompilerPass.php b/engine/Shopware/Bundle/ControllerBundle/DependencyInjection/Compiler/RegisterControllerCompilerPass.php index 23373a510ac..e02e19fabc0 100644 --- a/engine/Shopware/Bundle/ControllerBundle/DependencyInjection/Compiler/RegisterControllerCompilerPass.php +++ b/engine/Shopware/Bundle/ControllerBundle/DependencyInjection/Compiler/RegisterControllerCompilerPass.php @@ -1,4 +1,5 @@ count() === 0) { - throw new NoCookieGroupByNameKnownException(sprintf('There is no known cookie group with name %s', $groupName)); + throw new NoCookieGroupByNameKnownException(\sprintf('There is no known cookie group with name %s', $groupName)); } return $cookieGroupCollection->first(); diff --git a/engine/Shopware/Bundle/CookieBundle/Services/CookieCollector.php b/engine/Shopware/Bundle/CookieBundle/Services/CookieCollector.php index 083a8088a6f..668a9b379d7 100644 --- a/engine/Shopware/Bundle/CookieBundle/Services/CookieCollector.php +++ b/engine/Shopware/Bundle/CookieBundle/Services/CookieCollector.php @@ -73,7 +73,7 @@ public function collect(): CookieGroupCollection ); if (!$cookieCollection->isValid()) { - throw new InvalidCookieItemException(sprintf('Found item inside cookie collection, which is not of type \Shopware\Bundle\CookieBundle\Structs\CookieStruct')); + throw new InvalidCookieItemException(\sprintf('Found item inside cookie collection, which is not of type \Shopware\Bundle\CookieBundle\Structs\CookieStruct')); } $cookieCollection = $this->sortCookies($cookieCollection); diff --git a/engine/Shopware/Bundle/CookieBundle/Services/CookieCollectorInterface.php b/engine/Shopware/Bundle/CookieBundle/Services/CookieCollectorInterface.php index 82e71ab1680..a6b32b09792 100644 --- a/engine/Shopware/Bundle/CookieBundle/Services/CookieCollectorInterface.php +++ b/engine/Shopware/Bundle/CookieBundle/Services/CookieCollectorInterface.php @@ -1,4 +1,5 @@ connection->executeUpdate('DELETE FROM s_customer_search_index'); } diff --git a/engine/Shopware/Bundle/CustomerSearchBundleDBAL/Indexing/SearchIndexerInterface.php b/engine/Shopware/Bundle/CustomerSearchBundleDBAL/Indexing/SearchIndexerInterface.php index 5bb096937f6..c14faf4bab2 100644 --- a/engine/Shopware/Bundle/CustomerSearchBundleDBAL/Indexing/SearchIndexerInterface.php +++ b/engine/Shopware/Bundle/CustomerSearchBundleDBAL/Indexing/SearchIndexerInterface.php @@ -1,4 +1,5 @@ backlogReader->getLastBacklogId(); $backlogs = $this->backlogReader->read($lastBackLogId, $this->batchSize); - $output->writeln(sprintf('Current last backlog id: %d', $lastBackLogId)); + $output->writeln(\sprintf('Current last backlog id: %d', $lastBackLogId)); $io = new SymfonyStyle($input, $output); @@ -106,7 +107,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $last = $backlogs[array_key_last($backlogs)]; $this->backlogReader->setLastBacklogId($last->getId()); - $io->success(sprintf('Synchronized %d items', \count($backlogs))); + $io->success(\sprintf('Synchronized %d items', \count($backlogs))); return 0; } diff --git a/engine/Shopware/Bundle/ESIndexingBundle/Commands/IndexCleanupCommand.php b/engine/Shopware/Bundle/ESIndexingBundle/Commands/IndexCleanupCommand.php index b0dffa7d36f..57b3d057f05 100644 --- a/engine/Shopware/Bundle/ESIndexingBundle/Commands/IndexCleanupCommand.php +++ b/engine/Shopware/Bundle/ESIndexingBundle/Commands/IndexCleanupCommand.php @@ -1,4 +1,5 @@ writeln(sprintf('Shops with following IDs not found: %s', implode(', ', $shopIdsNotFound))); + $output->writeln(\sprintf('Shops with following IDs not found: %s', implode(', ', $shopIdsNotFound))); } return $shops; diff --git a/engine/Shopware/Bundle/ESIndexingBundle/Commands/SwitchAliasCommand.php b/engine/Shopware/Bundle/ESIndexingBundle/Commands/SwitchAliasCommand.php index 30817f4a1fd..7d6da87b84f 100644 --- a/engine/Shopware/Bundle/ESIndexingBundle/Commands/SwitchAliasCommand.php +++ b/engine/Shopware/Bundle/ESIndexingBundle/Commands/SwitchAliasCommand.php @@ -1,4 +1,5 @@ indices()->exists(['index' => $indexName]); if (!$exist) { - throw new RuntimeException(sprintf('Index "%s" does not exist', $indexName)); + throw new RuntimeException(\sprintf('Index "%s" does not exist', $indexName)); } $actions = [ diff --git a/engine/Shopware/Bundle/ESIndexingBundle/Console/ConsoleEvaluationHelper.php b/engine/Shopware/Bundle/ESIndexingBundle/Console/ConsoleEvaluationHelper.php index ca9cecd3209..59b69eb3fe2 100644 --- a/engine/Shopware/Bundle/ESIndexingBundle/Console/ConsoleEvaluationHelper.php +++ b/engine/Shopware/Bundle/ESIndexingBundle/Console/ConsoleEvaluationHelper.php @@ -1,4 +1,5 @@ query; } diff --git a/engine/Shopware/Bundle/ESIndexingBundle/MappingInterface.php b/engine/Shopware/Bundle/ESIndexingBundle/MappingInterface.php index 5d9889887dd..3ea1a9ce6d4 100644 --- a/engine/Shopware/Bundle/ESIndexingBundle/MappingInterface.php +++ b/engine/Shopware/Bundle/ESIndexingBundle/MappingInterface.php @@ -1,4 +1,5 @@ createQuery($limit) ->innerJoin('variant', 's_articles_details', 'subVariant', 'subVariant.articleID = variant.articleID') @@ -111,7 +112,7 @@ public function createUnitIdQuery($unitIds, $limit = null) */ public function createVoteIdQuery($voteIds, $limit = null) { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); $dbal = $this->createQuery($limit) ->innerJoin('product', 's_articles_vote', 'vote', 'vote.articleID = product.id') @@ -140,7 +141,7 @@ public function createProductIdQuery($productIds, $limit = null) */ public function createVariantIdQuery($variantIds, $limit = null) { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); $dbal = $this->createQuery($limit) ->innerJoin('variant', 's_articles_details', 'subVariant', 'subVariant.articleID = variant.articleID') @@ -181,7 +182,7 @@ public function createManufacturerQuery($manufacturerIds, $limit = null) */ public function createProductCategoryQuery($categoryIds, $limit = null) { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); $dbal = $this->createQuery($limit) ->innerJoin('variant', 's_articles_categories_ro', 'shopProducts', 'shopProducts.articleID = variant.articleID') diff --git a/engine/Shopware/Bundle/ESIndexingBundle/Product/ProductQueryFactoryInterface.php b/engine/Shopware/Bundle/ESIndexingBundle/Product/ProductQueryFactoryInterface.php index 8c856c88493..6ca4b4f176e 100644 --- a/engine/Shopware/Bundle/ESIndexingBundle/Product/ProductQueryFactoryInterface.php +++ b/engine/Shopware/Bundle/ESIndexingBundle/Product/ProductQueryFactoryInterface.php @@ -1,4 +1,5 @@ client->indices()->exists(['index' => $configuration->getName()]); if ($exist) { - throw new RuntimeException(sprintf('ElasticSearch index %s already exist.', $configuration->getName())); + throw new RuntimeException(\sprintf('ElasticSearch index %s already exist.', $configuration->getName())); } $mergedSettings = [ diff --git a/engine/Shopware/Bundle/ESIndexingBundle/ShopIndexerInterface.php b/engine/Shopware/Bundle/ESIndexingBundle/ShopIndexerInterface.php index 19804dd6653..c6d45abb27b 100644 --- a/engine/Shopware/Bundle/ESIndexingBundle/ShopIndexerInterface.php +++ b/engine/Shopware/Bundle/ESIndexingBundle/ShopIndexerInterface.php @@ -1,4 +1,5 @@ getComponent()->getType(), $types, true)) { - $message = sprintf('%s is deprecated since 5.3 and will be removed with 6.0. Implement a ComponentHandler instead for performance benefit.', __CLASS__); + $message = \sprintf('%s is deprecated since 5.3 and will be removed with 6.0. Implement a ComponentHandler instead for performance benefit.', __CLASS__); trigger_error($message, E_USER_DEPRECATED); } } diff --git a/engine/Shopware/Bundle/EmotionBundle/ComponentHandler/Html5VideoComponentHandler.php b/engine/Shopware/Bundle/EmotionBundle/ComponentHandler/Html5VideoComponentHandler.php index 28f06c01b8c..9babec06a4d 100644 --- a/engine/Shopware/Bundle/EmotionBundle/ComponentHandler/Html5VideoComponentHandler.php +++ b/engine/Shopware/Bundle/EmotionBundle/ComponentHandler/Html5VideoComponentHandler.php @@ -1,4 +1,5 @@ writeln(sprintf('Sync %s with id %s', $backlog['entity'], $backlog['entity_id'])); + $output->writeln(\sprintf('Sync %s with id %s', $backlog['entity'], $backlog['entity_id'])); if ($backlog['entity'] === Article::class) { $this->indexArticle($backlog['entity_id']); diff --git a/engine/Shopware/Bundle/EsBackendBundle/EsAwareRepository.php b/engine/Shopware/Bundle/EsBackendBundle/EsAwareRepository.php index 28060f2cd76..1f100d18235 100644 --- a/engine/Shopware/Bundle/EsBackendBundle/EsAwareRepository.php +++ b/engine/Shopware/Bundle/EsBackendBundle/EsAwareRepository.php @@ -1,4 +1,5 @@ whiteListTypeArray)) { - throw new Exception(sprintf('Could not render type of %s', \gettype($variable))); + throw new Exception(\sprintf('Could not render type of %s', \gettype($variable))); } return (string) $variable; diff --git a/engine/Shopware/Bundle/FormBundle/StringRendererServiceInterface.php b/engine/Shopware/Bundle/FormBundle/StringRendererServiceInterface.php index 3693a464b59..49be0ae590e 100644 --- a/engine/Shopware/Bundle/FormBundle/StringRendererServiceInterface.php +++ b/engine/Shopware/Bundle/FormBundle/StringRendererServiceInterface.php @@ -1,4 +1,5 @@ entityName)); + throw new TransformationFailedException(\sprintf('An entity with id "%s" does not exist! (%s)', $entityId, $this->entityName)); } return $entity; diff --git a/engine/Shopware/Bundle/MailBundle/AutoCompleteResolver.php b/engine/Shopware/Bundle/MailBundle/AutoCompleteResolver.php index b7c96ad6bcb..a3fc5207bff 100644 --- a/engine/Shopware/Bundle/MailBundle/AutoCompleteResolver.php +++ b/engine/Shopware/Bundle/MailBundle/AutoCompleteResolver.php @@ -1,4 +1,5 @@ maximumAgeInDays)); + $maximumAgeInterval = new DateInterval(\sprintf('P%dD', $this->maximumAgeInDays)); $this->logRepository->deleteByDate(null, $now->sub($maximumAgeInterval)); } diff --git a/engine/Shopware/Bundle/MailBundle/DependencyInjection/EventListener/MailSubscriber.php b/engine/Shopware/Bundle/MailBundle/DependencyInjection/EventListener/MailSubscriber.php index 524759fb065..db0f63b0032 100644 --- a/engine/Shopware/Bundle/MailBundle/DependencyInjection/EventListener/MailSubscriber.php +++ b/engine/Shopware/Bundle/MailBundle/DependencyInjection/EventListener/MailSubscriber.php @@ -1,4 +1,5 @@ getDocuments() as $document) { - $filePath = sprintf('documents/%s.pdf', $document->getHash()); - $fileName = sprintf('%s.pdf', $document->getType()->getName()); + $filePath = \sprintf('documents/%s.pdf', $document->getHash()); + $fileName = \sprintf('%s.pdf', $document->getType()->getName()); if (!$this->filesystem->has($filePath)) { continue; diff --git a/engine/Shopware/Bundle/MailBundle/Service/LogEntryMailBuilderInterface.php b/engine/Shopware/Bundle/MailBundle/Service/LogEntryMailBuilderInterface.php index f24691c0497..9db0e38f4b6 100644 --- a/engine/Shopware/Bundle/MailBundle/Service/LogEntryMailBuilderInterface.php +++ b/engine/Shopware/Bundle/MailBundle/Service/LogEntryMailBuilderInterface.php @@ -1,4 +1,5 @@ section('Searching for unused media files.'); $total = $this->handleMove(); - $io->text(sprintf('%s unused item(s) found.', $total)); + $io->text(\sprintf('%s unused item(s) found.', $total)); if ($total === 0) { return 0; @@ -73,12 +73,12 @@ protected function execute(InputInterface $input, OutputInterface $output) } $deleted = $this->handleCleanup($io); - $io->success(sprintf('%d item(s) deleted.', $deleted)); + $io->success(\sprintf('%d item(s) deleted.', $deleted)); return 0; } - $io->success(sprintf('%d item(s) in recycle bin.', $total)); + $io->success(\sprintf('%d item(s) in recycle bin.', $total)); return 0; } diff --git a/engine/Shopware/Bundle/MediaBundle/Commands/MediaOptimizeCommand.php b/engine/Shopware/Bundle/MediaBundle/Commands/MediaOptimizeCommand.php index fe7ad873b3a..dd8cfe82fd0 100644 --- a/engine/Shopware/Bundle/MediaBundle/Commands/MediaOptimizeCommand.php +++ b/engine/Shopware/Bundle/MediaBundle/Commands/MediaOptimizeCommand.php @@ -1,4 +1,5 @@ extension = $extension; - $message = sprintf('The file extension "%s" is blacklisted.', $extension); + $message = \sprintf('The file extension "%s" is blacklisted.', $extension); parent::__construct($message); } diff --git a/engine/Shopware/Bundle/MediaBundle/Exception/MediaFileExtensionNotAllowedException.php b/engine/Shopware/Bundle/MediaBundle/Exception/MediaFileExtensionNotAllowedException.php index 0f000a7e7a7..9aa5636b501 100644 --- a/engine/Shopware/Bundle/MediaBundle/Exception/MediaFileExtensionNotAllowedException.php +++ b/engine/Shopware/Bundle/MediaBundle/Exception/MediaFileExtensionNotAllowedException.php @@ -1,4 +1,5 @@ extension = $extension; - $message = sprintf('The media file extension "%s" is not allowed.', $extension); + $message = \sprintf('The media file extension "%s" is not allowed.', $extension); parent::__construct($message); } diff --git a/engine/Shopware/Bundle/MediaBundle/Exception/OptimizerNotFoundException.php b/engine/Shopware/Bundle/MediaBundle/Exception/OptimizerNotFoundException.php index 3668a589a7b..520cd3458a8 100644 --- a/engine/Shopware/Bundle/MediaBundle/Exception/OptimizerNotFoundException.php +++ b/engine/Shopware/Bundle/MediaBundle/Exception/OptimizerNotFoundException.php @@ -1,4 +1,5 @@ requiredType = $requiredType; - $message = sprintf('To replace the media file, a "%s" file is required.', $requiredType); + $message = \sprintf('To replace the media file, a "%s" file is required.', $requiredType); parent::__construct($message); } diff --git a/engine/Shopware/Bundle/MediaBundle/GarbageCollector.php b/engine/Shopware/Bundle/MediaBundle/GarbageCollector.php index decf0b16a65..08460ce1517 100644 --- a/engine/Shopware/Bundle/MediaBundle/GarbageCollector.php +++ b/engine/Shopware/Bundle/MediaBundle/GarbageCollector.php @@ -232,7 +232,7 @@ private function handleTablesWithIdsSeparatedByPipes(MediaPosition $mediaPositio private function handleTable(MediaPosition $mediaPosition): void { - $sql = sprintf( + $sql = \sprintf( 'INSERT INTO s_media_used SELECT DISTINCT NULL, media.id FROM s_media media @@ -274,7 +274,7 @@ private function processQueue(): void if (!empty($this->queue['id'])) { $ids = array_keys(array_flip($this->queue['id'])); $this->connection->executeQuery( - sprintf('INSERT INTO s_media_used (mediaId) VALUES (%s)', implode('),(', $ids)) + \sprintf('INSERT INTO s_media_used (mediaId) VALUES (%s)', implode('),(', $ids)) ); } } diff --git a/engine/Shopware/Bundle/MediaBundle/GarbageCollectorFactory.php b/engine/Shopware/Bundle/MediaBundle/GarbageCollectorFactory.php index 7321c2db9cf..b2333393469 100644 --- a/engine/Shopware/Bundle/MediaBundle/GarbageCollectorFactory.php +++ b/engine/Shopware/Bundle/MediaBundle/GarbageCollectorFactory.php @@ -1,4 +1,5 @@ modelManager->find(Media::class, $mediaId); if ($media === null) { - throw new InvalidArgumentException(sprintf('Media with id %s not found', $mediaId)); + throw new InvalidArgumentException(\sprintf('Media with id %s not found', $mediaId)); } $filePath = $file->getRealPath(); if (!\is_string($filePath)) { - throw new UnexpectedValueException(sprintf('Could not get path of file "%s"', $file->getFilename())); + throw new UnexpectedValueException(\sprintf('Could not get path of file "%s"', $file->getFilename())); } $uploadedFileExtension = $this->getExtension($file); @@ -102,7 +103,7 @@ public function replace($mediaId, UploadedFile $file) $this->mediaService->write($media->getPath(), $fileContent); } else { $pathInfo = pathinfo($media->getPath()); - $newFileName = sprintf('%s/%s.%s', $pathInfo['dirname'] ?? '', $pathInfo['filename'], $newExtension); + $newFileName = \sprintf('%s/%s.%s', $pathInfo['dirname'] ?? '', $pathInfo['filename'], $newExtension); $this->mediaService->delete($media->getPath()); $this->mediaService->write($newFileName, $fileContent); $this->modelManager->getConnection()->update('s_articles_img', [ diff --git a/engine/Shopware/Bundle/MediaBundle/MediaReplaceServiceInterface.php b/engine/Shopware/Bundle/MediaBundle/MediaReplaceServiceInterface.php index 27a930e7dca..c61945afd87 100644 --- a/engine/Shopware/Bundle/MediaBundle/MediaReplaceServiceInterface.php +++ b/engine/Shopware/Bundle/MediaBundle/MediaReplaceServiceInterface.php @@ -1,4 +1,5 @@ config = $config; if (!isset($config['mediaUrl'])) { - throw new Exception(sprintf('Please provide a "mediaUrl" in your %s adapter.', $config['type'])); + throw new Exception(\sprintf('Please provide a "mediaUrl" in your %s adapter.', $config['type'])); } $mediaUrl = $config['mediaUrl'] ?: $this->createFallbackMediaUrl(); diff --git a/engine/Shopware/Bundle/MediaBundle/MediaServiceFactory.php b/engine/Shopware/Bundle/MediaBundle/MediaServiceFactory.php index 3b35ef20aff..49e2095f909 100644 --- a/engine/Shopware/Bundle/MediaBundle/MediaServiceFactory.php +++ b/engine/Shopware/Bundle/MediaBundle/MediaServiceFactory.php @@ -1,4 +1,5 @@ cdnConfig['adapters'][$backendName])) { - throw new Exception(sprintf('Configuration "%s" not found', $backendName)); + throw new Exception(\sprintf('Configuration "%s" not found', $backendName)); } // Filesystem @@ -103,7 +104,7 @@ private function getAdapterByCollectEvent($config) $adapter = $adapters->first(); if (!$adapter) { - throw new Exception(sprintf('CDN Adapter "%s" not found.', $config['type'])); + throw new Exception(\sprintf('CDN Adapter "%s" not found.', $config['type'])); } return $adapter; diff --git a/engine/Shopware/Bundle/MediaBundle/MediaServiceInterface.php b/engine/Shopware/Bundle/MediaBundle/MediaServiceInterface.php index ae0335e1c53..b951aba5992 100644 --- a/engine/Shopware/Bundle/MediaBundle/MediaServiceInterface.php +++ b/engine/Shopware/Bundle/MediaBundle/MediaServiceInterface.php @@ -1,4 +1,5 @@ getShippingCostMultiplier($calculationType, $basket, $dispatch); @@ -74,7 +74,7 @@ public function calculateDispatchSurcharge(array $basket, array $dispatch): floa LIMIT 1', [$from, $dispatch['id']]); if ($result === false) { - throw new RuntimeException(sprintf('Shipping calculation not found for dispatch ID "%d" and from value of "%d"', $dispatch['id'], $from)); + throw new RuntimeException(\sprintf('Shipping calculation not found for dispatch ID "%d" and from value of "%d"', $dispatch['id'], $from)); } $surcharge += $result['value']; if (!empty($result['factor'])) { diff --git a/engine/Shopware/Bundle/OrderBundle/Service/StockService.php b/engine/Shopware/Bundle/OrderBundle/Service/StockService.php index 1d5715b3385..d4baa87df72 100644 --- a/engine/Shopware/Bundle/OrderBundle/Service/StockService.php +++ b/engine/Shopware/Bundle/OrderBundle/Service/StockService.php @@ -1,4 +1,5 @@ token = $token; $this->domain = $domain; @@ -71,7 +72,7 @@ public function __construct($token, $domain, $shopwareVersion, $technicalName) */ public function getTechnicalName() { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); return $this->technicalName; } @@ -81,7 +82,7 @@ public function getTechnicalName() */ public function getShopwareVersion() { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); return $this->shopwareVersion; } @@ -91,7 +92,7 @@ public function getShopwareVersion() */ public function getDomain() { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); return $this->domain; } @@ -101,7 +102,7 @@ public function getDomain() */ public function getToken() { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); return $this->token; } diff --git a/engine/Shopware/Bundle/PluginInstallerBundle/Context/PluginsByTechnicalNameRequest.php b/engine/Shopware/Bundle/PluginInstallerBundle/Context/PluginsByTechnicalNameRequest.php index 6b7a4563809..d4aad7de4e6 100644 --- a/engine/Shopware/Bundle/PluginInstallerBundle/Context/PluginsByTechnicalNameRequest.php +++ b/engine/Shopware/Bundle/PluginInstallerBundle/Context/PluginsByTechnicalNameRequest.php @@ -1,4 +1,5 @@ getInstalled()) { - throw new Exception(sprintf('Plugin "%s" has to be installed first before it can be activated.', $plugin->getName())); + throw new Exception(\sprintf('Plugin "%s" has to be installed first before it can be activated.', $plugin->getName())); } if (!$plugin->isLegacyPlugin()) { diff --git a/engine/Shopware/Bundle/PluginInstallerBundle/Service/LegacyPluginExtractor.php b/engine/Shopware/Bundle/PluginInstallerBundle/Service/LegacyPluginExtractor.php index ac27b8ddbe2..01a20e6c07e 100644 --- a/engine/Shopware/Bundle/PluginInstallerBundle/Service/LegacyPluginExtractor.php +++ b/engine/Shopware/Bundle/PluginInstallerBundle/Service/LegacyPluginExtractor.php @@ -1,4 +1,5 @@ validatePluginZip($archive); @@ -119,7 +120,7 @@ private function clearOpcodeCache(): void private function assertPrefix(string $filename, string $prefix): void { if (!str_starts_with($filename, $prefix)) { - throw new RuntimeException(sprintf('Detected invalid file/directory %s in the plugin zip: %s', $filename, $prefix)); + throw new RuntimeException(\sprintf('Detected invalid file/directory %s in the plugin zip: %s', $filename, $prefix)); } } diff --git a/engine/Shopware/Bundle/PluginInstallerBundle/Service/LegacyPluginInstaller.php b/engine/Shopware/Bundle/PluginInstallerBundle/Service/LegacyPluginInstaller.php index bcfec40b46d..1b22941152c 100644 --- a/engine/Shopware/Bundle/PluginInstallerBundle/Service/LegacyPluginInstaller.php +++ b/engine/Shopware/Bundle/PluginInstallerBundle/Service/LegacyPluginInstaller.php @@ -1,4 +1,5 @@ getName(); $pluginByName = $namespace->get($pluginName); if ($pluginByName === null) { - throw new RuntimeException(sprintf('Plugin by name "%s" was not found.', $pluginName)); + throw new RuntimeException(\sprintf('Plugin by name "%s" was not found.', $pluginName)); } return $pluginByName; @@ -101,16 +102,16 @@ public function installPlugin(Plugin $plugin) try { $result = $namespace->installPlugin($bootstrap); } catch (Exception $e) { - throw new Exception(sprintf("Unable to install '%s', got exception:\n%s\n", $plugin->getName(), $e->getMessage()), 0, $e); + throw new Exception(\sprintf("Unable to install '%s', got exception:\n%s\n", $plugin->getName(), $e->getMessage()), 0, $e); } $result = \is_bool($result) ? ['success' => $result] : $result; if (!$result['success']) { if (isset($result['message'])) { - throw new Exception(sprintf("Unable to install '%s', got message:\n'%s'\n", $plugin->getName(), $result['message'])); + throw new Exception(\sprintf("Unable to install '%s', got message:\n'%s'\n", $plugin->getName(), $result['message'])); } - throw new Exception(sprintf('Unable to install "%s", an unknown error occured.', $plugin->getName())); + throw new Exception(\sprintf('Unable to install "%s", an unknown error occured.', $plugin->getName())); } return $result; @@ -133,16 +134,16 @@ public function uninstallPlugin(Plugin $plugin, $removeData = true) try { $result = $namespace->uninstallPlugin($bootstrap, $removeData); } catch (Exception $e) { - throw new Exception(sprintf("Unable to uninstall '%s', got exception:\n%s\n", $plugin->getName(), $e->getMessage()), 0, $e); + throw new Exception(\sprintf("Unable to uninstall '%s', got exception:\n%s\n", $plugin->getName(), $e->getMessage()), 0, $e); } $result = \is_bool($result) ? ['success' => $result] : $result; if (!$result['success']) { if (isset($result['message'])) { - throw new Exception(sprintf("Unable to uninstall '%s', got message:\n%s\n", $plugin->getName(), $result['message'])); + throw new Exception(\sprintf("Unable to uninstall '%s', got message:\n%s\n", $plugin->getName(), $result['message'])); } - throw new Exception(sprintf('Unable to uninstall %s, an unknown error occured.', $plugin->getName())); + throw new Exception(\sprintf('Unable to uninstall %s, an unknown error occured.', $plugin->getName())); } return $result; @@ -163,16 +164,16 @@ public function updatePlugin(Plugin $plugin) try { $result = $namespace->updatePlugin($bootstrap); } catch (Exception $e) { - throw new Exception(sprintf("Unable to update '%s', got exception:\n'%s'\n", $plugin->getName(), $e->getMessage()), 0, $e); + throw new Exception(\sprintf("Unable to update '%s', got exception:\n'%s'\n", $plugin->getName(), $e->getMessage()), 0, $e); } $result = \is_bool($result) ? ['success' => $result] : $result; if (!$result['success']) { if (isset($result['message'])) { - throw new Exception(sprintf("Unable to update '%s', got message:\n%s\n", $plugin->getName(), $result['message'])); + throw new Exception(\sprintf("Unable to update '%s', got message:\n%s\n", $plugin->getName(), $result['message'])); } - throw new Exception(sprintf('Unable to update "%s", an unknown error occured.', $plugin->getName())); + throw new Exception(\sprintf('Unable to update "%s", an unknown error occured.', $plugin->getName())); } return $result; @@ -191,7 +192,7 @@ public function activatePlugin(Plugin $plugin) $result = \is_bool($result) ? ['success' => $result] : $result; if ($result['success'] == false) { - throw new Exception(sprintf('Not allowed to enable plugin "%s".', $plugin->getName())); + throw new Exception(\sprintf('Not allowed to enable plugin "%s".', $plugin->getName())); } $plugin->setActive(true); @@ -214,7 +215,7 @@ public function deactivatePlugin(Plugin $plugin) $result = \is_bool($result) ? ['success' => $result] : $result; if ($result['success'] == false) { - throw new Exception(sprintf('Not allowed to disable plugin "%s".', $plugin->getName())); + throw new Exception(\sprintf('Not allowed to disable plugin "%s".', $plugin->getName())); } $plugin->setActive(false); @@ -253,7 +254,7 @@ public function refreshPluginList(DateTimeInterface $refreshDate) $name = $dir->getFilename(); if ($this->validateIonCube($file)) { - throw new Exception(sprintf('Plugin "%s" is encrypted but the ionCube Loader extension is not installed', $name)); + throw new Exception(\sprintf('Plugin "%s" is encrypted but the ionCube Loader extension is not installed', $name)); } $plugin = $collection->get($name); diff --git a/engine/Shopware/Bundle/PluginInstallerBundle/Service/PluginCategoryService.php b/engine/Shopware/Bundle/PluginInstallerBundle/Service/PluginCategoryService.php index 97b622c1d82..0d22f8cd571 100644 --- a/engine/Shopware/Bundle/PluginInstallerBundle/Service/PluginCategoryService.php +++ b/engine/Shopware/Bundle/PluginInstallerBundle/Service/PluginCategoryService.php @@ -1,4 +1,5 @@ pluginDir; if (!is_writable($destination)) { - throw new Exception(sprintf('Destination directory "%s" is not writable', $destination)); + throw new Exception(\sprintf('Destination directory "%s" is not writable', $destination)); } $prefix = $this->getPluginPrefix($archive); @@ -150,7 +151,7 @@ private function clearOpcodeCache(): void private function assertPrefix(string $filename, string $prefix): void { if (strpos($filename, $prefix) !== 0) { - throw new RuntimeException(sprintf('Detected invalid file/directory %s in the plugin zip: %s', $filename, $prefix)); + throw new RuntimeException(\sprintf('Detected invalid file/directory %s in the plugin zip: %s', $filename, $prefix)); } } diff --git a/engine/Shopware/Bundle/PluginInstallerBundle/Service/PluginInitializer.php b/engine/Shopware/Bundle/PluginInstallerBundle/Service/PluginInitializer.php index 13c14ae277c..777706b51cb 100644 --- a/engine/Shopware/Bundle/PluginInstallerBundle/Service/PluginInitializer.php +++ b/engine/Shopware/Bundle/PluginInstallerBundle/Service/PluginInitializer.php @@ -1,4 +1,5 @@ $pluginDetails) { if (!class_exists($pluginDetails['className'])) { - throw new RuntimeException(sprintf('Unable to load class %s for plugin %s in file %s', $pluginDetails['className'], $pluginName, $pluginDetails['pluginFile'])); + throw new RuntimeException(\sprintf('Unable to load class %s for plugin %s in file %s', $pluginDetails['className'], $pluginName, $pluginDetails['pluginFile'])); } $plugin = new $pluginDetails['className']($pluginDetails['isActive'], $pluginDetails['pluginNamespace']); if (!$plugin instanceof Plugin) { - throw new RuntimeException(sprintf('Class %s must extend %s in file %s', \get_class($plugin), Plugin::class, $pluginDetails['pluginFile'])); + throw new RuntimeException(\sprintf('Class %s must extend %s in file %s', \get_class($plugin), Plugin::class, $pluginDetails['pluginFile'])); } $plugins[$plugin->getName()] = $plugin; diff --git a/engine/Shopware/Bundle/PluginInstallerBundle/Service/PluginInstaller.php b/engine/Shopware/Bundle/PluginInstallerBundle/Service/PluginInstaller.php index 47a9a7cf095..661d18c1287 100644 --- a/engine/Shopware/Bundle/PluginInstallerBundle/Service/PluginInstaller.php +++ b/engine/Shopware/Bundle/PluginInstallerBundle/Service/PluginInstaller.php @@ -464,7 +464,7 @@ private function getPluginByName(string $pluginName): PluginBaseClass $plugins = $this->kernel->getPlugins(); if (!isset($plugins[$pluginName])) { - throw new InvalidArgumentException(sprintf('Plugin by name "%s" not found.', $pluginName)); + throw new InvalidArgumentException(\sprintf('Plugin by name "%s" not found.', $pluginName)); } return $plugins[$pluginName]; diff --git a/engine/Shopware/Bundle/PluginInstallerBundle/Service/PluginLicenceService.php b/engine/Shopware/Bundle/PluginInstallerBundle/Service/PluginLicenceService.php index b55a9b41246..025f729d711 100644 --- a/engine/Shopware/Bundle/PluginInstallerBundle/Service/PluginLicenceService.php +++ b/engine/Shopware/Bundle/PluginInstallerBundle/Service/PluginLicenceService.php @@ -1,4 +1,5 @@ storeClient->doAuthGetRequest( $context->getToken(), diff --git a/engine/Shopware/Bundle/PluginInstallerBundle/Service/PluginViewService.php b/engine/Shopware/Bundle/PluginInstallerBundle/Service/PluginViewService.php index 42d0f8c5bf5..05880c5d871 100644 --- a/engine/Shopware/Bundle/PluginInstallerBundle/Service/PluginViewService.php +++ b/engine/Shopware/Bundle/PluginInstallerBundle/Service/PluginViewService.php @@ -1,4 +1,5 @@ getHeader($signatureHeaderName); if (!\is_string($signature)) { - throw new RuntimeException(sprintf('Signature not found in header "%s"', $signatureHeaderName)); + throw new RuntimeException(\sprintf('Signature not found in header "%s"', $signatureHeaderName)); } if (!$this->openSSLVerifier->isSystemSupported()) { diff --git a/engine/Shopware/Bundle/PluginInstallerBundle/Struct/AccessTokenStruct.php b/engine/Shopware/Bundle/PluginInstallerBundle/Struct/AccessTokenStruct.php index 3c9bfbb7bd4..7046731386d 100644 --- a/engine/Shopware/Bundle/PluginInstallerBundle/Struct/AccessTokenStruct.php +++ b/engine/Shopware/Bundle/PluginInstallerBundle/Struct/AccessTokenStruct.php @@ -1,4 +1,5 @@ isShopUpgraded = $isShopUpgraded; $this->notUpgradedPlugins = $notUpgradedPlugins; @@ -74,7 +75,7 @@ public function __construct($isShopUpgraded, $notUpgradedPlugins, $wrongVersionP */ public function getIsShopUpgraded() { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.8. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.8. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); return $this->isShopUpgraded; } @@ -84,7 +85,7 @@ public function getIsShopUpgraded() */ public function getNotUpgradedPlugins() { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.8. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.8. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); return $this->notUpgradedPlugins; } @@ -94,7 +95,7 @@ public function getNotUpgradedPlugins() */ public function getWrongVersionPlugins() { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.8. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.8. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); return $this->wrongVersionPlugins; } @@ -104,7 +105,7 @@ public function getWrongVersionPlugins() */ public function getExpiredPluginSubscriptions() { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.8. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.8. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); return $this->expiredPluginSubscriptions; } diff --git a/engine/Shopware/Bundle/PluginInstallerBundle/Struct/UpdateResultStruct.php b/engine/Shopware/Bundle/PluginInstallerBundle/Struct/UpdateResultStruct.php index a2a21df1646..68fe6ae7069 100644 --- a/engine/Shopware/Bundle/PluginInstallerBundle/Struct/UpdateResultStruct.php +++ b/engine/Shopware/Bundle/PluginInstallerBundle/Struct/UpdateResultStruct.php @@ -1,4 +1,5 @@ storage[$key]; } - throw new OutOfBoundsException(sprintf('Key "%s" was not found.', $key)); + throw new OutOfBoundsException(\sprintf('Key "%s" was not found.', $key)); } /** diff --git a/engine/Shopware/Bundle/SearchBundle/BatchProductSearch.php b/engine/Shopware/Bundle/SearchBundle/BatchProductSearch.php index 45659214c8c..ac5b0deb80b 100644 --- a/engine/Shopware/Bundle/SearchBundle/BatchProductSearch.php +++ b/engine/Shopware/Bundle/SearchBundle/BatchProductSearch.php @@ -1,4 +1,5 @@ $products - * @param Struct\BaseProduct[] $searchProducts + * @param array $products + * @param Struct\BaseProduct[] $searchProducts * - * @return Struct\ListProduct[] + * @return ListProduct[] */ private function assignAttributes($products, $searchProducts) { diff --git a/engine/Shopware/Bundle/SearchBundle/BatchProductSearchResult.php b/engine/Shopware/Bundle/SearchBundle/BatchProductSearchResult.php index 4e264d54026..9ac188f2f91 100644 --- a/engine/Shopware/Bundle/SearchBundle/BatchProductSearchResult.php +++ b/engine/Shopware/Bundle/SearchBundle/BatchProductSearchResult.php @@ -1,4 +1,5 @@ storage[$key]; } - throw new OutOfBoundsException(sprintf('Key "%s" was not found.', $key)); + throw new OutOfBoundsException(\sprintf('Key "%s" was not found.', $key)); } /** diff --git a/engine/Shopware/Bundle/SearchBundle/Condition/CategoryCondition.php b/engine/Shopware/Bundle/SearchBundle/Condition/CategoryCondition.php index e284f7305fb..05081851110 100644 --- a/engine/Shopware/Bundle/SearchBundle/Condition/CategoryCondition.php +++ b/engine/Shopware/Bundle/SearchBundle/Condition/CategoryCondition.php @@ -1,4 +1,5 @@ listTableColumns($table); if (empty($columns)) { - throw new RuntimeException(sprintf('Could not retrieve columns from "%s".', $table)); + throw new RuntimeException(\sprintf('Could not retrieve columns from "%s".', $table)); } $names = array_map(function (Column $column) { @@ -75,7 +76,7 @@ public function parse(QueryBuilder $query, $table, $tableAlias, $field = null, $ }, $columns); if (!\array_key_exists(strtolower($field), $names)) { - throw new InvalidArgumentException(sprintf('Invalid column name "%s" specified.', $field), 1); + throw new InvalidArgumentException(\sprintf('Invalid column name "%s" specified.', $field), 1); } $validOperators = [ @@ -102,12 +103,12 @@ public function parse(QueryBuilder $query, $table, $tableAlias, $field = null, $ * When an operator is not specified, by default, return all results that are not null */ if (empty($operator)) { - throw new InvalidArgumentException(sprintf('Must specify an operator, please use one of: %s', implode(', ', $validOperators)), 3); + throw new InvalidArgumentException(\sprintf('Must specify an operator, please use one of: %s', implode(', ', $validOperators)), 3); } // Identify each field placeholder value with table alias and a hash of condition properties - $boundParamName = sprintf(':%s_%s', $tableAlias, md5($field . $operator . json_encode($value))); - $field = sprintf('%s.%s', $tableAlias, $field); + $boundParamName = \sprintf(':%s_%s', $tableAlias, md5($field . $operator . json_encode($value))); + $field = \sprintf('%s.%s', $tableAlias, $field); switch (true) { case $operator === Condition::OPERATOR_EQ: @@ -202,7 +203,7 @@ public function parse(QueryBuilder $query, $table, $tableAlias, $field = null, $ break; default: - throw new InvalidArgumentException(sprintf('Invalid operator specified, please use one of: %s', implode(', ', $validOperators)), 3); + throw new InvalidArgumentException(\sprintf('Invalid operator specified, please use one of: %s', implode(', ', $validOperators)), 3); } } } diff --git a/engine/Shopware/Bundle/SearchBundleDBAL/ConditionHandler/HeightConditionHandler.php b/engine/Shopware/Bundle/SearchBundleDBAL/ConditionHandler/HeightConditionHandler.php index 49cc7d4068c..1e0f1b128cf 100644 --- a/engine/Shopware/Bundle/SearchBundleDBAL/ConditionHandler/HeightConditionHandler.php +++ b/engine/Shopware/Bundle/SearchBundleDBAL/ConditionHandler/HeightConditionHandler.php @@ -1,4 +1,5 @@ config->get('markAsNew'); $timestamp = strtotime('-' . $dayLimit . ' days'); if ($timestamp === false) { - throw new RuntimeException(sprintf('Could not convert "-%s days" into a timestamp', $dayLimit)); + throw new RuntimeException(\sprintf('Could not convert "-%s days" into a timestamp', $dayLimit)); } $query->andWhere('product.datum >= ' . $key) diff --git a/engine/Shopware/Bundle/SearchBundleDBAL/ConditionHandler/LastProductIdConditionHandler.php b/engine/Shopware/Bundle/SearchBundleDBAL/ConditionHandler/LastProductIdConditionHandler.php index a730b3a9dca..c5e450b8df2 100644 --- a/engine/Shopware/Bundle/SearchBundleDBAL/ConditionHandler/LastProductIdConditionHandler.php +++ b/engine/Shopware/Bundle/SearchBundleDBAL/ConditionHandler/LastProductIdConditionHandler.php @@ -1,4 +1,5 @@ getPriceColumns() as $column) { - $switch[] = sprintf($template, $column, $column, $column); + $switch[] = \sprintf($template, $column, $column, $column); } $switch[] = 'defaultPrice.articleID as product_id'; @@ -176,10 +177,10 @@ private function getDefaultPriceColumns() $template = 'defaultPrice.%s'; $switch = []; foreach ($this->getPriceColumns() as $column) { - $switch[] = sprintf($template, $column); + $switch[] = \sprintf($template, $column); } - $switch[] = sprintf($template, 'articleID as product_id'); - $switch[] = sprintf($template, 'articledetailsID as variant_id'); + $switch[] = \sprintf($template, 'articleID as product_id'); + $switch[] = \sprintf($template, 'articledetailsID as variant_id'); return implode(',', $switch); } diff --git a/engine/Shopware/Bundle/SearchBundleDBAL/ListingPriceSwitcher.php b/engine/Shopware/Bundle/SearchBundleDBAL/ListingPriceSwitcher.php index fe730ef89a3..1d9f0572a2a 100644 --- a/engine/Shopware/Bundle/SearchBundleDBAL/ListingPriceSwitcher.php +++ b/engine/Shopware/Bundle/SearchBundleDBAL/ListingPriceSwitcher.php @@ -1,4 +1,5 @@ getFacetHandler($facet); if ($criteria->generatePartialFacets() && !$handler instanceof PartialFacetHandlerInterface) { - throw new RuntimeException(sprintf("New filter mode activated, handler class %s doesn't support this mode", \get_class($handler))); + throw new RuntimeException(\sprintf("New filter mode activated, handler class %s doesn't support this mode", \get_class($handler))); } if ($handler instanceof PartialFacetHandlerInterface) { $result = $handler->generatePartialFacet($facet, $clone, $criteria, $context); } else { - trigger_error(sprintf("Facet handler %s doesn't support new filter mode. FacetHandlerInterface is deprecated since version 5.3 and will be removed in 5.8.", \get_class($handler)), E_USER_DEPRECATED); + trigger_error(\sprintf("Facet handler %s doesn't support new filter mode. FacetHandlerInterface is deprecated since version 5.3 and will be removed in 5.8.", \get_class($handler)), E_USER_DEPRECATED); $result = $handler->generateFacet($facet, $criteria, $context); } @@ -209,7 +210,7 @@ private function getFacetHandler(SearchBundle\FacetInterface $facet) } } - throw new Exception(sprintf('Facet %s not supported', \get_class($facet))); + throw new Exception(\sprintf('Facet %s not supported', \get_class($facet))); } /** @@ -226,7 +227,7 @@ private function assertCollectionIsInstanceOf(ArrayCollection $objects, $classes } } if (!$implements) { - throw new RuntimeException(sprintf('Object of class "%s" has to implement one of the following interfaces: "%s".', \get_class($object), implode(',', $classes))); + throw new RuntimeException(\sprintf('Object of class "%s" has to implement one of the following interfaces: "%s".', \get_class($object), implode(',', $classes))); } } } diff --git a/engine/Shopware/Bundle/SearchBundleDBAL/QueryBuilder.php b/engine/Shopware/Bundle/SearchBundleDBAL/QueryBuilder.php index e80d37c8ef0..704fc7c1e52 100644 --- a/engine/Shopware/Bundle/SearchBundleDBAL/QueryBuilder.php +++ b/engine/Shopware/Bundle/SearchBundleDBAL/QueryBuilder.php @@ -1,4 +1,5 @@ addSelect( - sprintf( + \sprintf( '(SELECT COUNT(*) * :threshold FROM %s) AS cnt_%1$s', $selected[] = ($table['reference_table'] ?: $table['table']) ) @@ -275,7 +276,7 @@ private function cleanupIndex(): void } $qb->orHaving( - sprintf( + \sprintf( 'tableId = %d AND count_self > cnt_%s', $table['tableID'], $table['reference_table'] ?: $table['table'] diff --git a/engine/Shopware/Bundle/SearchBundleDBAL/SearchTerm/SearchIndexerInterface.php b/engine/Shopware/Bundle/SearchBundleDBAL/SearchTerm/SearchIndexerInterface.php index 63b5db0428e..1e6b13019b6 100644 --- a/engine/Shopware/Bundle/SearchBundleDBAL/SearchTerm/SearchIndexerInterface.php +++ b/engine/Shopware/Bundle/SearchBundleDBAL/SearchTerm/SearchIndexerInterface.php @@ -1,4 +1,5 @@ listingPriceHelper->getPriceColumns() ) diff --git a/engine/Shopware/Bundle/SearchBundleDBAL/VariantHelperInterface.php b/engine/Shopware/Bundle/SearchBundleDBAL/VariantHelperInterface.php index d97fa06300d..232492e6115 100644 --- a/engine/Shopware/Bundle/SearchBundleDBAL/VariantHelperInterface.php +++ b/engine/Shopware/Bundle/SearchBundleDBAL/VariantHelperInterface.php @@ -1,4 +1,5 @@ container->get(HandlerRegistry::class); if (!$handlerRegistry instanceof HandlerRegistry) { - throw new RuntimeException(sprintf('%s is missing', HandlerRegistry::class)); + throw new RuntimeException(\sprintf('%s is missing', HandlerRegistry::class)); } foreach ($conditions as $condition) { diff --git a/engine/Shopware/Bundle/SearchBundleES/ConditionHandler/CategoryConditionHandler.php b/engine/Shopware/Bundle/SearchBundleES/ConditionHandler/CategoryConditionHandler.php index 8e9752db497..df6f08f45e3 100644 --- a/engine/Shopware/Bundle/SearchBundleES/ConditionHandler/CategoryConditionHandler.php +++ b/engine/Shopware/Bundle/SearchBundleES/ConditionHandler/CategoryConditionHandler.php @@ -1,4 +1,5 @@ config->get('markAsNew'); $timestamp = strtotime('-' . $dayLimit . ' days'); if ($timestamp === false) { - throw new RuntimeException(sprintf('Could not convert "-%s days" into a timestamp', $dayLimit)); + throw new RuntimeException(\sprintf('Could not convert "-%s days" into a timestamp', $dayLimit)); } return new RangeQuery('formattedCreatedAt', [ diff --git a/engine/Shopware/Bundle/SearchBundleES/ConditionHandler/LastProductIdConditionHandler.php b/engine/Shopware/Bundle/SearchBundleES/ConditionHandler/LastProductIdConditionHandler.php index 8201deba2c7..397da798a3d 100644 --- a/engine/Shopware/Bundle/SearchBundleES/ConditionHandler/LastProductIdConditionHandler.php +++ b/engine/Shopware/Bundle/SearchBundleES/ConditionHandler/LastProductIdConditionHandler.php @@ -1,4 +1,5 @@ attributeService->get('s_articles_attributes', $criteriaPart->getField()); if (!$attribute instanceof ConfigurationStruct) { - throw new RuntimeException(sprintf('Attribute not found for field %s', $criteriaPart->getField())); + throw new RuntimeException(\sprintf('Attribute not found for field %s', $criteriaPart->getField())); } $type = $attribute->getElasticSearchType()['type']; @@ -207,7 +208,7 @@ private function getQuery(ProductAttributeCondition $criteriaPart): BuilderInter return new WildcardQuery($field, '*' . $value); default: - throw new RuntimeException(sprintf('Operator %s is not supported in elastic search', $criteriaPart->getOperator())); + throw new RuntimeException(\sprintf('Operator %s is not supported in elastic search', $criteriaPart->getOperator())); } } } diff --git a/engine/Shopware/Bundle/SearchBundleES/ConditionHandler/ProductIdConditionHandler.php b/engine/Shopware/Bundle/SearchBundleES/ConditionHandler/ProductIdConditionHandler.php index 3630c2790ea..856908d72ca 100644 --- a/engine/Shopware/Bundle/SearchBundleES/ConditionHandler/ProductIdConditionHandler.php +++ b/engine/Shopware/Bundle/SearchBundleES/ConditionHandler/ProductIdConditionHandler.php @@ -1,4 +1,5 @@ getDirection())); + throw new RuntimeException(\sprintf('Provided release date direction %s not supported', $criteriaPart->getDirection())); } } } diff --git a/engine/Shopware/Bundle/SearchBundleES/ConditionHandler/SalesConditionHandler.php b/engine/Shopware/Bundle/SearchBundleES/ConditionHandler/SalesConditionHandler.php index 607f600fa73..7ce47e21a96 100644 --- a/engine/Shopware/Bundle/SearchBundleES/ConditionHandler/SalesConditionHandler.php +++ b/engine/Shopware/Bundle/SearchBundleES/ConditionHandler/SalesConditionHandler.php @@ -1,4 +1,5 @@ handleFilter($condition, $criteria, $search, $context); } else { - trigger_error(sprintf("Condition handler %s doesn't support new filter mode. Class has to implement \\Shopware\\Bundle\\SearchBundleES\\PartialConditionHandlerInterface.", \get_class($handler)), E_USER_DEPRECATED); + trigger_error(\sprintf("Condition handler %s doesn't support new filter mode. Class has to implement \\Shopware\\Bundle\\SearchBundleES\\PartialConditionHandlerInterface.", \get_class($handler)), E_USER_DEPRECATED); $handler->handle($condition, $criteria, $search, $context); } } @@ -199,12 +200,12 @@ private function addConditions( // Trigger error when new interface isn't implemented if (!$handler instanceof PartialConditionHandlerInterface) { - trigger_error(sprintf('Condition handler "%s" doesn\'t support new filter mode. Class has to implement "%s".', \get_class($handler), PartialConditionHandlerInterface::class), E_USER_DEPRECATED); + trigger_error(\sprintf('Condition handler "%s" doesn\'t support new filter mode. Class has to implement "%s".', \get_class($handler), PartialConditionHandlerInterface::class), E_USER_DEPRECATED); } // Filter mode active and handler doesn't supports the filter mode? if (!$handler instanceof PartialConditionHandlerInterface && $criteria->generatePartialFacets()) { - throw new Exception(sprintf('New filter mode activated, handler class %s doesn\'t support this mode', \get_class($handler))); + throw new Exception(\sprintf('New filter mode activated, handler class %s doesn\'t support this mode', \get_class($handler))); } // Filter mode active and handler supports new filter mode? diff --git a/engine/Shopware/Bundle/SearchBundleES/ResultHydratorInterface.php b/engine/Shopware/Bundle/SearchBundleES/ResultHydratorInterface.php index 84560ffbb25..dd06d0451f8 100644 --- a/engine/Shopware/Bundle/SearchBundleES/ResultHydratorInterface.php +++ b/engine/Shopware/Bundle/SearchBundleES/ResultHydratorInterface.php @@ -1,4 +1,5 @@ container->get(SitemapExporter::class); foreach ($shops as $shop) { - $output->writeln(sprintf('Generating sitemaps for shop #%d (%s)...', $shop->getId(), $shop->getName())); + $output->writeln(\sprintf('Generating sitemaps for shop #%d (%s)...', $shop->getId(), $shop->getName())); if ($input->getOption('force')) { $this->container @@ -95,7 +96,7 @@ protected function execute(InputInterface $input, OutputInterface $output) try { $sitemapExporter->generate($shop); } catch (AlreadyLockedException $exception) { - $output->writeln(sprintf('ERROR: %s', $exception->getMessage())); + $output->writeln(\sprintf('ERROR: %s', $exception->getMessage())); } } diff --git a/engine/Shopware/Bundle/SitemapBundle/ConfigHandler/ConfigHandlerInterface.php b/engine/Shopware/Bundle/SitemapBundle/ConfigHandler/ConfigHandlerInterface.php index 417765cfacf..5c734875eff 100644 --- a/engine/Shopware/Bundle/SitemapBundle/ConfigHandler/ConfigHandlerInterface.php +++ b/engine/Shopware/Bundle/SitemapBundle/ConfigHandler/ConfigHandlerInterface.php @@ -1,4 +1,5 @@ sitemapLock->doLock($shop, $this->shopwareConfig->get('sitemapRefreshTime'))) { - throw new AlreadyLockedException(sprintf('Cannot acquire lock for shop %d', $shop->getId())); + throw new AlreadyLockedException(\sprintf('Cannot acquire lock for shop %d', $shop->getId())); } $routerContext = Context::createFromShop($shop, $this->shopwareConfig); diff --git a/engine/Shopware/Bundle/SitemapBundle/Service/SitemapLister.php b/engine/Shopware/Bundle/SitemapBundle/Service/SitemapLister.php index 3a61578935e..afd7888b016 100644 --- a/engine/Shopware/Bundle/SitemapBundle/Service/SitemapLister.php +++ b/engine/Shopware/Bundle/SitemapBundle/Service/SitemapLister.php @@ -1,4 +1,5 @@ format(DateTime::ATOM)); + $data = \sprintf('Locked: %s', (new DateTime('NOW', new DateTimeZone('UTC')))->format(DateTime::ATOM)); $this->cache->save($this->generateCacheKeyForShop($shop), $data, $lifeTime); @@ -93,6 +94,6 @@ public function isLocked(Shop $shop) */ private function generateCacheKeyForShop(Shop $shop) { - return sprintf($this->cacheKey, $shop->getId()); + return \sprintf($this->cacheKey, $shop->getId()); } } diff --git a/engine/Shopware/Bundle/SitemapBundle/Service/SitemapNameGenerator.php b/engine/Shopware/Bundle/SitemapBundle/Service/SitemapNameGenerator.php index b05733abd7a..fc7110a6a4c 100644 --- a/engine/Shopware/Bundle/SitemapBundle/Service/SitemapNameGenerator.php +++ b/engine/Shopware/Bundle/SitemapBundle/Service/SitemapNameGenerator.php @@ -1,4 +1,5 @@ files)) { - throw new UnknownFileException(sprintf('No open file "%s"', $shopId)); + throw new UnknownFileException(\sprintf('No open file "%s"', $shopId)); } $fileHandle = $this->files[$shopId]['fileHandle']; @@ -155,7 +156,7 @@ private function openFile($shopId) return true; } - $filePath = sprintf( + $filePath = \sprintf( '%s/sitemap-shop-%d-%s.xml.gz', rtrim(sys_get_temp_dir(), '/'), $shopId, @@ -165,7 +166,7 @@ private function openFile($shopId) $fileHandler = gzopen($filePath, 'wb'); if (!$fileHandler) { - $this->logger->error(sprintf('Could not generate sitemap file, unable to write to "%s"', $filePath)); + $this->logger->error(\sprintf('Could not generate sitemap file, unable to write to "%s"', $filePath)); return false; } @@ -199,7 +200,7 @@ private function moveFiles() /** @var Sitemap[] $sitemaps */ foreach ($this->sitemaps as $shopId => $sitemaps) { // Delete old sitemaps for this siteId - foreach ($this->filesystem->listContents(sprintf('shop-%d', $shopId)) as $file) { + foreach ($this->filesystem->listContents(\sprintf('shop-%d', $shopId)) as $file) { $this->filesystem->delete($file['path']); } @@ -209,7 +210,7 @@ private function moveFiles() try { $this->filesystem->write($sitemapFileName, file_get_contents($sitemap->getFilename())); } catch (\League\Flysystem\Exception $exception) { - $this->logger->error(sprintf('Could not move sitemap to "%s" in the location for sitemaps', $sitemapFileName)); + $this->logger->error(\sprintf('Could not move sitemap to "%s" in the location for sitemaps', $sitemapFileName)); } finally { // If we could not move the file to it's target, we remove it here to not clutter tmp dir unlink($sitemap->getFilename()); diff --git a/engine/Shopware/Bundle/SitemapBundle/Service/UrlFilter.php b/engine/Shopware/Bundle/SitemapBundle/Service/UrlFilter.php index 77f71fcdb1c..e90a5f54814 100644 --- a/engine/Shopware/Bundle/SitemapBundle/Service/UrlFilter.php +++ b/engine/Shopware/Bundle/SitemapBundle/Service/UrlFilter.php @@ -1,4 +1,5 @@ getFilterHandler($url->getResource()); if (!$filterHandler) { - throw new UrlFilterException(sprintf('No handler known for resource \'%s\'.', $url->getResource())); + throw new UrlFilterException(\sprintf('No handler known for resource \'%s\'.', $url->getResource())); } if ($filterHandler->isFiltered($url->getIdentifier(), $filters)) { diff --git a/engine/Shopware/Bundle/SitemapBundle/SitemapBundle.php b/engine/Shopware/Bundle/SitemapBundle/SitemapBundle.php index 04baafb3617..0f9a700a561 100644 --- a/engine/Shopware/Bundle/SitemapBundle/SitemapBundle.php +++ b/engine/Shopware/Bundle/SitemapBundle/SitemapBundle.php @@ -1,4 +1,5 @@ %s%s%s%.1f', $this->getLoc(), $this->getLastmod()->format('Y-m-d'), diff --git a/engine/Shopware/Bundle/SitemapBundle/Subscriber/CronjobSubscriber.php b/engine/Shopware/Bundle/SitemapBundle/Subscriber/CronjobSubscriber.php index 5581848953e..094ef8f914b 100644 --- a/engine/Shopware/Bundle/SitemapBundle/Subscriber/CronjobSubscriber.php +++ b/engine/Shopware/Bundle/SitemapBundle/Subscriber/CronjobSubscriber.php @@ -1,4 +1,5 @@ modelManager->getRepository(Shop::class)->getActiveShopsFixed() as $shop) { - $output .= sprintf('Generating sitemaps for shop #%d (%s)...', $shop->getId(), $shop->getName()) . PHP_EOL; + $output .= \sprintf('Generating sitemaps for shop #%d (%s)...', $shop->getId(), $shop->getName()) . PHP_EOL; try { $this->sitemapExporter->generate($shop); } catch (AlreadyLockedException $exception) { - $output .= sprintf('ERROR: %s', $exception->getMessage()) . PHP_EOL; + $output .= \sprintf('ERROR: %s', $exception->getMessage()) . PHP_EOL; } } diff --git a/engine/Shopware/Bundle/SitemapBundle/UrlFilter/Base.php b/engine/Shopware/Bundle/SitemapBundle/UrlFilter/Base.php index b439a6300dd..922ed4182df 100644 --- a/engine/Shopware/Bundle/SitemapBundle/UrlFilter/Base.php +++ b/engine/Shopware/Bundle/SitemapBundle/UrlFilter/Base.php @@ -1,4 +1,5 @@ privateFilesystemRoot . '/' . $location; $response->headers->set('content-type', 'application/octet-stream'); - $response->headers->set('content-disposition', sprintf('attachment; filename="%s"', basename($location))); + $response->headers->set('content-disposition', \sprintf('attachment; filename="%s"', basename($location))); $response->headers->set('x-sendfile', $location); break; case 3: $response->headers->set('content-type', 'application/octet-stream'); - $response->headers->set('content-disposition', sprintf('attachment; filename="%s"', basename($location))); + $response->headers->set('content-disposition', \sprintf('attachment; filename="%s"', basename($location))); $response->headers->set('x-accel-redirect', $path); break; } @@ -115,14 +116,14 @@ public function send(string $location, FilesystemInterface $filesystem): void @set_time_limit(0); $response->headers->set('content-type', $mimeType); - $response->headers->set('content-disposition', sprintf('attachment; filename="%s"', basename($location))); + $response->headers->set('content-disposition', \sprintf('attachment; filename="%s"', basename($location))); $response->headers->set('content-length', $meta['size']); $response->headers->set('content-transfer-encoding', 'binary'); $response->sendHeaders(); $upstream = $filesystem->readStream($location); if (!\is_resource($upstream)) { - throw new RuntimeException(sprintf('Could not read stream from: %s', $location)); + throw new RuntimeException(\sprintf('Could not read stream from: %s', $location)); } $downstream = fopen('php://output', 'wb'); if (!\is_resource($downstream)) { diff --git a/engine/Shopware/Bundle/StaticContentBundle/Service/Core/EsdService.php b/engine/Shopware/Bundle/StaticContentBundle/Service/Core/EsdService.php index f9f69722147..07c9788b2aa 100644 --- a/engine/Shopware/Bundle/StaticContentBundle/Service/Core/EsdService.php +++ b/engine/Shopware/Bundle/StaticContentBundle/Service/Core/EsdService.php @@ -1,4 +1,5 @@ setShippingFree($listProduct->isShippingFree()); $product->setMainVariantId($listProduct->getMainVariantId()); diff --git a/engine/Shopware/Bundle/StoreFrontBundle/Exception/StructNotFoundException.php b/engine/Shopware/Bundle/StoreFrontBundle/Exception/StructNotFoundException.php index e87254bf482..4993b616afc 100644 --- a/engine/Shopware/Bundle/StoreFrontBundle/Exception/StructNotFoundException.php +++ b/engine/Shopware/Bundle/StoreFrontBundle/Exception/StructNotFoundException.php @@ -42,7 +42,7 @@ public function __construct( int $code = 0, ?Throwable $previous = null ) { - $message = sprintf('Struct of "%s" for %s "%s" not found', $structClass, $identifier, (string) $identifierValue); + $message = \sprintf('Struct of "%s" for %s "%s" not found', $structClass, $identifier, (string) $identifierValue); parent::__construct($message, $code, $previous); } } diff --git a/engine/Shopware/Bundle/StoreFrontBundle/Gateway/AddressGatewayInterface.php b/engine/Shopware/Bundle/StoreFrontBundle/Gateway/AddressGatewayInterface.php index bc8585a0da5..9d19b9d8c5a 100644 --- a/engine/Shopware/Bundle/StoreFrontBundle/Gateway/AddressGatewayInterface.php +++ b/engine/Shopware/Bundle/StoreFrontBundle/Gateway/AddressGatewayInterface.php @@ -1,4 +1,5 @@ $sortings */ $sortings = $this->reflector->unserialize( json_decode($data['__customSorting_sortings'], true), - sprintf('Serialization error in custom sorting %s', $sorting->getLabel()) + \sprintf('Serialization error in custom sorting %s', $sorting->getLabel()) ); $sorting->setSortings($sortings); @@ -93,7 +94,7 @@ public function hydrateFacet(array $data, array $streams) $facets = $this->reflector->unserialize( $facets, - sprintf('Serialization error in custom facet %s', $customFacet->getName()) + \sprintf('Serialization error in custom facet %s', $customFacet->getName()) ); if (empty($facets)) { diff --git a/engine/Shopware/Bundle/StoreFrontBundle/Gateway/DBAL/Hydrator/CustomerGroupHydrator.php b/engine/Shopware/Bundle/StoreFrontBundle/Gateway/DBAL/Hydrator/CustomerGroupHydrator.php index bc3c428a2ea..3bb353dba6a 100644 --- a/engine/Shopware/Bundle/StoreFrontBundle/Gateway/DBAL/Hydrator/CustomerGroupHydrator.php +++ b/engine/Shopware/Bundle/StoreFrontBundle/Gateway/DBAL/Hydrator/CustomerGroupHydrator.php @@ -1,4 +1,5 @@ $value) { diff --git a/engine/Shopware/Bundle/StoreFrontBundle/Gateway/DBAL/Hydrator/LinkHydrator.php b/engine/Shopware/Bundle/StoreFrontBundle/Gateway/DBAL/Hydrator/LinkHydrator.php index 92ff688b398..2c1a24a4e74 100644 --- a/engine/Shopware/Bundle/StoreFrontBundle/Gateway/DBAL/Hydrator/LinkHydrator.php +++ b/engine/Shopware/Bundle/StoreFrontBundle/Gateway/DBAL/Hydrator/LinkHydrator.php @@ -1,4 +1,5 @@ mediaService->read($data['__media_path'])); if (!\is_array($imageSize)) { - throw new RuntimeException(sprintf('Could not get image size from "%s"', $data['__media_path'])); + throw new RuntimeException(\sprintf('Could not get image size from "%s"', $data['__media_path'])); } [$width, $height] = $imageSize; $this->connection->executeUpdate( diff --git a/engine/Shopware/Bundle/StoreFrontBundle/Gateway/DBAL/Hydrator/PaymentHydrator.php b/engine/Shopware/Bundle/StoreFrontBundle/Gateway/DBAL/Hydrator/PaymentHydrator.php index 897e89ca5a9..56226c08fc8 100644 --- a/engine/Shopware/Bundle/StoreFrontBundle/Gateway/DBAL/Hydrator/PaymentHydrator.php +++ b/engine/Shopware/Bundle/StoreFrontBundle/Gateway/DBAL/Hydrator/PaymentHydrator.php @@ -1,4 +1,5 @@ execute()->fetch(PDO::FETCH_COLUMN); if (!$number) { - throw new RuntimeException(sprintf('No valid product number found by id %d', $productId)); + throw new RuntimeException(\sprintf('No valid product number found by id %d', $productId)); } return $number; @@ -75,11 +76,11 @@ public function getAvailableNumber($number, ShopContextInterface $context, $sele $productId = $this->getProductIdByNumber($number); if ($productId === 0) { - throw new RuntimeException(sprintf('No valid product id found for product with number "%s"', $number)); + throw new RuntimeException(\sprintf('No valid product id found for product with number "%s"', $number)); } if (!$this->isProductAvailableInShop($productId, $context->getShop())) { - throw new RuntimeException(sprintf('Product with number "%s" is not available in current shop', $number)); + throw new RuntimeException(\sprintf('Product with number "%s" is not available in current shop', $number)); } $selected = ''; @@ -101,7 +102,7 @@ public function getAvailableNumber($number, ShopContextInterface $context, $sele $selected = $this->findFallbackById($productId); if ($selected === '') { - throw new RuntimeException(sprintf('No active product variant found for product with number "%s" and id "%s"', $number, $productId)); + throw new RuntimeException(\sprintf('No active product variant found for product with number "%s" and id "%s"', $number, $productId)); } return $selected; diff --git a/engine/Shopware/Bundle/StoreFrontBundle/Service/Core/ProductService.php b/engine/Shopware/Bundle/StoreFrontBundle/Service/Core/ProductService.php index e12b9542aaf..97b83c996a0 100644 --- a/engine/Shopware/Bundle/StoreFrontBundle/Service/Core/ProductService.php +++ b/engine/Shopware/Bundle/StoreFrontBundle/Service/Core/ProductService.php @@ -1,4 +1,5 @@ persistUser($user); - $io->success(sprintf('Adminuser "%s" was successfully created.', $user->getUsername())); + $io->success(\sprintf('Adminuser "%s" was successfully created.', $user->getUsername())); return 0; } @@ -152,7 +153,7 @@ private function getLocaleIdFromLocale(string $locale): int return $locales[$locale]; } - throw new RuntimeException(sprintf('Backend Locale "%s" not supported', $locale)); + throw new RuntimeException(\sprintf('Backend Locale "%s" not supported', $locale)); } private function setPassword(User $user, string $plainPassword): void diff --git a/engine/Shopware/Commands/CacheClearCommand.php b/engine/Shopware/Commands/CacheClearCommand.php index 390afc50dde..aea469977d3 100644 --- a/engine/Shopware/Commands/CacheClearCommand.php +++ b/engine/Shopware/Commands/CacheClearCommand.php @@ -1,4 +1,5 @@ getContainer()->get('file_system'); if (!is_writable($realCacheDir)) { - throw new RuntimeException(sprintf('Unable to write into directory "%s"', $realCacheDir)); + throw new RuntimeException(\sprintf('Unable to write into directory "%s"', $realCacheDir)); } if ($filesystem->exists($oldCacheDir)) { @@ -69,7 +70,7 @@ protected function execute(InputInterface $input, OutputInterface $output) } $kernel = $this->getContainer()->get('kernel'); - $io->comment(sprintf('Clearing the cache for the %s environment', $kernel->getEnvironment())); + $io->comment(\sprintf('Clearing the cache for the %s environment', $kernel->getEnvironment())); $filesystem->rename($realCacheDir, $oldCacheDir); @@ -82,7 +83,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $io->comment('Finished'); } - $io->success(sprintf('Cache for the "%s" environment was successfully cleared.', $kernel->getEnvironment())); + $io->success(\sprintf('Cache for the "%s" environment was successfully cleared.', $kernel->getEnvironment())); return 0; } diff --git a/engine/Shopware/Commands/CloneCategoryTreeCommand.php b/engine/Shopware/Commands/CloneCategoryTreeCommand.php index e2c2b5a5c8d..c80b0ea66c2 100644 --- a/engine/Shopware/Commands/CloneCategoryTreeCommand.php +++ b/engine/Shopware/Commands/CloneCategoryTreeCommand.php @@ -1,4 +1,5 @@ validSteps)) + \sprintf('Valid steps: %s.', implode(', ', $this->validSteps)) ); $this->addOption( @@ -134,7 +135,7 @@ protected function execute(InputInterface $input, OutputInterface $output) foreach ($steps as $step) { if (!\in_array($step, $this->validSteps, true)) { $io->error( - sprintf("Unknown install step (%s). Valid steps: %s\n", $step, implode(', ', $this->validSteps)) + \sprintf("Unknown install step (%s). Valid steps: %s\n", $step, implode(', ', $this->validSteps)) ); return 1; @@ -181,7 +182,7 @@ protected function execute(InputInterface $input, OutputInterface $output) break; default: - $io->error(sprintf("Unknown install step (%s). Valid steps: %s\n", $step, implode(', ', $this->validSteps))); + $io->error(\sprintf("Unknown install step (%s). Valid steps: %s\n", $step, implode(', ', $this->validSteps))); return 1; } @@ -258,7 +259,7 @@ private function parseUrl(InputInterface $input) if (!empty($url)) { if (parse_url($url) === false) { throw new InvalidArgumentException( - sprintf('Invalid Shop URL (%s).', $url) + \sprintf('Invalid Shop URL (%s).', $url) ); } diff --git a/engine/Shopware/Commands/GenerateAttributesCommand.php b/engine/Shopware/Commands/GenerateAttributesCommand.php index 7d7644f606a..58b4b5b6b0f 100644 --- a/engine/Shopware/Commands/GenerateAttributesCommand.php +++ b/engine/Shopware/Commands/GenerateAttributesCommand.php @@ -1,4 +1,5 @@ findMigrationDirectory($pluginName); if ($migrationDirectory === null) { - throw new RuntimeException(sprintf('Plugin by name "%s" does not exists', $pluginName)); + throw new RuntimeException(\sprintf('Plugin by name "%s" does not exists', $pluginName)); } if (!file_exists($migrationDirectory) && !mkdir($migrationDirectory, 0777, true) && !is_dir($migrationDirectory)) { - throw new RuntimeException(sprintf('Directory "%s" was not created', $migrationDirectory)); + throw new RuntimeException(\sprintf('Directory "%s" was not created', $migrationDirectory)); } $nextVersion = $this->getLatestMigrationVersion($migrationDirectory) + 1; @@ -68,7 +68,7 @@ public function execute(InputInterface $input, OutputInterface $output) $io = new SymfonyStyle($input, $output); - $io->success(sprintf('Generated file "%s/%s"', $migrationDirectory, $fileName)); + $io->success(\sprintf('Generated file "%s/%s"', $migrationDirectory, $fileName)); return 0; } @@ -116,7 +116,7 @@ private function getLatestMigrationVersion(string $migrationFolder): int private function createMigration(string $migrationFolder, string $migrationName, ?string $pluginName, int $nextVersion): string { - $fileName = sprintf('%d-%s.php', $nextVersion, $this->camelCaseToDash($migrationName)); + $fileName = \sprintf('%d-%s.php', $nextVersion, $this->camelCaseToDash($migrationName)); file_put_contents($migrationFolder . DIRECTORY_SEPARATOR . $fileName, $this->generateMigrationFileContent($pluginName, $nextVersion)); @@ -139,7 +139,7 @@ private function generateMigrationFileContent(?string $pluginName, int $nextVers private function createCoreMigration(int $nextVersion): string { - return sprintf('cacheDir)) { if (@mkdir($this->cacheDir, 0777, true) === false) { - throw new RuntimeException(sprintf("Unable to create directory '%s'\n", $this->cacheDir)); + throw new RuntimeException(\sprintf("Unable to create directory '%s'\n", $this->cacheDir)); } } elseif (!is_writable($this->cacheDir)) { - throw new RuntimeException(sprintf("Unable to write in directory '%s'\n", $this->cacheDir)); + throw new RuntimeException(\sprintf("Unable to write in directory '%s'\n", $this->cacheDir)); } $feedId = (int) $input->getOption('feed-id'); @@ -147,16 +148,16 @@ protected function execute(InputInterface $input, OutputInterface $output) /** @var ProductFeed|null $productFeed */ $productFeed = $productFeedRepository->find((int) $feedId); if ($productFeed === null) { - throw new RuntimeException(sprintf("Unable to load feed with id %s\n", $feedId)); + throw new RuntimeException(\sprintf("Unable to load feed with id %s\n", $feedId)); } if ($productFeed->getActive() !== 1) { - throw new RuntimeException(sprintf("The feed with id %s is not active\n", $feedId)); + throw new RuntimeException(\sprintf("The feed with id %s is not active\n", $feedId)); } $this->generateFeed($export, $productFeed); } - $this->output->writeln(sprintf('Product feed cache successfully refreshed')); + $this->output->writeln(\sprintf('Product feed cache successfully refreshed')); return 0; } @@ -166,7 +167,7 @@ protected function execute(InputInterface $input, OutputInterface $output) */ private function generateFeed($export, ProductFeed $feedModel) { - $this->output->writeln(sprintf('Refreshing cache for ' . $feedModel->getName())); + $this->output->writeln(\sprintf('Refreshing cache for ' . $feedModel->getName())); $export->sFeedID = $feedModel->getId(); $export->sHash = $feedModel->getHash(); @@ -180,7 +181,7 @@ private function generateFeed($export, ProductFeed $feedModel) $handleResource = fopen($feedCachePath, 'w'); if (!\is_resource($handleResource)) { - throw new RuntimeException(sprintf('Feed cache path %s can not be opened', $feedCachePath)); + throw new RuntimeException(\sprintf('Feed cache path %s can not be opened', $feedCachePath)); } $export->executeExport($handleResource); diff --git a/engine/Shopware/Commands/ListProductFeedCommand.php b/engine/Shopware/Commands/ListProductFeedCommand.php index f3b92f6e416..a636c07150b 100644 --- a/engine/Shopware/Commands/ListProductFeedCommand.php +++ b/engine/Shopware/Commands/ListProductFeedCommand.php @@ -1,4 +1,5 @@ getPluginByName($pluginName); } catch (Exception $e) { - $output->writeln(sprintf('Plugin by name "%s" was not found.', $pluginName)); + $output->writeln(\sprintf('Plugin by name "%s" was not found.', $pluginName)); return 1; } if ($plugin->getActive()) { - $output->writeln(sprintf('The plugin %s is already activated.', $pluginName)); + $output->writeln(\sprintf('The plugin %s is already activated.', $pluginName)); return 0; } if (!$plugin->getInstalled()) { - $output->writeln(sprintf('The plugin %s has to be installed first.', $pluginName)); + $output->writeln(\sprintf('The plugin %s has to be installed first.', $pluginName)); return 1; } $activationContext = $pluginManager->activatePlugin($plugin); - $output->writeln(sprintf('Plugin %s has been activated.', $pluginName)); + $output->writeln(\sprintf('Plugin %s has been activated.', $pluginName)); $this->clearCachesIfRequested($input, $output, $activationContext); diff --git a/engine/Shopware/Commands/PluginCommand.php b/engine/Shopware/Commands/PluginCommand.php index 5e587ef1c6e..a37e901620e 100644 --- a/engine/Shopware/Commands/PluginCommand.php +++ b/engine/Shopware/Commands/PluginCommand.php @@ -1,4 +1,5 @@ container->get(CacheManager::class); $cacheTags = $this->getScheduledCaches(...$contexts); if ($cacheManager->clearByTags($cacheTags)) { - $output->writeln(sprintf('Caches cleared (%s).', implode(', ', $cacheTags))); + $output->writeln(\sprintf('Caches cleared (%s).', implode(', ', $cacheTags))); } } diff --git a/engine/Shopware/Commands/PluginConfigListCommand.php b/engine/Shopware/Commands/PluginConfigListCommand.php index 701fece4a2e..f20df8c0e48 100644 --- a/engine/Shopware/Commands/PluginConfigListCommand.php +++ b/engine/Shopware/Commands/PluginConfigListCommand.php @@ -1,4 +1,5 @@ getPluginByName($pluginName); } catch (Exception $e) { - $output->writeln(sprintf('Plugin by name "%s" was not found.', $pluginName)); + $output->writeln(\sprintf('Plugin by name "%s" was not found.', $pluginName)); return 1; } @@ -125,7 +126,7 @@ protected function execute(InputInterface $input, OutputInterface $output) /** @var Shop|null $shop */ $shop = $em->getRepository(Shop::class)->find($shopId); if (!$shop) { - $output->writeln(sprintf('Could not find shop with id %s.', $shopId)); + $output->writeln(\sprintf('Could not find shop with id %s.', $shopId)); return 1; } @@ -138,7 +139,7 @@ protected function execute(InputInterface $input, OutputInterface $output) foreach ($shops as $shop) { $config = $pluginManager->getPluginConfig($plugin, $shop); - $output->writeln(sprintf('Plugin configuration for Plugin %s and shop %s:', $pluginName, $shop->getName())); + $output->writeln(\sprintf('Plugin configuration for Plugin %s and shop %s:', $pluginName, $shop->getName())); $output->writeln(print_r($config, true)); } diff --git a/engine/Shopware/Commands/PluginConfigSetCommand.php b/engine/Shopware/Commands/PluginConfigSetCommand.php index 3007044fafd..5d84177d5fb 100644 --- a/engine/Shopware/Commands/PluginConfigSetCommand.php +++ b/engine/Shopware/Commands/PluginConfigSetCommand.php @@ -1,4 +1,5 @@ getPluginByName($pluginName); } catch (Exception $e) { - $output->writeln(sprintf('Plugin by name "%s" was not found.', $pluginName)); + $output->writeln(\sprintf('Plugin by name "%s" was not found.', $pluginName)); return 1; } @@ -188,7 +189,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $shop = $em->getRepository(Shop::class)->find($shopId); if (!$shop) { - $output->writeln(sprintf('Could not find shop with id %s.', $shopId)); + $output->writeln(\sprintf('Could not find shop with id %s.', $shopId)); return 1; } @@ -208,7 +209,7 @@ protected function execute(InputInterface $input, OutputInterface $output) } $pluginManager->saveConfigElement($plugin, $input->getArgument('key'), $value, $shop); - $output->writeln(sprintf('Plugin configuration for Plugin %s saved.', $pluginName)); + $output->writeln(\sprintf('Plugin configuration for Plugin %s saved.', $pluginName)); return 0; } diff --git a/engine/Shopware/Commands/PluginDeactivateCommand.php b/engine/Shopware/Commands/PluginDeactivateCommand.php index f968526a5cd..d33b6ed1d71 100644 --- a/engine/Shopware/Commands/PluginDeactivateCommand.php +++ b/engine/Shopware/Commands/PluginDeactivateCommand.php @@ -1,4 +1,5 @@ getPluginByName($pluginName); } catch (Exception $e) { - $output->writeln(sprintf('Plugin by name "%s" was not found.', $pluginName)); + $output->writeln(\sprintf('Plugin by name "%s" was not found.', $pluginName)); return 1; } if (!$plugin->getActive()) { - $output->writeln(sprintf('The plugin %s is already deactivated.', $pluginName)); + $output->writeln(\sprintf('The plugin %s is already deactivated.', $pluginName)); return 1; } $deactivationContext = $pluginManager->deactivatePlugin($plugin); - $output->writeln(sprintf('Plugin %s has been deactivated', $pluginName)); + $output->writeln(\sprintf('Plugin %s has been deactivated', $pluginName)); $this->clearCachesIfRequested($input, $output, $deactivationContext); diff --git a/engine/Shopware/Commands/PluginDeleteCommand.php b/engine/Shopware/Commands/PluginDeleteCommand.php index 9fabb9dcd4a..f6f9d366bef 100644 --- a/engine/Shopware/Commands/PluginDeleteCommand.php +++ b/engine/Shopware/Commands/PluginDeleteCommand.php @@ -1,4 +1,5 @@ getPluginByName($pluginName); } catch (Exception $e) { - $output->writeln(sprintf('Plugin by name "%s" was not found.', $pluginName)); + $output->writeln(\sprintf('Plugin by name "%s" was not found.', $pluginName)); return 1; } @@ -141,7 +142,7 @@ protected function execute(InputInterface $input, OutputInterface $output) return 1; } - $output->writeln(sprintf('Plugin %s has been deleted successfully.', $pluginName)); + $output->writeln(\sprintf('Plugin %s has been deleted successfully.', $pluginName)); return 0; } diff --git a/engine/Shopware/Commands/PluginInstallCommand.php b/engine/Shopware/Commands/PluginInstallCommand.php index 1e24a0a8ce8..5600d17a00f 100644 --- a/engine/Shopware/Commands/PluginInstallCommand.php +++ b/engine/Shopware/Commands/PluginInstallCommand.php @@ -1,4 +1,5 @@ getPluginByName($pluginName); } catch (Exception $e) { - $output->writeln(sprintf('Plugin by name "%s" was not found.', $pluginName)); + $output->writeln(\sprintf('Plugin by name "%s" was not found.', $pluginName)); return 1; } @@ -122,17 +123,17 @@ protected function execute(InputInterface $input, OutputInterface $output) $installationContext = null; if ($plugin->getInstalled()) { - $output->writeln(sprintf('The plugin %s is already installed.', $pluginName)); + $output->writeln(\sprintf('The plugin %s is already installed.', $pluginName)); } else { $installationContext = $pluginManager->installPlugin($plugin); - $output->writeln(sprintf('Plugin %s has been installed successfully.', $pluginName)); + $output->writeln(\sprintf('Plugin %s has been installed successfully.', $pluginName)); } $activationContext = null; if ($input->getOption('activate')) { $activationContext = $pluginManager->activatePlugin($plugin); - $output->writeln(sprintf('Plugin %s has been activated successfully.', $pluginName)); + $output->writeln(\sprintf('Plugin %s has been activated successfully.', $pluginName)); } $this->clearCachesIfRequested($input, $output, $installationContext, $activationContext); diff --git a/engine/Shopware/Commands/PluginListCommand.php b/engine/Shopware/Commands/PluginListCommand.php index 1b41fb6541f..2e21afa3139 100644 --- a/engine/Shopware/Commands/PluginListCommand.php +++ b/engine/Shopware/Commands/PluginListCommand.php @@ -1,4 +1,5 @@ container->get(InstallerService::class); $pluginManager->refreshPluginList(); - $output->writeln(sprintf('Successfully refreshed')); + $output->writeln(\sprintf('Successfully refreshed')); return 0; } diff --git a/engine/Shopware/Commands/PluginReinstallCommand.php b/engine/Shopware/Commands/PluginReinstallCommand.php index 81cde24f901..8d62e7ae43b 100644 --- a/engine/Shopware/Commands/PluginReinstallCommand.php +++ b/engine/Shopware/Commands/PluginReinstallCommand.php @@ -1,4 +1,5 @@ getPluginByName($pluginName); } catch (Exception $e) { - $output->writeln(sprintf('Plugin by name "%s" was not found.', $pluginName)); + $output->writeln(\sprintf('Plugin by name "%s" was not found.', $pluginName)); return 1; } @@ -109,7 +110,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $uninstallationContext = $pluginManager->uninstallPlugin($plugin, $removeData); $installationContext = $pluginManager->installPlugin($plugin); $activationContext = $pluginManager->activatePlugin($plugin); - $output->writeln(sprintf('Plugin %s has been reinstalled successfully.', $pluginName)); + $output->writeln(\sprintf('Plugin %s has been reinstalled successfully.', $pluginName)); $this->clearCachesIfRequested($input, $output, $uninstallationContext, $installationContext, $activationContext); diff --git a/engine/Shopware/Commands/PluginUninstallCommand.php b/engine/Shopware/Commands/PluginUninstallCommand.php index 50181107fe3..b79e1e3e0db 100644 --- a/engine/Shopware/Commands/PluginUninstallCommand.php +++ b/engine/Shopware/Commands/PluginUninstallCommand.php @@ -1,4 +1,5 @@ getPluginByName($pluginName); } catch (Exception $e) { - $output->writeln(sprintf('Plugin by name "%s" was not found.', $pluginName)); + $output->writeln(\sprintf('Plugin by name "%s" was not found.', $pluginName)); return 1; } if (!$plugin->getInstalled()) { - $output->writeln(sprintf('The plugin %s is already uninstalled.', $pluginName)); + $output->writeln(\sprintf('The plugin %s is already uninstalled.', $pluginName)); return 1; } @@ -118,7 +119,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $removeData = !(bool) $input->getOption('secure'); $uninstallationContext = $pluginManager->uninstallPlugin($plugin, $removeData); - $output->writeln(sprintf('Plugin %s has been uninstalled successfully.', $pluginName)); + $output->writeln(\sprintf('Plugin %s has been uninstalled successfully.', $pluginName)); $this->clearCachesIfRequested($input, $output, $uninstallationContext); diff --git a/engine/Shopware/Commands/PluginUpdateCommand.php b/engine/Shopware/Commands/PluginUpdateCommand.php index f4fbdb76b5c..dcdd60bb3a5 100644 --- a/engine/Shopware/Commands/PluginUpdateCommand.php +++ b/engine/Shopware/Commands/PluginUpdateCommand.php @@ -1,4 +1,5 @@ writeln(sprintf('Specify either a plugin name or use the --batch option to update several plugins at once')); + $output->writeln(\sprintf('Specify either a plugin name or use the --batch option to update several plugins at once')); return 1; } @@ -152,7 +153,7 @@ private function batchUpdate(InstallerService $pluginManager, $batchUpdate, Outp $plugins = $builder->getQuery()->execute(); if (empty($plugins)) { - $output->writeln(sprintf('No plugin(s) found')); + $output->writeln(\sprintf('No plugin(s) found')); return 1; } @@ -163,12 +164,12 @@ private function batchUpdate(InstallerService $pluginManager, $batchUpdate, Outp continue; } $pluginManager->updatePlugin($plugin); - $output->writeln(sprintf('Plugin %s has been updated successfully.', $plugin->getName())); + $output->writeln(\sprintf('Plugin %s has been updated successfully.', $plugin->getName())); $allPluginsUpToDate = false; } if ($allPluginsUpToDate) { - $output->writeln(sprintf('No update needed. Plugin(s) are up to date')); + $output->writeln(\sprintf('No update needed. Plugin(s) are up to date')); } return 0; @@ -184,19 +185,19 @@ private function updatePlugin(InstallerService $pluginManager, $pluginName, Inpu try { $plugin = $pluginManager->getPluginByName($pluginName); } catch (Exception $e) { - $output->writeln(sprintf('Plugin by name "%s" was not found.', $pluginName)); + $output->writeln(\sprintf('Plugin by name "%s" was not found.', $pluginName)); return 1; } if (!$plugin->getUpdateVersion()) { - $output->writeln(sprintf('The plugin %s is up to date.', $pluginName)); + $output->writeln(\sprintf('The plugin %s is up to date.', $pluginName)); return 0; } $updateContext = $pluginManager->updatePlugin($plugin); - $output->writeln(sprintf('Plugin %s has been updated successfully.', $pluginName)); + $output->writeln(\sprintf('Plugin %s has been updated successfully.', $pluginName)); $this->clearCachesIfRequested($input, $output, $updateContext); diff --git a/engine/Shopware/Commands/RebuildCategoryTreeCommand.php b/engine/Shopware/Commands/RebuildCategoryTreeCommand.php index 760c70275cb..f65efec9b62 100644 --- a/engine/Shopware/Commands/RebuildCategoryTreeCommand.php +++ b/engine/Shopware/Commands/RebuildCategoryTreeCommand.php @@ -1,4 +1,5 @@ success(sprintf('Successfully removed %d expired sessions', $count)); + $io->success(\sprintf('Successfully removed %d expired sessions', $count)); return 0; } diff --git a/engine/Shopware/Commands/SettingsLabelsFindMissingCommand.php b/engine/Shopware/Commands/SettingsLabelsFindMissingCommand.php index 2cdb8d4a99c..6656dfdbca9 100644 --- a/engine/Shopware/Commands/SettingsLabelsFindMissingCommand.php +++ b/engine/Shopware/Commands/SettingsLabelsFindMissingCommand.php @@ -1,4 +1,5 @@ getVerbosity() === OutputInterface::VERBOSITY_VERBOSE) { $errorName = isset($errorNameMap[$errno]) ? $errorNameMap[$errno] : $errno; - $message = sprintf("Error: %s, \nFile: %s\nLine: %s, Message:\n%s\n", $errorName, $errfile, $errline, $errstr); + $message = \sprintf("Error: %s, \nFile: %s\nLine: %s, Message:\n%s\n", $errorName, $errfile, $errline, $errstr); $output->writeln('' . $message . ''); $output->writeln('Error stack:'); $stack = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 10); foreach ($stack as $trace) { - $output->writeln(sprintf(' %s%s%s() at %s:%s', $trace['class'] ?? '', $trace['type'] ?? '', $trace['function'], $trace['file'] ?? '', $trace['line'] ?? '')); + $output->writeln(\sprintf(' %s%s%s() at %s:%s', $trace['class'] ?? '', $trace['type'] ?? '', $trace['function'], $trace['file'] ?? '', $trace['line'] ?? '')); } $output->writeln(''); $output->writeln(''); diff --git a/engine/Shopware/Commands/SnippetsFindMissingCommand.php b/engine/Shopware/Commands/SnippetsFindMissingCommand.php index e52e54afe1e..f608ed97d5a 100644 --- a/engine/Shopware/Commands/SnippetsFindMissingCommand.php +++ b/engine/Shopware/Commands/SnippetsFindMissingCommand.php @@ -1,4 +1,5 @@ writeln(sprintf('Writing to file "%s".', $input->getArgument('file'))); + $output->writeln(\sprintf('Writing to file "%s".', $input->getArgument('file'))); /** @var QueryHandler $queryLoader */ $queryLoader = $this->container->get('shopware.snippet_query_handler'); diff --git a/engine/Shopware/Commands/SnippetsValidateCommand.php b/engine/Shopware/Commands/SnippetsValidateCommand.php index 08988ea6700..6c41866b264 100644 --- a/engine/Shopware/Commands/SnippetsValidateCommand.php +++ b/engine/Shopware/Commands/SnippetsValidateCommand.php @@ -1,4 +1,5 @@ writeln(sprintf('Connect to Store with username: %s...', $username)); + $output->writeln(\sprintf('Connect to Store with username: %s...', $username)); return $this->container->get(\Shopware\Bundle\PluginInstallerBundle\StoreClient::class)->getAccessToken( $username, diff --git a/engine/Shopware/Commands/StoreDownloadCommand.php b/engine/Shopware/Commands/StoreDownloadCommand.php index 75c238d9192..51158c0fcf8 100644 --- a/engine/Shopware/Commands/StoreDownloadCommand.php +++ b/engine/Shopware/Commands/StoreDownloadCommand.php @@ -1,4 +1,5 @@ getCode() !== null) { if ($plugin->hasFreeDownload() === false && $plugin->hasCapabilityDummy() === false) { - $io->note(sprintf('You must be authenticated to download: %s', $plugin->getLabel())); + $io->note(\sprintf('You must be authenticated to download: %s', $plugin->getLabel())); $token = $this->checkAuthentication(); } @@ -157,13 +158,13 @@ function (LicenceStruct $license) use ($technicalName) { } if (!$plugin) { - $io->error(sprintf('Plugin %s not found', $technicalName)); + $io->error(\sprintf('Plugin %s not found', $technicalName)); return 1; } $io->section($plugin->getLabel()); - $io->comment(sprintf('Checking system requirements for plugin %s', $plugin->getLabel())); + $io->comment(\sprintf('Checking system requirements for plugin %s', $plugin->getLabel())); $plugin = $this->createPluginStruct($plugin); @@ -212,12 +213,12 @@ function (LicenceStruct $license) use ($technicalName) { private function handleDummyUpdate(PluginStruct $plugin, $domain, $version) { if (!$plugin->isUpdateAvailable()) { - $this->io->text(sprintf('No update available for plugin %s', $plugin->getLabel())); + $this->io->text(\sprintf('No update available for plugin %s', $plugin->getLabel())); return; } - $this->io->comment(sprintf('Download plugin update package %s', $plugin->getLabel())); + $this->io->comment(\sprintf('Download plugin update package %s', $plugin->getLabel())); $request = new DownloadRequest($plugin->getTechnicalName(), $version, $domain, null); @@ -238,7 +239,7 @@ private function handleDummyUpdate(PluginStruct $plugin, $domain, $version) */ private function handleDummyInstall(PluginStruct $plugin, $domain, $version) { - $this->io->comment(sprintf('Download plugin install package %s', $plugin->getLabel())); + $this->io->comment(\sprintf('Download plugin install package %s', $plugin->getLabel())); $request = new DownloadRequest($plugin->getTechnicalName(), $version, $domain, null); @@ -254,7 +255,7 @@ private function handleDummyInstall(PluginStruct $plugin, $domain, $version) private function handleLicenceUpdate(PluginStruct $plugin, $domain, $version, ?AccessTokenStruct $token = null) { if (!$plugin->isUpdateAvailable()) { - $this->io->text(sprintf('No update available for plugin %s', $plugin->getLabel())); + $this->io->text(\sprintf('No update available for plugin %s', $plugin->getLabel())); return; } diff --git a/engine/Shopware/Commands/StoreListCommand.php b/engine/Shopware/Commands/StoreListCommand.php index 1fec67e79f5..8e75a3ed81d 100644 --- a/engine/Shopware/Commands/StoreListCommand.php +++ b/engine/Shopware/Commands/StoreListCommand.php @@ -1,4 +1,5 @@ writeln(sprintf('Generating new theme cache for shop "%s" ...', $shop->getName())); + $output->writeln(\sprintf('Generating new theme cache for shop "%s" ...', $shop->getName())); $compiler->compile($shop); continue; } $timestamp = $this->container->get('theme_timestamp_persistor')->getCurrentTimestamp($shop->getId()); - $output->writeln(sprintf('Generating theme cache for shop "%s" from current timestamp %s', $shop->getName(), $timestamp)); + $output->writeln(\sprintf('Generating theme cache for shop "%s" from current timestamp %s', $shop->getName(), $timestamp)); $compiler->recompile($shop); } diff --git a/engine/Shopware/Commands/ThemeCreateCommand.php b/engine/Shopware/Commands/ThemeCreateCommand.php index 28330f39eb1..5b920848393 100644 --- a/engine/Shopware/Commands/ThemeCreateCommand.php +++ b/engine/Shopware/Commands/ThemeCreateCommand.php @@ -1,4 +1,5 @@ getRepository()->findOneBy(['template' => $arguments['parent']]); if (!$parent instanceof Template) { $output->writeln( - sprintf( + \sprintf( 'Shop template by template name "%s" not found', $arguments['parent'] ) @@ -160,7 +161,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $themeGenerator = $this->container->get(Generator::class); $themeGenerator->generateTheme($arguments, $parent); - $output->writeln(sprintf('Theme "%s" has been created successfully.', $arguments['name'])); + $output->writeln(\sprintf('Theme "%s" has been created successfully.', $arguments['name'])); return 0; } @@ -202,7 +203,7 @@ private function askForOptionalData(InputInterface $input, OutputInterface $outp if (empty($optionValue)) { $questionHelper = $this->getHelper('question'); - $question = new Question(sprintf('Please enter the %s: ', $optionKey)); + $question = new Question(\sprintf('Please enter the %s: ', $optionKey)); $optionValue = $questionHelper->ask($input, $output, $question); } diff --git a/engine/Shopware/Commands/ThemeDumpConfigurationCommand.php b/engine/Shopware/Commands/ThemeDumpConfigurationCommand.php index b13bd777340..6aa78190c11 100644 --- a/engine/Shopware/Commands/ThemeDumpConfigurationCommand.php +++ b/engine/Shopware/Commands/ThemeDumpConfigurationCommand.php @@ -1,4 +1,5 @@ listing($thumbnailFiles); } - if (!$io->confirm(sprintf('Found %d orphaned thumbnails. Are you sure you want to delete the files? This step is irreversible.', \count($thumbnailFiles)))) { + if (!$io->confirm(\sprintf('Found %d orphaned thumbnails. Are you sure you want to delete the files? This step is irreversible.', \count($thumbnailFiles)))) { return; } $deletedThumbnails = $this->deleteThumbnails($io, $filesystem, $thumbnailFiles); - $io->success(sprintf('Removed %d/%d orphaned thumbnails.', $deletedThumbnails, \count($thumbnailFiles))); + $io->success(\sprintf('Removed %d/%d orphaned thumbnails.', $deletedThumbnails, \count($thumbnailFiles))); } private function processFilesIn(string $directory, FilesystemInterface $filesystem, ProgressBar $progressBar): void diff --git a/engine/Shopware/Commands/ThumbnailGenerateCommand.php b/engine/Shopware/Commands/ThumbnailGenerateCommand.php index de742caa4dc..54df2235dab 100644 --- a/engine/Shopware/Commands/ThumbnailGenerateCommand.php +++ b/engine/Shopware/Commands/ThumbnailGenerateCommand.php @@ -1,4 +1,5 @@ imageExists($media)) { - throw new Exception(sprintf('Base image file "%s" does not exist', $media->getPath())); + throw new Exception(\sprintf('Base image file "%s" does not exist', $media->getPath())); } $thumbnails = $media->getThumbnailFilePaths(); diff --git a/engine/Shopware/Commands/WarmUpHttpCacheCommand.php b/engine/Shopware/Commands/WarmUpHttpCacheCommand.php index d4305f5acff..237b3400b7c 100644 --- a/engine/Shopware/Commands/WarmUpHttpCacheCommand.php +++ b/engine/Shopware/Commands/WarmUpHttpCacheCommand.php @@ -1,4 +1,5 @@ getOption('concurrent-requests'), '='); $limit = $concurrentRequests > 10 ? $concurrentRequests : 10; - $io->writeln(sprintf('Calling URLs with %d concurrent requests', $concurrentRequests)); + $io->writeln(\sprintf('Calling URLs with %d concurrent requests', $concurrentRequests)); // Print warming information if (!\in_array(false, $options, true)) { @@ -184,7 +185,7 @@ protected function execute(InputInterface $input, OutputInterface $output) // Progressbar $progressBar = $io->createProgressBar($totalResultCount); - $io->writeln(sprintf("\nShop '%s' (ID: %s)", $shop->getName(), $shop->getId())); + $io->writeln(\sprintf("\nShop '%s' (ID: %s)", $shop->getName(), $shop->getId())); $progressBar->setBarWidth(100); $progressBar->setFormat('very_verbose'); $progressBar->start(); diff --git a/engine/Shopware/Components/Acl.php b/engine/Shopware/Components/Acl.php index e7ee32e671a..604413956f2 100644 --- a/engine/Shopware/Components/Acl.php +++ b/engine/Shopware/Components/Acl.php @@ -1,4 +1,5 @@ hasResourceInDatabase($resourceName)) { - throw new Enlight_Exception(sprintf('Resource "%s" already exists', $resourceName)); + throw new Enlight_Exception(\sprintf('Resource "%s" already exists', $resourceName)); } $resource = new UserResource(); diff --git a/engine/Shopware/Components/Api/BatchInterface.php b/engine/Shopware/Components/Api/BatchInterface.php index 00a93f4a741..baa78bfad12 100644 --- a/engine/Shopware/Components/Api/BatchInterface.php +++ b/engine/Shopware/Components/Api/BatchInterface.php @@ -1,4 +1,5 @@ alternativeIds = $alternativeIds; - $message = sprintf("Identifier '%s' with value '%s' for entity '%s' is not unique.", $identifier, $identifierValue, $model); + $message = \sprintf("Identifier '%s' with value '%s' for entity '%s' is not unique.", $identifier, $identifierValue, $model); parent::__construct($message, Response::HTTP_CONFLICT); } diff --git a/engine/Shopware/Components/Api/Exception/ParameterMissingException.php b/engine/Shopware/Components/Api/Exception/ParameterMissingException.php index 2ff77bd43f0..a8ff4fa89ab 100644 --- a/engine/Shopware/Components/Api/Exception/ParameterMissingException.php +++ b/engine/Shopware/Components/Api/Exception/ParameterMissingException.php @@ -42,7 +42,7 @@ class ParameterMissingException extends Enlight_Exception implements ApiExceptio public function __construct($param) { $this->setMissingParam($param); - parent::__construct(sprintf('A required parameter is missing: %s', $param), Response::HTTP_BAD_REQUEST); + parent::__construct(\sprintf('A required parameter is missing: %s', $param), Response::HTTP_BAD_REQUEST); } /** diff --git a/engine/Shopware/Components/Api/Manager.php b/engine/Shopware/Components/Api/Manager.php index 54941e82a4d..c6df31e8a4e 100644 --- a/engine/Shopware/Components/Api/Manager.php +++ b/engine/Shopware/Components/Api/Manager.php @@ -1,4 +1,5 @@ get($serviceId); } else { - trigger_error(sprintf('The requested service with id %s is deprecated. Please use CamelCased service id instead.', $name), E_USER_DEPRECATED); + trigger_error(\sprintf('The requested service with id %s is deprecated. Please use CamelCased service id instead.', $name), E_USER_DEPRECATED); $resource = $container->get('shopware.api.' . strtolower($name)); } } catch (ServiceNotFoundException $e) { diff --git a/engine/Shopware/Components/Api/Resource/Address.php b/engine/Shopware/Components/Api/Resource/Address.php index ce9d001ae45..8c6d2a264ee 100644 --- a/engine/Shopware/Components/Api/Resource/Address.php +++ b/engine/Shopware/Components/Api/Resource/Address.php @@ -1,4 +1,5 @@ getOneOrNullResult($this->getResultMode()); if (!$address) { - throw new NotFoundException(sprintf('Address by id %d not found', $id)); + throw new NotFoundException(\sprintf('Address by id %d not found', $id)); } return $address; @@ -127,7 +128,7 @@ public function create(array $params) $customer = $this->getContainer()->get(ModelManager::class)->find(CustomerModel::class, $customerId); if (!$customer) { - throw new NotFoundException(sprintf('Customer by id %s not found', $customerId)); + throw new NotFoundException(\sprintf('Customer by id %s not found', $customerId)); } $this->setupContext($customer->getShop()->getId()); @@ -174,7 +175,7 @@ public function update($id, array $params) $address = $this->getRepository()->findOneBy(['id' => $id]); if (!$address) { - throw new NotFoundException(sprintf('Address by id %d not found', $id)); + throw new NotFoundException(\sprintf('Address by id %d not found', $id)); } $this->setupContext($address->getCustomer()->getShop()->getId()); @@ -214,7 +215,7 @@ public function delete($id) $address = $this->getRepository()->findOneBy(['id' => $id]); if (!$address) { - throw new NotFoundException(sprintf('Address by id %d not found', $id)); + throw new NotFoundException(\sprintf('Address by id %d not found', $id)); } $this->addressService->delete($address); diff --git a/engine/Shopware/Components/Api/Resource/Article.php b/engine/Shopware/Components/Api/Resource/Article.php index 25207d51275..911f2991082 100644 --- a/engine/Shopware/Components/Api/Resource/Article.php +++ b/engine/Shopware/Components/Api/Resource/Article.php @@ -1,4 +1,5 @@ getDetailRepository()->findOneBy(['number' => $number]); if (!$productVariant instanceof Detail) { - throw new NotFoundException(sprintf('Product by number "%s" not found', $number)); + throw new NotFoundException(\sprintf('Product by number "%s" not found', $number)); } return $productVariant->getArticle()->getId(); @@ -179,7 +180,7 @@ public function getOne($id, array $options = []) $product = $builder->getQuery()->getOneOrNullResult($this->getResultMode()); if ($product === null) { - throw new NotFoundException(sprintf('Product by id "%d" not found', $id)); + throw new NotFoundException(\sprintf('Product by id "%d" not found', $id)); } if ($this->getResultMode() === self::HYDRATE_ARRAY) { @@ -399,7 +400,7 @@ public function update($id, array $params) $product = $builder->getQuery()->getOneOrNullResult(self::HYDRATE_OBJECT); if (!$product instanceof ProductModel) { - throw new NotFoundException(sprintf('Product by id "%d" not found', $id)); + throw new NotFoundException(\sprintf('Product by id "%d" not found', $id)); } $translations = []; @@ -456,7 +457,7 @@ public function delete($id) $product = $this->getRepository()->find($id); if (!$product instanceof ProductModel) { - throw new NotFoundException(sprintf('Product by "id" %d not found', $id)); + throw new NotFoundException(\sprintf('Product by "id" %d not found', $id)); } // Delete associated data @@ -647,7 +648,7 @@ public function writeTranslations($articleId, $translations) foreach ($translations as $translation) { $shop = $this->getManager()->find(Shop::class, $translation['shopId']); if (!$shop instanceof Shop) { - throw new CustomValidationException(sprintf('Shop by id "%s" not found', $translation['shopId'])); + throw new CustomValidationException(\sprintf('Shop by id "%s" not found', $translation['shopId'])); } // Backward compatibility for attribute translations @@ -1161,7 +1162,7 @@ protected function prepareConfiguratorSet($data, ProductModel $article) if (isset($groupData['id'])) { $group = $this->getManager()->getRepository(ConfiguratorGroup::class)->find($groupData['id']); if (!$group) { - throw new CustomValidationException(sprintf('ConfiguratorGroup by id "%s" not found', $groupData['id'])); + throw new CustomValidationException(\sprintf('ConfiguratorGroup by id "%s" not found', $groupData['id'])); } } elseif (isset($groupData['name'])) { $group = $this->getManager()->getRepository(ConfiguratorGroup::class)->findOneBy(['name' => $groupData['name']]); @@ -1182,7 +1183,7 @@ protected function prepareConfiguratorSet($data, ProductModel $article) if (isset($optionData['id'])) { $option = $this->getManager()->find(ConfiguratorOption::class, $optionData['id']); if (!$option) { - throw new CustomValidationException(sprintf('ConfiguratorOption by id "%s" not found', $optionData['id'])); + throw new CustomValidationException(\sprintf('ConfiguratorOption by id "%s" not found', $optionData['id'])); } } else { $option = $this->getManager()->getRepository(ConfiguratorOption::class)->findOneBy([ @@ -1243,12 +1244,12 @@ protected function prepareArticleAssociatedData($data, ProductModel $article) $data['tax'] = $this->getManager()->find(Tax::class, $data['taxId']); if (empty($data['tax'])) { - throw new CustomValidationException(sprintf('Tax by id "%s" not found', $data['taxId'])); + throw new CustomValidationException(\sprintf('Tax by id "%s" not found', $data['taxId'])); } } elseif (isset($data['tax']) && ($data['tax'] >= 0)) { $tax = $this->getManager()->getRepository(Tax::class)->findOneBy(['tax' => $data['tax']]); if (!$tax) { - throw new CustomValidationException(sprintf('Tax by taxrate "%s" not found', $data['tax'])); + throw new CustomValidationException(\sprintf('Tax by taxrate "%s" not found', $data['tax'])); } $data['tax'] = $tax; } else { @@ -1259,7 +1260,7 @@ protected function prepareArticleAssociatedData($data, ProductModel $article) if (!empty($data['supplierId'])) { $data['supplier'] = $this->getManager()->find(Supplier::class, $data['supplierId']); if (empty($data['supplier'])) { - throw new CustomValidationException(sprintf('Supplier by id "%s" not found', $data['supplierId'])); + throw new CustomValidationException(\sprintf('Supplier by id "%s" not found', $data['supplierId'])); } } elseif (!empty($data['supplier'])) { $supplier = $this->getManager()->getRepository(Supplier::class)->findOneBy(['name' => $data['supplier']]); @@ -1279,7 +1280,7 @@ protected function prepareArticleAssociatedData($data, ProductModel $article) } else { $data['priceGroup'] = $this->getManager()->find(Group::class, $data['priceGroupId']); if (empty($data['priceGroup'])) { - throw new CustomValidationException(sprintf('Pricegroup by id "%s" not found', $data['priceGroupId'])); + throw new CustomValidationException(\sprintf('Pricegroup by id "%s" not found', $data['priceGroupId'])); } } } else { @@ -1294,7 +1295,7 @@ protected function prepareArticleAssociatedData($data, ProductModel $article) $data['propertyGroup'] = $this->getManager()->find(PropertyGroup::class, $data['filterGroupId']); if (empty($data['propertyGroup'])) { - throw new CustomValidationException(sprintf('PropertyGroup by id "%s" not found', $data['filterGroupId'])); + throw new CustomValidationException(\sprintf('PropertyGroup by id "%s" not found', $data['filterGroupId'])); } } } else { @@ -1358,7 +1359,7 @@ protected function prepareCategoryAssociatedData($data, ProductModel $article) $category = $categoryResource->findCategoryByPath($categoryData['path'], true); if (!$category) { - throw new CustomValidationException(sprintf('Could not find or create category by path: %s.', $categoryData['path'])); + throw new CustomValidationException(\sprintf('Could not find or create category by path: %s.', $categoryData['path'])); } if (isset($categoryIds[$category->getId()])) { @@ -1413,21 +1414,21 @@ protected function prepareSeoCategoryAssociatedData($data, ProductModel $article ); if (!$shop instanceof Shop) { - throw new CustomValidationException(sprintf('Could not find shop by id: %s.', $categoryData['shopId'])); + throw new CustomValidationException(\sprintf('Could not find shop by id: %s.', $categoryData['shopId'])); } $seoCategory->setShop($shop); } if (!$seoCategory->getShop()) { - throw new CustomValidationException(sprintf('A product seo category requires a configured shop')); + throw new CustomValidationException(\sprintf('A product seo category requires a configured shop')); } if (isset($categoryData['categoryId'])) { $category = $this->manager->find(Category::class, $categoryData['categoryId']); if (!$category instanceof Category) { - throw new CustomValidationException(sprintf('Could not find category by id: %s.', $categoryData['categoryId'])); + throw new CustomValidationException(\sprintf('Could not find category by id: %s.', $categoryData['categoryId'])); } $seoCategory->setCategory($category); @@ -1437,7 +1438,7 @@ protected function prepareSeoCategoryAssociatedData($data, ProductModel $article true ); if (!$category instanceof Category) { - throw new CustomValidationException(sprintf('Could not find category by path: %s.', $categoryData['categoryPath'])); + throw new CustomValidationException(\sprintf('Could not find category by path: %s.', $categoryData['categoryPath'])); } $seoCategory->setCategory($category); } @@ -1449,7 +1450,7 @@ protected function prepareSeoCategoryAssociatedData($data, ProductModel $article ); if (!$existing instanceof Category) { - throw new CustomValidationException(sprintf("Seo category isn't assigned as normal product category. Only assigned categories can be used as seo category")); + throw new CustomValidationException(\sprintf("Seo category isn't assigned as normal product category. Only assigned categories can be used as seo category")); } $seoCategory->setArticle($article); @@ -1535,7 +1536,7 @@ protected function prepareRelatedAssociatedData($data, ProductModel $article) // no valid entity found, throw exception! if ($relatedProduct === null) { $property = $relatedData['number'] ?: $relatedData['id']; - throw new CustomValidationException(sprintf('Related product by number/id "%s" not found', $property)); + throw new CustomValidationException(\sprintf('Related product by number/id "%s" not found', $property)); } if (!empty($relatedData['cross'])) { @@ -1595,7 +1596,7 @@ protected function prepareSimilarAssociatedData($data, ProductModel $article) // No valid entity found, throw exception! if ($similarProduct === null) { $property = $similarData['number'] ?: $similarData['id']; - throw new CustomValidationException(sprintf('Similar product by number/id "%s" not found', $property)); + throw new CustomValidationException(\sprintf('Similar product by number/id "%s" not found', $property)); } if (!empty($similarData['cross'])) { @@ -1647,7 +1648,7 @@ protected function preparePropertyValuesData($data, ProductModel $article) if (isset($valueData['id'])) { $value = $this->getManager()->getRepository(Value::class)->find($valueData['id']); if (!$value instanceof Value) { - throw new CustomValidationException(sprintf('Property value by id "%s" not found', $valueData['id'])); + throw new CustomValidationException(\sprintf('Property value by id "%s" not found', $valueData['id'])); } // Get / create value by name } elseif (isset($valueData['value'])) { @@ -1657,7 +1658,7 @@ protected function preparePropertyValuesData($data, ProductModel $article) if (isset($valueData['option']['id'])) { $option = $this->getManager()->getRepository(Option::class)->find($valueData['option']['id']); if (!$option instanceof Option) { - throw new CustomValidationException(sprintf('Property option by id "%s" not found', $valueData['option']['id'])); + throw new CustomValidationException(\sprintf('Property option by id "%s" not found', $valueData['option']['id'])); } $filters = [ ['property' => 'options.id', 'expression' => '=', 'value' => $option->getId()], @@ -1764,7 +1765,7 @@ protected function getArticleImageMappingsQuery($articleId) */ protected function isVariantImageExist(Detail $variant, Image $image) { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); foreach ($variant->getImages() as $variantImage) { if ((int) $variantImage->getParent()->getId() === (int) $image->getId()) { @@ -1836,7 +1837,7 @@ protected function createImageMappings(Image $image, ProductModel $article, arra if (!$available) { $property = $option['id'] ?: $option['name']; - throw new CustomValidationException(sprintf('Passed option "%s" does not exist in the configurator set of the product', $property)); + throw new CustomValidationException(\sprintf('Passed option "%s" does not exist in the configurator set of the product', $property)); } $options->add($available); @@ -2260,7 +2261,7 @@ private function prepareDownloadsAssociatedData(array $data, ProductModel $produ try { // persist the model into the model manager $this->getManager()->persist($media); } catch (ORMException $e) { - throw new CustomValidationException(sprintf('Some error occurred while loading your image from link "%s"', $downloadData['link'])); + throw new CustomValidationException(\sprintf('Some error occurred while loading your image from link "%s"', $downloadData['link'])); } $download->setFile($media->getPath()); @@ -2336,7 +2337,7 @@ private function prepareImageAssociatedData(array $data, ProductModel $product): ); if (!($media instanceof MediaModel)) { - throw new CustomValidationException(sprintf('Media by mediaId "%s" not found', $imageData['mediaId'])); + throw new CustomValidationException(\sprintf('Media by mediaId "%s" not found', $imageData['mediaId'])); } $image = $this->updateArticleImageWithMedia( diff --git a/engine/Shopware/Components/Api/Resource/Cache.php b/engine/Shopware/Components/Api/Resource/Cache.php index 374666ea53e..074359dedb8 100644 --- a/engine/Shopware/Components/Api/Resource/Cache.php +++ b/engine/Shopware/Components/Api/Resource/Cache.php @@ -1,4 +1,5 @@ request; } @@ -248,7 +249,7 @@ protected function clearCache($cache) $this->cacheManager->clearOpCache(); break; default: - throw new NotFoundException(sprintf('Cache "%s" is not a valid cache id.', $cache)); + throw new NotFoundException(\sprintf('Cache "%s" is not a valid cache id.', $cache)); } if (!empty($capabilities['tags'])) { @@ -289,7 +290,7 @@ private function getCacheInfo($cache): array $cacheInfo = $this->cacheManager->getOpCacheCacheInfo(); break; default: - throw new NotFoundException(sprintf('Cache "%s" is not a valid cache id.', $cache)); + throw new NotFoundException(\sprintf('Cache "%s" is not a valid cache id.', $cache)); } $cacheInfo['id'] = $cache; diff --git a/engine/Shopware/Components/Api/Resource/Category.php b/engine/Shopware/Components/Api/Resource/Category.php index 55267ab535a..fa1f298c0ee 100644 --- a/engine/Shopware/Components/Api/Resource/Category.php +++ b/engine/Shopware/Components/Api/Resource/Category.php @@ -1,4 +1,5 @@ getOneOrNullResult($this->getResultMode()); if (!$categoryResult) { - throw new NotFoundException(sprintf('Category by id %d not found', $id)); + throw new NotFoundException(\sprintf('Category by id %d not found', $id)); } if ($this->getResultMode() === Resource::HYDRATE_ARRAY) { @@ -203,7 +204,7 @@ public function update($id, array $params) $category = $this->getRepository()->find($id); if (!$category) { - throw new NotFoundException(sprintf('Category by id %d not found', $id)); + throw new NotFoundException(\sprintf('Category by id %d not found', $id)); } $params = $this->prepareCategoryData($params); @@ -244,7 +245,7 @@ public function delete($id) $category = $this->getRepository()->find($id); if (!$category) { - throw new NotFoundException(sprintf('Category by id %d not found', $id)); + throw new NotFoundException(\sprintf('Category by id %d not found', $id)); } $this->getManager()->remove($category); @@ -302,7 +303,7 @@ public function findCategoryByPath($path, $create = false) if ($parent === null) { $parent = $this->getRepository()->find($parentId); if (!$parent) { - throw new RuntimeException(sprintf('Could not find parent %s', $parentId)); + throw new RuntimeException(\sprintf('Could not find parent %s', $parentId)); } } @@ -334,7 +335,7 @@ public function writeTranslations($categoryId, $translations) foreach ($translations as $translation) { $shop = $this->getManager()->find(ShopModel::class, $translation['shopId']); if (!$shop) { - throw new CustomValidationException(sprintf('Shop by id %s not found', $translation['shopId'])); + throw new CustomValidationException(\sprintf('Shop by id %s not found', $translation['shopId'])); } $attributeTranslation = array_intersect_key($translation, array_flip($attributes)); @@ -365,7 +366,7 @@ private function prepareCategoryData(array $params): array if (!empty($params['parent'])) { $params['parent'] = Shopware()->Models()->getRepository(CategoryModel::class)->find($params['parent']); if (!$params['parent']) { - throw new CustomValidationException(sprintf('Parent by id %s not found', $params['parent'])); + throw new CustomValidationException(\sprintf('Parent by id %s not found', $params['parent'])); } } else { unset($params['parent']); @@ -405,7 +406,7 @@ private function prepareMediaData(array $data, CategoryModel $categoryModel): ar $media = $this->getManager()->find(MediaModel::class, (int) $data['media']['mediaId']); if (!($media instanceof MediaModel)) { - throw new CustomValidationException(sprintf('Media by mediaId %s not found', $data['media']['mediaId'])); + throw new CustomValidationException(\sprintf('Media by mediaId %s not found', $data['media']['mediaId'])); } } @@ -431,18 +432,18 @@ private function prepareManualSorting(array $data, CategoryModel $category): arr foreach ($data['manualSorting'] as $sorting) { if (!isset($sorting['product_id'])) { - throw new CustomValidationException(sprintf('Field product_id is missing in manualSorting array')); + throw new CustomValidationException(\sprintf('Field product_id is missing in manualSorting array')); } if (!isset($sorting['position'])) { - throw new CustomValidationException(sprintf('Field position is missing in manualSorting array')); + throw new CustomValidationException(\sprintf('Field position is missing in manualSorting array')); } if (!$connection->fetchOne('SELECT 1 FROM s_articles_categories_ro WHERE categoryID = ? AND articleID = ?', [ $category->getId(), $sorting['product_id'], ])) { - throw new CustomValidationException(sprintf('Product with id %d is not assigned to the category', $sorting['product_id'])); + throw new CustomValidationException(\sprintf('Product with id %d is not assigned to the category', $sorting['product_id'])); } $sortingObj = new ManualSorting(); diff --git a/engine/Shopware/Components/Api/Resource/Country.php b/engine/Shopware/Components/Api/Resource/Country.php index b93d89ea215..f8c93e95cdb 100644 --- a/engine/Shopware/Components/Api/Resource/Country.php +++ b/engine/Shopware/Components/Api/Resource/Country.php @@ -1,4 +1,5 @@ getQuery()->getOneOrNullResult($this->getResultMode()); if (!$country) { - throw new NotFoundException(sprintf('Country by id %d not found', $id)); + throw new NotFoundException(\sprintf('Country by id %d not found', $id)); } return $country; @@ -166,7 +167,7 @@ public function update($id, array $params) /** @var CountryModel|null $country */ $country = $this->getRepository()->find($id); if (!$country) { - throw new NotFoundException(sprintf('Country by id %d not found', $id)); + throw new NotFoundException(\sprintf('Country by id %d not found', $id)); } $params = $this->prepareCountryData($params, $country); @@ -203,7 +204,7 @@ public function delete($id) /** @var CountryModel|null $country */ $country = $this->getRepository()->find($id); if (!$country) { - throw new NotFoundException(sprintf('Country by id %d not found', $id)); + throw new NotFoundException(\sprintf('Country by id %d not found', $id)); } $this->getManager()->remove($country); @@ -234,7 +235,7 @@ private function prepareCountryData(array $params, ?CountryModel $country = null } } else { if (isset($params[$param]) && empty($params[$param])) { - throw new CustomValidationException(sprintf('Param "%s" may not be empty', $param)); + throw new CustomValidationException(\sprintf('Param "%s" may not be empty', $param)); } } } @@ -246,7 +247,7 @@ private function prepareCountryData(array $params, ?CountryModel $country = null if ($area) { $params['area'] = $area; } else { - throw new NotFoundException(sprintf('Area by id %d not found', $areaId)); + throw new NotFoundException(\sprintf('Area by id %d not found', $areaId)); } } else { $params['area'] = null; @@ -277,7 +278,7 @@ private function prepareCountryStatesData(array $params) /** @var State|null $stateModel */ $stateModel = $this->getManager()->find(State::class, $state['id']); if (!$stateModel) { - throw new NotFoundException(sprintf('State by id %d not found', (int) $state['id'])); + throw new NotFoundException(\sprintf('State by id %d not found', (int) $state['id'])); } // Update state diff --git a/engine/Shopware/Components/Api/Resource/Customer.php b/engine/Shopware/Components/Api/Resource/Customer.php index e6ca51b9d9c..df2766e7bd5 100644 --- a/engine/Shopware/Components/Api/Resource/Customer.php +++ b/engine/Shopware/Components/Api/Resource/Customer.php @@ -97,7 +97,7 @@ public function getIdFromNumber($number) } if (!$id) { - throw new NotFoundException(sprintf('Customer by number %s not found', $number)); + throw new NotFoundException(\sprintf('Customer by number %s not found', $number)); } return $id['id']; @@ -165,7 +165,7 @@ public function getOne($id) $customer = $builder->getQuery()->getOneOrNullResult($this->getResultMode()); if (!$customer) { - throw new NotFoundException(sprintf('Customer by id %d not found', $id)); + throw new NotFoundException(\sprintf('Customer by id %d not found', $id)); } return $customer; @@ -288,7 +288,7 @@ public function update($id, array $params) $customer = $this->getRepository()->find($id); if (!$customer instanceof CustomerModel) { - throw new NotFoundException(sprintf('Customer by id %d not found', $id)); + throw new NotFoundException(\sprintf('Customer by id %d not found', $id)); } $this->setupContext($customer->getShop()->getId()); @@ -357,7 +357,7 @@ public function delete($id) $customer = $this->getRepository()->find($id); if (!$customer) { - throw new NotFoundException(sprintf('Customer by id %d not found', $id)); + throw new NotFoundException(\sprintf('Customer by id %d not found', $id)); } $this->getManager()->remove($customer); @@ -429,7 +429,7 @@ protected function prepareCustomerPaymentData($data, CustomerModel $customer) if (isset($paymentDataData['paymentMeanId'])) { $paymentMean = $this->getManager()->getRepository(Payment::class)->find($paymentDataData['paymentMeanId']); if ($paymentMean === null) { - throw new CustomValidationException(sprintf('%s by %s %s not found', Payment::class, 'id', $paymentDataData['paymentMeanId'])); + throw new CustomValidationException(\sprintf('%s by %s %s not found', Payment::class, 'id', $paymentDataData['paymentMeanId'])); } $paymentData->setPaymentMean($paymentMean); unset($paymentDataData['paymentMeanId']); @@ -467,14 +467,14 @@ private function prepareCustomerData(array $params, CustomerModel $customer): ar if (\array_key_exists('groupKey', $params)) { $params['group'] = Shopware()->Models()->getRepository(Group::class)->findOneBy(['key' => $params['groupKey']]); if (!$params['group']) { - throw new CustomValidationException(sprintf('CustomerGroup by key %s not found', $params['groupKey'])); + throw new CustomValidationException(\sprintf('CustomerGroup by key %s not found', $params['groupKey'])); } } if (\array_key_exists('shopId', $params)) { $params['shop'] = Shopware()->Models()->find(ShopModel::class, $params['shopId']); if (!$params['shop']) { - throw new CustomValidationException(sprintf('Shop by id %s not found', $params['shopId'])); + throw new CustomValidationException(\sprintf('Shop by id %s not found', $params['shopId'])); } } @@ -507,7 +507,7 @@ private function setupContext(?int $shopId = null): void if ($shopId) { $shop = $shopRepository->getActiveById($shopId); if (!$shop) { - throw new CustomValidationException(sprintf('Shop by id %s not found', $shopId)); + throw new CustomValidationException(\sprintf('Shop by id %s not found', $shopId)); } } else { $shop = $shopRepository->getActiveDefault(); @@ -583,11 +583,11 @@ private function applyAddressData(array $params, CustomerModel $customer): array unset($params['billing'], $params['shipping'], $params['defaultBillingAddress'], $params['defaultShippingAddress']); if (!$customer->getDefaultBillingAddress() instanceof AddressModel) { - throw new CustomValidationException(sprintf('Customer with ID "%s" has no default billing address', $customer->getId())); + throw new CustomValidationException(\sprintf('Customer with ID "%s" has no default billing address', $customer->getId())); } $customer->getDefaultBillingAddress()->fromArray($billingData); if (!$customer->getDefaultShippingAddress() instanceof AddressModel) { - throw new CustomValidationException(sprintf('Customer with ID "%s" has no default shipping address', $customer->getId())); + throw new CustomValidationException(\sprintf('Customer with ID "%s" has no default shipping address', $customer->getId())); } $customer->getDefaultShippingAddress()->fromArray($shippingData); diff --git a/engine/Shopware/Components/Api/Resource/CustomerGroup.php b/engine/Shopware/Components/Api/Resource/CustomerGroup.php index 724bf1af78e..016a3f0474a 100644 --- a/engine/Shopware/Components/Api/Resource/CustomerGroup.php +++ b/engine/Shopware/Components/Api/Resource/CustomerGroup.php @@ -1,4 +1,5 @@ getOneOrNullResult($this->getResultMode()); if (!$result) { - throw new NotFoundException(sprintf('CustomerGroup by id %d not found', $id)); + throw new NotFoundException(\sprintf('CustomerGroup by id %d not found', $id)); } return $result; @@ -168,7 +169,7 @@ public function update($id, array $params) $result = $this->getRepository()->find($id); if (!$result) { - throw new NotFoundException(sprintf('CustomerGroup by id %d not found', $id)); + throw new NotFoundException(\sprintf('CustomerGroup by id %d not found', $id)); } $params = $this->prepareCustomerGroupData($params, $result); @@ -210,7 +211,7 @@ public function delete($id) $result = $this->getRepository()->find($id); if (!$result) { - throw new NotFoundException(sprintf('CustomerGroup by id %d not found', $id)); + throw new NotFoundException(\sprintf('CustomerGroup by id %d not found', $id)); } $this->getManager()->remove($result); @@ -269,20 +270,20 @@ private function prepareCustomerGroupData(array $params, $customerGroup = null) } if (empty($params['name'])) { - throw new CustomValidationException(sprintf("Parameter '%s' is missing", 'name')); + throw new CustomValidationException(\sprintf("Parameter '%s' is missing", 'name')); } if (empty($params['key'])) { - throw new CustomValidationException(sprintf("Parameter '%s' is missing", 'key')); + throw new CustomValidationException(\sprintf("Parameter '%s' is missing", 'key')); } } if (isset($params['name']) && empty($params['name'])) { - throw new CustomValidationException(sprintf("Parameter '%s' is missing", 'name')); + throw new CustomValidationException(\sprintf("Parameter '%s' is missing", 'name')); } if (isset($params['key']) && empty($params['key'])) { - throw new CustomValidationException(sprintf("Parameter '%s' is missing", 'key')); + throw new CustomValidationException(\sprintf("Parameter '%s' is missing", 'key')); } $discountRepository = $this->getManager()->getRepository(Discount::class); diff --git a/engine/Shopware/Components/Api/Resource/CustomerStream.php b/engine/Shopware/Components/Api/Resource/CustomerStream.php index 57a2f3fa675..e22c3cd39a9 100644 --- a/engine/Shopware/Components/Api/Resource/CustomerStream.php +++ b/engine/Shopware/Components/Api/Resource/CustomerStream.php @@ -239,7 +239,7 @@ public function update($id, array $data, $index = false) $stream = $this->getManager()->find(CustomerStreamEntity::class, $id); if (!$stream instanceof CustomerStreamEntity) { - throw new NotFoundException(sprintf('Customer Stream by id %d not found', $id)); + throw new NotFoundException(\sprintf('Customer Stream by id %d not found', $id)); } $data = $this->prepareData($data); @@ -277,7 +277,7 @@ public function delete($id) $stream = $this->manager->find(CustomerStreamEntity::class, $id); if (!$stream instanceof CustomerStreamEntity) { - throw new NotFoundException(sprintf('Customer Stream by id %d not found', $id)); + throw new NotFoundException(\sprintf('Customer Stream by id %d not found', $id)); } $this->manager->remove($stream); diff --git a/engine/Shopware/Components/Api/Resource/EmotionPreset.php b/engine/Shopware/Components/Api/Resource/EmotionPreset.php index ca6b6118d2c..993f8890f81 100644 --- a/engine/Shopware/Components/Api/Resource/EmotionPreset.php +++ b/engine/Shopware/Components/Api/Resource/EmotionPreset.php @@ -1,4 +1,5 @@ models->find(Preset::class, $presetId); if (!$preset) { - throw new NotFoundException(sprintf('Emotion preset with id %s not found', $presetId)); + throw new NotFoundException(\sprintf('Emotion preset with id %s not found', $presetId)); } if (!$preset->getCustom()) { - throw new PrivilegeException(sprintf('Emotion preset %s is not defined as custom preset', $preset->getName())); + throw new PrivilegeException(\sprintf('Emotion preset %s is not defined as custom preset', $preset->getName())); } $this->models->remove($preset); @@ -135,7 +136,7 @@ public function update($id, array $data, $locale = 'de_DE') /** @var Preset|null $preset */ $preset = $this->models->getRepository(Preset::class)->find($id); if (!$preset) { - throw new NotFoundException(sprintf('Preset with id %s not found', $id)); + throw new NotFoundException(\sprintf('Preset with id %s not found', $id)); } $preset->getTranslations()->clear(); @@ -205,7 +206,7 @@ private function validateName(Preset $preset) ->getSingleScalarResult(); if ($result > 0) { - throw new CustomValidationException(sprintf('Preset with name %s already exists', $preset->getName())); + throw new CustomValidationException(\sprintf('Preset with name %s already exists', $preset->getName())); } } diff --git a/engine/Shopware/Components/Api/Resource/Manufacturer.php b/engine/Shopware/Components/Api/Resource/Manufacturer.php index f1fa5938ce3..3d8b389418c 100644 --- a/engine/Shopware/Components/Api/Resource/Manufacturer.php +++ b/engine/Shopware/Components/Api/Resource/Manufacturer.php @@ -1,4 +1,5 @@ getOneOrNullResult($this->getResultMode()); if (!$manufacturer) { - throw new NotFoundException(sprintf('Manufacturer by id %d not found', $id)); + throw new NotFoundException(\sprintf('Manufacturer by id %d not found', $id)); } return $manufacturer; @@ -150,7 +151,7 @@ public function update($id, array $params) $manufacturer = $this->getRepository()->findOneBy(['id' => $id]); if (!$manufacturer) { - throw new NotFoundException(sprintf('Manufacturer by id %d not found', $id)); + throw new NotFoundException(\sprintf('Manufacturer by id %d not found', $id)); } $params = $this->prepareManufacturerData($params); @@ -186,7 +187,7 @@ public function delete($id) $manufacturer = $this->getRepository()->findOneBy(['id' => $id]); if (!$manufacturer) { - throw new NotFoundException(sprintf('Manufacturer by id %d not found', $id)); + throw new NotFoundException(\sprintf('Manufacturer by id %d not found', $id)); } $this->getManager()->remove($manufacturer); @@ -238,7 +239,7 @@ private function prepareMediaData(array $data, ManufacturerModel $manufacturerMo $media = $this->getManager()->find(MediaModel::class, (int) $data['image']['mediaId']); if (!($media instanceof MediaModel)) { - throw new ApiException\CustomValidationException(sprintf('Media by mediaId %s not found', $data['image']['mediaId'])); + throw new ApiException\CustomValidationException(\sprintf('Media by mediaId %s not found', $data['image']['mediaId'])); } } diff --git a/engine/Shopware/Components/Api/Resource/Media.php b/engine/Shopware/Components/Api/Resource/Media.php index 62884a9e556..d4f8979b615 100644 --- a/engine/Shopware/Components/Api/Resource/Media.php +++ b/engine/Shopware/Components/Api/Resource/Media.php @@ -1,4 +1,5 @@ getOneOrNullResult($this->getResultMode()); if (!$media) { - throw new NotFoundException(sprintf('Media by id %d not found', $id)); + throw new NotFoundException(\sprintf('Media by id %d not found', $id)); } $mediaService = Shopware()->Container()->get(MediaServiceInterface::class); @@ -191,7 +192,7 @@ public function update($id, array $params) $media = $this->getRepository()->find($id); if (!$media) { - throw new NotFoundException(sprintf('Media by id "%d" not found', $id)); + throw new NotFoundException(\sprintf('Media by id "%d" not found', $id)); } if (!empty($params['file'])) { @@ -239,7 +240,7 @@ public function delete($id) $media = $this->getRepository()->find($id); if (!$media) { - throw new NotFoundException(sprintf('Media by id %d not found', $id)); + throw new NotFoundException(\sprintf('Media by id %d not found', $id)); } $this->getManager()->remove($media); @@ -282,7 +283,7 @@ public function internalCreateMediaByFileLink($link, $albumId = -1) if (!$album) { // Cleanup temporary file $this->deleteTmpFile($file); - throw new CustomValidationException(sprintf('Album by id %s not found', $albumId)); + throw new CustomValidationException(\sprintf('Album by id %s not found', $albumId)); } $media->setAlbum($album); @@ -291,7 +292,7 @@ public function internalCreateMediaByFileLink($link, $albumId = -1) // Persist the model into the model manager this uploads and resizes the image $this->getManager()->persist($media); } catch (ORMException $e) { - throw new CustomValidationException(sprintf('Some error occurred while persisting your media')); + throw new CustomValidationException(\sprintf('Some error occurred while persisting your media')); } finally { // Cleanup temporary file $this->deleteTmpFile($file); @@ -322,7 +323,7 @@ public function load($url, $baseFilename = null) unlink($destPath); if (!\is_string($destPath) || (!@mkdir($destPath) && !is_dir($destPath))) { - throw new RuntimeException(sprintf('Could not create temp directory "%s"', $destPath)); + throw new RuntimeException(\sprintf('Could not create temp directory "%s"', $destPath)); } $this->getContainer()->get('shopware.components.stream_protocol_validator')->validate($url); @@ -332,16 +333,16 @@ public function load($url, $baseFilename = null) } $filename = $this->getUniqueFileName($destPath, $baseFilename); - $filePath = sprintf('%s/%s', $destPath, $filename); + $filePath = \sprintf('%s/%s', $destPath, $filename); $put_handle = fopen($filePath, 'wb+'); if (!\is_resource($put_handle)) { - throw new Exception(sprintf('Could not open %s for writing', $filePath)); + throw new Exception(\sprintf('Could not open %s for writing', $filePath)); } $get_handle = fopen($url, 'rb'); if (!\is_resource($get_handle)) { - throw new Exception(sprintf('Could not open %s for reading', $url)); + throw new Exception(\sprintf('Could not open %s for reading', $url)); } while (!feof($get_handle)) { @@ -355,7 +356,7 @@ public function load($url, $baseFilename = null) fclose($get_handle); fclose($put_handle); - return sprintf('%s/%s', $destPath, $filename); + return \sprintf('%s/%s', $destPath, $filename); } /** @@ -418,17 +419,17 @@ protected function uploadBase64File($url, $destinationPath, $baseFilename) { $get_handle = fopen($url, 'r'); if (!\is_resource($get_handle)) { - throw new Exception(sprintf('Could not open %s for reading', $url)); + throw new Exception(\sprintf('Could not open %s for reading', $url)); } $meta = stream_get_meta_data($get_handle); if (!\array_key_exists('mediatype', $meta) || !str_contains($meta['mediatype'], 'image/')) { - throw new CustomValidationException(sprintf('No valid media type passed for the product image: %s', $url)); + throw new CustomValidationException(\sprintf('No valid media type passed for the product image: %s', $url)); } $extension = str_replace('image/', '', $meta['mediatype']); $filename = $this->getUniqueFileName($destinationPath, $baseFilename) . '.' . $extension; - $destinationFilePath = sprintf('%s/%s', $destinationPath, $filename); + $destinationFilePath = \sprintf('%s/%s', $destinationPath, $filename); $put_handle = fopen("$destinationPath/$filename", 'wb+'); if (!\is_resource($put_handle)) { @@ -485,7 +486,7 @@ private function prepareMediaData(array $params, $media = null) if (isset($params['album'])) { $album = Shopware()->Models()->find(Album::class, $params['album']); if (!$album) { - throw new CustomValidationException(sprintf('Album by id %s not found', $params['album'])); + throw new CustomValidationException(\sprintf('Album by id %s not found', $params['album'])); } $params['album'] = $album; } @@ -507,7 +508,7 @@ private function prepareMediaData(array $params, $media = null) $originalName = $params['name']; } } catch (Exception $e) { - throw new Exception(sprintf('Could not load image %s', $params['file']), $e->getCode(), $e); + throw new Exception(\sprintf('Could not load image %s', $params['file']), $e->getCode(), $e); } } else { $path = str_replace('file://', '', $params['file']); diff --git a/engine/Shopware/Components/Api/Resource/Order.php b/engine/Shopware/Components/Api/Resource/Order.php index c16bad689c6..8e3597833ad 100644 --- a/engine/Shopware/Components/Api/Resource/Order.php +++ b/engine/Shopware/Components/Api/Resource/Order.php @@ -1,4 +1,5 @@ getRepository()->findOneBy(['number' => $number]); if (!$orderModel) { - throw new NotFoundException(sprintf('Order by number %s not found', $number)); + throw new NotFoundException(\sprintf('Order by number %s not found', $number)); } return $orderModel->getId(); @@ -131,7 +132,7 @@ public function getOne($id) ->getOneOrNullResult($this->getResultMode()); if ($order === null) { - throw new NotFoundException(sprintf('Order by id %d not found', $id)); + throw new NotFoundException(\sprintf('Order by id %d not found', $id)); } if (\is_array($order)) { @@ -301,7 +302,7 @@ public function update($id, array $params) $order = $this->getRepository()->find($id); if (!$order) { - throw new NotFoundException(sprintf('Order by id %d not found', $id)); + throw new NotFoundException(\sprintf('Order by id %d not found', $id)); } $params = $this->prepareOrderData($params, $order); @@ -401,7 +402,7 @@ public function prepareCreateOrderData(array $params) $params['customer'] = $this->getContainer()->get(ModelManager::class)->find(CustomerModel::class, $params['customerId']); if (empty($params['customer'])) { - throw new NotFoundException(sprintf('Customer by id %s not found', $params['customerId'])); + throw new NotFoundException(\sprintf('Customer by id %s not found', $params['customerId'])); } unset($params['customerId']); @@ -410,7 +411,7 @@ public function prepareCreateOrderData(array $params) 'group' => 'state', ]); if (empty($params['orderStatus'])) { - throw new NotFoundException(sprintf('OrderStatus by id %s not found', $params['orderStatusId'])); + throw new NotFoundException(\sprintf('OrderStatus by id %s not found', $params['orderStatusId'])); } unset($params['orderStatusId']); @@ -419,19 +420,19 @@ public function prepareCreateOrderData(array $params) 'group' => 'payment', ]); if (empty($params['paymentStatus'])) { - throw new NotFoundException(sprintf('PaymentStatus by id %s not found', $params['paymentStatusId'])); + throw new NotFoundException(\sprintf('PaymentStatus by id %s not found', $params['paymentStatusId'])); } unset($params['paymentStatusId']); $params['payment'] = $this->getContainer()->get(ModelManager::class)->find(Payment::class, $params['paymentId']); if (empty($params['payment'])) { - throw new NotFoundException(sprintf('Payment by id %s not found', $params['paymentId'])); + throw new NotFoundException(\sprintf('Payment by id %s not found', $params['paymentId'])); } unset($params['paymentId']); $params['dispatch'] = $this->getContainer()->get(ModelManager::class)->find(Dispatch::class, $params['dispatchId']); if (empty($params['dispatch'])) { - throw new NotFoundException(sprintf('Dispatch by id %s not found', $params['dispatchId'])); + throw new NotFoundException(\sprintf('Dispatch by id %s not found', $params['dispatchId'])); } unset($params['dispatchId']); @@ -439,7 +440,7 @@ public function prepareCreateOrderData(array $params) $params['partner'] = $this->getContainer()->get(ModelManager::class)->find(Partner::class, $params['partnerId']); if (empty($params['partner'])) { - throw new NotFoundException(sprintf('Partner by id %s not found', $params['partnerId'])); + throw new NotFoundException(\sprintf('Partner by id %s not found', $params['partnerId'])); } unset($params['partnerId']); @@ -447,7 +448,7 @@ public function prepareCreateOrderData(array $params) $params['shop'] = $this->getContainer()->get(ModelManager::class)->find(Shop::class, $params['shopId']); if (empty($params['shop'])) { - throw new NotFoundException(sprintf('Shop by id %s not found', $params['shopId'])); + throw new NotFoundException(\sprintf('Shop by id %s not found', $params['shopId'])); } unset($params['shopId']); @@ -521,14 +522,14 @@ public function prepareCreateOrderDetailsData(array $params) $status = $this->getContainer()->get(ModelManager::class)->find(DetailStatus::class, $detail['statusId']); if (!$status) { - throw new NotFoundException(sprintf('DetailStatus by id %s not found', $detail['statusId'])); + throw new NotFoundException(\sprintf('DetailStatus by id %s not found', $detail['statusId'])); } $detailModel->setStatus($status); unset($detail['statusId']); $tax = $this->getContainer()->get(ModelManager::class)->find(Tax::class, $detail['taxId']); if (!$tax) { - throw new NotFoundException(sprintf('Tax by id %s not found', $detail['taxId'])); + throw new NotFoundException(\sprintf('Tax by id %s not found', $detail['taxId'])); } $detailModel->setTax($tax); unset($detail['taxId']); @@ -593,7 +594,7 @@ public function prepareOrderData(array $params, OrderModel $order) ); if (empty($params['orderStatus'])) { - throw new NotFoundException(sprintf('OrderStatus by id %s not found', $params['orderStatusId'])); + throw new NotFoundException(\sprintf('OrderStatus by id %s not found', $params['orderStatusId'])); } } @@ -606,7 +607,7 @@ public function prepareOrderData(array $params, OrderModel $order) ); if (empty($params['paymentStatus'])) { - throw new NotFoundException(sprintf('PaymentStatus by id %s not found', $params['paymentStatusId'])); + throw new NotFoundException(\sprintf('PaymentStatus by id %s not found', $params['paymentStatusId'])); } return $params; @@ -663,7 +664,7 @@ public function prepareOrderDetailsData(array $params, OrderModel $order) $status = Shopware()->Models()->find(DetailStatus::class, $detail['status']); if (!$status) { - throw new NotFoundException(sprintf('DetailStatus by id %s not found', $detail['status'])); + throw new NotFoundException(\sprintf('DetailStatus by id %s not found', $detail['status'])); } $detailModel->setStatus($status); @@ -709,7 +710,7 @@ private function createAddresses(array $params, OrderModel $order): void if (isset($billing['stateId'])) { $state = $this->getContainer()->get(ModelManager::class)->find(State::class, (int) $billing['stateId']); if (!$state instanceof State) { - throw new NotFoundException(sprintf('Billing State by id %s not found', $billing['stateId'])); + throw new NotFoundException(\sprintf('Billing State by id %s not found', $billing['stateId'])); } } else { $billing['stateId'] = 0; @@ -717,11 +718,11 @@ private function createAddresses(array $params, OrderModel $order): void $country = $this->getContainer()->get(ModelManager::class)->find(CountryModel::class, $billing['countryId']); if (!$country instanceof CountryModel) { - throw new NotFoundException(sprintf('Billing Country by id %s not found', $billing['countryId'])); + throw new NotFoundException(\sprintf('Billing Country by id %s not found', $billing['countryId'])); } if (!$order->getCustomer() instanceof CustomerModel) { - throw new NotFoundException(sprintf('Order with ID "%s" has no customer', $order->getId())); + throw new NotFoundException(\sprintf('Order with ID "%s" has no customer', $order->getId())); } $billingAddress = new Billing(); @@ -746,7 +747,7 @@ private function createAddresses(array $params, OrderModel $order): void if (isset($shipping['stateId'])) { $state = $this->getContainer()->get(ModelManager::class)->find(State::class, (int) $shipping['stateId']); if (!$state instanceof State) { - throw new NotFoundException(sprintf('Shipping State by id %s not found', $shipping['stateId'])); + throw new NotFoundException(\sprintf('Shipping State by id %s not found', $shipping['stateId'])); } } else { $shipping['stateId'] = 0; @@ -754,7 +755,7 @@ private function createAddresses(array $params, OrderModel $order): void $country = $this->getContainer()->get(ModelManager::class)->find(CountryModel::class, $shipping['countryId']); if (!$country) { - throw new NotFoundException(sprintf('Shipping Country by id %s not found', $shipping['countryId'])); + throw new NotFoundException(\sprintf('Shipping Country by id %s not found', $shipping['countryId'])); } $shippingAddress = new Shipping(); diff --git a/engine/Shopware/Components/Api/Resource/PaymentMethods.php b/engine/Shopware/Components/Api/Resource/PaymentMethods.php index bc34e9b47a8..42151f739a1 100644 --- a/engine/Shopware/Components/Api/Resource/PaymentMethods.php +++ b/engine/Shopware/Components/Api/Resource/PaymentMethods.php @@ -1,4 +1,5 @@ getOneOrNullResult($this->getResultMode()); if (!$payment) { - throw new NotFoundException(sprintf('Payment by id %d not found', $id)); + throw new NotFoundException(\sprintf('Payment by id %d not found', $id)); } return $payment; @@ -151,7 +152,7 @@ public function update($id, array $params) $payment = $this->getRepository()->find($id); if (!$payment) { - throw new NotFoundException(sprintf('Payment by id "%d" not found', $id)); + throw new NotFoundException(\sprintf('Payment by id "%d" not found', $id)); } $params = $this->preparePaymentData($params); @@ -233,7 +234,7 @@ protected function preparePaymentData($params) foreach ($params['countries'] as &$country) { $countryModel = $this->getContainer()->get(ModelManager::class)->find(CountryModel::class, $country['countryId']); if (!$countryModel) { - throw new NotFoundException(sprintf('Country by id %d not found', $country['countryId'])); + throw new NotFoundException(\sprintf('Country by id %d not found', $country['countryId'])); } $country = $countryModel; @@ -246,7 +247,7 @@ protected function preparePaymentData($params) foreach ($params['shops'] as &$shop) { $shopModel = $this->getContainer()->get(ModelManager::class)->find(ShopModel::class, $shop['shopId']); if (!$shopModel) { - throw new NotFoundException(sprintf('Shop by id %d not found', $shop['shopId'])); + throw new NotFoundException(\sprintf('Shop by id %d not found', $shop['shopId'])); } $shop = $shopModel; @@ -258,7 +259,7 @@ protected function preparePaymentData($params) if (isset($params['pluginId'])) { $params['plugin'] = $this->getContainer()->get(ModelManager::class)->find(Plugin::class, $params['pluginId']); if (empty($params['plugin'])) { - throw new NotFoundException(sprintf('plugin by id %s not found', $params['pluginId'])); + throw new NotFoundException(\sprintf('plugin by id %s not found', $params['pluginId'])); } } diff --git a/engine/Shopware/Components/Api/Resource/PropertyGroup.php b/engine/Shopware/Components/Api/Resource/PropertyGroup.php index 0dc0cac54ff..a47efd18396 100644 --- a/engine/Shopware/Components/Api/Resource/PropertyGroup.php +++ b/engine/Shopware/Components/Api/Resource/PropertyGroup.php @@ -1,4 +1,5 @@ getOneOrNullResult($this->getResultMode()); if (!$property) { - throw new NotFoundException(sprintf('PropertyGroup by id %d not found', $id)); + throw new NotFoundException(\sprintf('PropertyGroup by id %d not found', $id)); } return $property; @@ -144,7 +145,7 @@ public function update($id, array $params) $propertyGroup = $this->getRepository()->find($id); if (!$propertyGroup) { - throw new NotFoundException(sprintf('PropertyGroup by id %d not found', $id)); + throw new NotFoundException(\sprintf('PropertyGroup by id %d not found', $id)); } $params = $this->preparePropertyData($params, $propertyGroup); @@ -180,7 +181,7 @@ public function delete($id) $propertyGroup = $this->getRepository()->find($id); if (!$propertyGroup) { - throw new NotFoundException(sprintf('PropertyGroup by id %d not found', $id)); + throw new NotFoundException(\sprintf('PropertyGroup by id %d not found', $id)); } $this->getManager()->remove($propertyGroup); diff --git a/engine/Shopware/Components/Api/Resource/Resource.php b/engine/Shopware/Components/Api/Resource/Resource.php index 2dc558d13a6..67054f0997b 100644 --- a/engine/Shopware/Components/Api/Resource/Resource.php +++ b/engine/Shopware/Components/Api/Resource/Resource.php @@ -1,4 +1,5 @@ getRole(); if ($this->getAcl()->isAllowed($role, $resource, $privilege) === false) { - $message = sprintf( + $message = \sprintf( 'Role "%s" is not allowed to "%s" on resource "%s"', \is_string($role) ? $role : $role->getRoleId(), $privilege, @@ -455,7 +456,7 @@ protected function getCollectionElementByProperty($collection, $property, $value $getterMethod = 'get' . ucfirst($property); if (!method_exists($entity, $getterMethod)) { - throw new RuntimeException(sprintf('Method %s not found on entity %s', $getterMethod, \get_class($entity))); + throw new RuntimeException(\sprintf('Method %s not found on entity %s', $getterMethod, \get_class($entity))); } if ($entity->$getterMethod() === $value) { return $entity; @@ -506,7 +507,7 @@ protected function findEntityByConditions($entity, array $conditions) { $repo = $this->getManager()->getRepository($entity); if (!$repo instanceof ModelRepository) { - throw new RuntimeException(sprintf('Passed entity has no configured repository: %s', $entity)); + throw new RuntimeException(\sprintf('Passed entity has no configured repository: %s', $entity)); } foreach ($conditions as $condition) { @@ -551,7 +552,7 @@ protected function getOneToManySubElement(Collection $collection, $data, $entity $item = $this->getCollectionElementByProperty($collection, $property, $data[$property]); if (!$item) { - throw new CustomValidationException(sprintf('%s by %s %s not found', $entityType, $property, $data[$property])); + throw new CustomValidationException(\sprintf('%s by %s %s not found', $entityType, $property, $data[$property])); } return $item; @@ -605,7 +606,7 @@ protected function getManyToManySubElement(Collection $collection, $data, $entit $item = $repo->findOneBy([$property => $data[$property]]); if (!$item) { - throw new CustomValidationException(sprintf('%s by %s %s not found', $entityType, $property, $data[$property])); + throw new CustomValidationException(\sprintf('%s by %s %s not found', $entityType, $property, $data[$property])); } $collection->add($item); diff --git a/engine/Shopware/Components/Api/Resource/Shop.php b/engine/Shopware/Components/Api/Resource/Shop.php index d98b7b4b3a8..70e1f1bb9d8 100644 --- a/engine/Shopware/Components/Api/Resource/Shop.php +++ b/engine/Shopware/Components/Api/Resource/Shop.php @@ -1,4 +1,5 @@ getOneOrNullResult($this->getResultMode()); if (!$shop) { - throw new NotFoundException(sprintf('Shop by id %s not found', $id)); + throw new NotFoundException(\sprintf('Shop by id %s not found', $id)); } return $shop; @@ -161,7 +162,7 @@ public function update($id, array $params) $shop = $this->getRepository()->find($id); if (!$shop) { - throw new NotFoundException(sprintf('Shop by id %s not found', $id)); + throw new NotFoundException(\sprintf('Shop by id %s not found', $id)); } $params = $this->prepareShopData($params, $shop); @@ -196,7 +197,7 @@ public function delete($id) $shop = $this->getRepository()->find($id); if (!$shop) { - throw new NotFoundException(sprintf('Shop by id %s not found', $id)); + throw new NotFoundException(\sprintf('Shop by id %s not found', $id)); } $this->getManager()->remove($shop); @@ -220,7 +221,7 @@ private function prepareShopData(array $params, ?ShopModel $shop = null): array } } else { if (isset($params[$param]) && empty($params[$param])) { - throw new RuntimeException(sprintf('param %s may not be empty', $param)); + throw new RuntimeException(\sprintf('param %s may not be empty', $param)); } } } @@ -230,7 +231,7 @@ private function prepareShopData(array $params, ?ShopModel $shop = null): array if ($currency !== null) { $params['currency'] = $currency; } else { - throw new RuntimeException(sprintf('%s is not a valid currency id', $params['currencyId'])); + throw new RuntimeException(\sprintf('%s is not a valid currency id', $params['currencyId'])); } } @@ -239,7 +240,7 @@ private function prepareShopData(array $params, ?ShopModel $shop = null): array if ($locale !== null) { $params['locale'] = $locale; } else { - throw new RuntimeException(sprintf('%s is not a valid locale id', $params['localeId'])); + throw new RuntimeException(\sprintf('%s is not a valid locale id', $params['localeId'])); } } @@ -248,7 +249,7 @@ private function prepareShopData(array $params, ?ShopModel $shop = null): array if ($customerGroup !== null) { $params['customerGroup'] = $customerGroup; } else { - throw new RuntimeException(sprintf('%s is not a valid customerGroup id', $params['customerGroupId'])); + throw new RuntimeException(\sprintf('%s is not a valid customerGroup id', $params['customerGroupId'])); } } @@ -257,7 +258,7 @@ private function prepareShopData(array $params, ?ShopModel $shop = null): array if ($shopModel instanceof ShopModel) { $params['main'] = $shopModel; } else { - throw new RuntimeException(sprintf('%s is not a valid shop id', $params['mainId'])); + throw new RuntimeException(\sprintf('%s is not a valid shop id', $params['mainId'])); } } @@ -266,7 +267,7 @@ private function prepareShopData(array $params, ?ShopModel $shop = null): array if ($template !== null) { $params['template'] = $template; } else { - throw new RuntimeException(sprintf('%s is not a valid template id', $params['templateId'])); + throw new RuntimeException(\sprintf('%s is not a valid template id', $params['templateId'])); } } @@ -275,7 +276,7 @@ private function prepareShopData(array $params, ?ShopModel $shop = null): array if ($template !== null) { $params['documentTemplate'] = $template; } else { - throw new RuntimeException(sprintf('%s is not a valid template id', $params['documentTemplateId'])); + throw new RuntimeException(\sprintf('%s is not a valid template id', $params['documentTemplateId'])); } } @@ -284,7 +285,7 @@ private function prepareShopData(array $params, ?ShopModel $shop = null): array if ($category !== null) { $params['category'] = $category; } else { - throw new RuntimeException(sprintf('%s is not a valid category id', $params['categoryId'])); + throw new RuntimeException(\sprintf('%s is not a valid category id', $params['categoryId'])); } } diff --git a/engine/Shopware/Components/Api/Resource/Translation.php b/engine/Shopware/Components/Api/Resource/Translation.php index 383ecb9ef57..56576b9b4e7 100644 --- a/engine/Shopware/Components/Api/Resource/Translation.php +++ b/engine/Shopware/Components/Api/Resource/Translation.php @@ -1,4 +1,5 @@ getManager()->remove($translation); @@ -527,7 +528,7 @@ protected function getIdByNumber($number, $type) case self::TYPE_CONFIGURATOR_OPTION: return $this->getConfiguratorOptionIdByNumber($number); default: - throw new CustomValidationException(sprintf('Unknown translation type %s', $type)); + throw new CustomValidationException(\sprintf('Unknown translation type %s', $type)); } } @@ -549,7 +550,7 @@ protected function getProductIdByNumber($number) ); if (!$entity instanceof Detail) { - throw new NotFoundException(sprintf('Variant by order number %s not found', $number)); + throw new NotFoundException(\sprintf('Variant by order number %s not found', $number)); } return $entity->getArticle()->getId(); @@ -573,7 +574,7 @@ protected function getProductVariantIdByNumber($number) ); if (!$entity instanceof Detail) { - throw new NotFoundException(sprintf('Variant by order number %s not found', $number)); + throw new NotFoundException(\sprintf('Variant by order number %s not found', $number)); } return $entity->getId(); @@ -628,7 +629,7 @@ protected function getManufacturerIdByNumber($number) ); if (!$entity instanceof Supplier) { - throw new NotFoundException(sprintf('Manufacturer by name %s not found', $number)); + throw new NotFoundException(\sprintf('Manufacturer by name %s not found', $number)); } return $entity->getId(); @@ -655,7 +656,7 @@ protected function getCountryIdByNumber($number) ); if (!$country instanceof Country) { - throw new NotFoundException(sprintf('Country by iso/name %s not found', $number)); + throw new NotFoundException(\sprintf('Country by iso/name %s not found', $number)); } return $country->getId(); @@ -682,7 +683,7 @@ protected function getCountryStateIdByNumber($number) ); if (!$entity instanceof State) { - throw new NotFoundException(sprintf('Country state by name/short code %s not found', $number)); + throw new NotFoundException(\sprintf('Country state by name/short code %s not found', $number)); } return $entity->getId(); @@ -707,7 +708,7 @@ protected function getDispatchIdByNumber($number) ); if (!$entity instanceof Dispatch) { - throw new NotFoundException(sprintf('Dispatch by name code %s not found', $number)); + throw new NotFoundException(\sprintf('Dispatch by name code %s not found', $number)); } return $entity->getId(); @@ -733,7 +734,7 @@ protected function getPaymentIdByNumber($number) ); if (!$entity instanceof Payment) { - throw new NotFoundException(sprintf('Payment by name/description code %s not found', $number)); + throw new NotFoundException(\sprintf('Payment by name/description code %s not found', $number)); } return $entity->getId(); @@ -758,7 +759,7 @@ protected function getFilterSetIdByNumber($number) ); if (!$entity instanceof Group) { - throw new NotFoundException(sprintf('Filter set by name code %s not found', $number)); + throw new NotFoundException(\sprintf('Filter set by name code %s not found', $number)); } return $entity->getId(); @@ -782,7 +783,7 @@ protected function getFilterGroupIdByNumber($number) $numbers = explode('|', $number); if (\count($numbers) < 2) { - throw new CustomValidationException(sprintf('Passed filter group number %s contains not the full path: set|group', $number)); + throw new CustomValidationException(\sprintf('Passed filter group number %s contains not the full path: set|group', $number)); } $set = $this->findEntityByConditions( @@ -793,7 +794,7 @@ protected function getFilterGroupIdByNumber($number) ); if (!$set instanceof Group) { - throw new NotFoundException(sprintf('Filter set by name code %s not found', $numbers[0])); + throw new NotFoundException(\sprintf('Filter set by name code %s not found', $numbers[0])); } $group = $this->getCollectionElementByProperty( @@ -803,7 +804,7 @@ protected function getFilterGroupIdByNumber($number) ); if (!$group instanceof Option) { - throw new NotFoundException(sprintf('Filter group by name code %s not found', $numbers[1])); + throw new NotFoundException(\sprintf('Filter group by name code %s not found', $numbers[1])); } return $group->getId(); @@ -827,7 +828,7 @@ protected function getFilterOptionIdByNumber($number) $numbers = explode('|', $number); if (\count($numbers) < 3) { - throw new CustomValidationException(sprintf('Passed filter option number %s contains not the full path: set|group|option', $number)); + throw new CustomValidationException(\sprintf('Passed filter option number %s contains not the full path: set|group|option', $number)); } $set = $this->findEntityByConditions( @@ -838,7 +839,7 @@ protected function getFilterOptionIdByNumber($number) ); if (!$set instanceof Group) { - throw new NotFoundException(sprintf('Filter set by name %s not found', $numbers[0])); + throw new NotFoundException(\sprintf('Filter set by name %s not found', $numbers[0])); } $group = $this->getCollectionElementByProperty( @@ -848,7 +849,7 @@ protected function getFilterOptionIdByNumber($number) ); if (!$group instanceof Option) { - throw new NotFoundException(sprintf('Filter group by name %s not found', $numbers[1])); + throw new NotFoundException(\sprintf('Filter group by name %s not found', $numbers[1])); } $option = $this->getCollectionElementByProperty( @@ -858,7 +859,7 @@ protected function getFilterOptionIdByNumber($number) ); if (!$option instanceof Value) { - throw new NotFoundException(sprintf('Filter option by name %s not found', $numbers[2])); + throw new NotFoundException(\sprintf('Filter option by name %s not found', $numbers[2])); } return $option->getId(); @@ -881,7 +882,7 @@ protected function getConfiguratorGroupIdByNumber($number) ); if (!$entity instanceof ConfiguratorGroup) { - throw new NotFoundException(sprintf('Configurator group by name %s not found', $number)); + throw new NotFoundException(\sprintf('Configurator group by name %s not found', $number)); } return $entity->getId(); @@ -906,7 +907,7 @@ protected function getConfiguratorOptionIdByNumber($number) $numbers = explode('|', $number); if (!\is_array($numbers) || \count($numbers) < 2) { - throw new CustomValidationException(sprintf('Passed configurator option name %s contains not the full path: group|option', $number)); + throw new CustomValidationException(\sprintf('Passed configurator option name %s contains not the full path: group|option', $number)); } $group = $this->findEntityByConditions( @@ -915,7 +916,7 @@ protected function getConfiguratorOptionIdByNumber($number) ); if (!$group) { - throw new NotFoundException(sprintf('Configurator group by name %s not found', $numbers[0])); + throw new NotFoundException(\sprintf('Configurator group by name %s not found', $numbers[0])); } $option = $this->getCollectionElementByProperty( @@ -924,7 +925,7 @@ protected function getConfiguratorOptionIdByNumber($number) $numbers[1] ); if (!$option instanceof ConfiguratorOption) { - throw new NotFoundException(sprintf('Configurator option by name %s not found', $numbers[1])); + throw new NotFoundException(\sprintf('Configurator option by name %s not found', $numbers[1])); } return $option->getId(); diff --git a/engine/Shopware/Components/Api/Resource/User.php b/engine/Shopware/Components/Api/Resource/User.php index 90bc2f29dfe..563c67eec5e 100644 --- a/engine/Shopware/Components/Api/Resource/User.php +++ b/engine/Shopware/Components/Api/Resource/User.php @@ -1,4 +1,5 @@ getQuery()->getOneOrNullResult($this->getResultMode()); if (!$user) { - throw new NotFoundException(sprintf('User by id %s not found', $id)); + throw new NotFoundException(\sprintf('User by id %s not found', $id)); } if (!$this->hasPrivilege('create', 'usermanager') @@ -201,7 +202,7 @@ public function update($id, array $params) $user = $builder->getQuery()->getOneOrNullResult(self::HYDRATE_OBJECT); if (!$user) { - throw new NotFoundException(sprintf('User by id %s not found', $id)); + throw new NotFoundException(\sprintf('User by id %s not found', $id)); } $params = $this->prepareAssociatedData($params, $user); @@ -237,7 +238,7 @@ public function delete($id) $user = $this->getRepository()->find($id); if (!$user) { - throw new NotFoundException(sprintf('User by id %s not found', $id)); + throw new NotFoundException(\sprintf('User by id %s not found', $id)); } $this->getManager()->remove($user); @@ -265,13 +266,13 @@ public function checkPrivilege($privilege, $resource = null) } if (!$this->getAcl()->has($resource)) { - throw new ApiException\PrivilegeException(sprintf('No resource "%s" found', $resource)); + throw new ApiException\PrivilegeException(\sprintf('No resource "%s" found', $resource)); } $role = $this->getRole(); if (!$this->getAcl()->isAllowed($role, $resource, $privilege)) { - throw new ApiException\PrivilegeException(sprintf('Role "%s" is not allowed to "%s" on resource "%s"', \is_string($role) ? $role : $role->getRoleId(), $privilege, \is_string($resource) ? $resource : $resource->getResourceId())); + throw new ApiException\PrivilegeException(\sprintf('Role "%s" is not allowed to "%s" on resource "%s"', \is_string($role) ? $role : $role->getRoleId(), $privilege, \is_string($resource) ? $resource : $resource->getResourceId())); } } @@ -304,13 +305,13 @@ protected function prepareAssociatedData(array $data, UserModel $user) $data['role'] = $this->getManager()->find(Role::class, $data['roleId']); if (empty($data['role'])) { - throw new ApiException\CustomValidationException(sprintf('Role by id %s not found', $data['roleId'])); + throw new ApiException\CustomValidationException(\sprintf('Role by id %s not found', $data['roleId'])); } } elseif (isset($data['role']) && ($data['role'] >= 0)) { $role = $this->getManager()->getRepository(Role::class)->findOneBy(['name' => $data['role']]); if (!$role) { - throw new ApiException\CustomValidationException(sprintf('Role by name %s not found', $data['role'])); + throw new ApiException\CustomValidationException(\sprintf('Role by name %s not found', $data['role'])); } $data['role'] = $role; } else { @@ -320,12 +321,12 @@ protected function prepareAssociatedData(array $data, UserModel $user) // Check if a locale id or name is passed. if (!empty($data['localeId'])) { if (!$this->isLocaleId((int) $data['localeId'])) { - throw new ApiException\CustomValidationException(sprintf('Locale by id %s not found', $data['localeId'])); + throw new ApiException\CustomValidationException(\sprintf('Locale by id %s not found', $data['localeId'])); } } elseif (!empty($data['locale'])) { $localeId = $this->getLocaleIdFromLocale($data['locale']); if (!$localeId) { - throw new ApiException\CustomValidationException(sprintf('Locale by name %s not found', $data['locale'])); + throw new ApiException\CustomValidationException(\sprintf('Locale by name %s not found', $data['locale'])); } $data['localeId'] = $localeId; } else { diff --git a/engine/Shopware/Components/Api/Resource/Variant.php b/engine/Shopware/Components/Api/Resource/Variant.php index c94ca840023..c1519e42f52 100644 --- a/engine/Shopware/Components/Api/Resource/Variant.php +++ b/engine/Shopware/Components/Api/Resource/Variant.php @@ -1,4 +1,5 @@ getQuery()->getOneOrNullResult($this->getResultMode()); if (!$variant) { - throw new NotFoundException(sprintf('Variant by id %d not found', $id)); + throw new NotFoundException(\sprintf('Variant by id %d not found', $id)); } if (\is_array($variant) && !empty($options['considerTaxInput'])) { @@ -177,7 +178,7 @@ public function getIdFromNumber($number) $productVariant = $this->getRepository()->findOneBy(['number' => $number]); if (!$productVariant) { - throw new NotFoundException(sprintf('Variant by number %s not found', $number)); + throw new NotFoundException(\sprintf('Variant by number %s not found', $number)); } return $productVariant->getId(); @@ -217,7 +218,7 @@ public function delete($id) $productVariant = $this->getRepository()->find($id); if (!$productVariant instanceof Detail) { - throw new NotFoundException(sprintf('Variant by id %d not found', $id)); + throw new NotFoundException(\sprintf('Variant by id %d not found', $id)); } if ($productVariant->getKind() === 1) { @@ -264,7 +265,7 @@ public function update($id, array $params) $variant = $this->getRepository()->find($id); if (!$variant instanceof Detail) { - throw new NotFoundException(sprintf('Variant by id %d not found', $id)); + throw new NotFoundException(\sprintf('Variant by id %d not found', $id)); } $variant = $this->internalUpdate($id, $params, $variant->getArticle()); @@ -300,7 +301,7 @@ public function create(array $params) $product = $this->getManager()->find(ProductModel::class, $productId); if (!$product) { - throw new NotFoundException(sprintf('Product by id %d not found', $productId)); + throw new NotFoundException(\sprintf('Product by id %d not found', $productId)); } $variant = $this->internalCreate($params, $product); @@ -339,7 +340,7 @@ public function internalUpdate($id, array $data, ProductModel $article) $variant = $this->getRepository()->find($id); if (!$variant instanceof Detail) { - throw new NotFoundException(sprintf('Variant by id %d not found', $id)); + throw new NotFoundException(\sprintf('Variant by id %d not found', $id)); } $variant->setArticle($article); @@ -509,7 +510,7 @@ protected function prepareData(array $data, ProductModel $article, Detail $varia ->get(Connection::class) ->fetchColumn('SELECT id FROM s_articles_details WHERE ordernumber = ?', [$data['number']]); if ($exists) { - throw new CustomValidationException(sprintf('A variant with the given order number "%s" already exists.', $data['number'])); + throw new CustomValidationException(\sprintf('A variant with the given order number "%s" already exists.', $data['number'])); } } @@ -565,7 +566,7 @@ protected function prepareImageAssociation($data, ProductModel $article, Detail $media = $this->getManager()->find(MediaModel::class, (int) $imageData['mediaId']); if (!$media) { - throw new CustomValidationException(sprintf('Media by id %s not found', (int) $imageData['mediaId'])); + throw new CustomValidationException(\sprintf('Media by id %s not found', (int) $imageData['mediaId'])); } $image = $this->getArticleResource()->createNewArticleImage($article, $media); @@ -663,7 +664,7 @@ protected function preparePriceAssociation($data, ProductModel $article, Detail ->findOneBy(['key' => $priceData['customerGroupKey']]); if (!$customerGroup instanceof CustomerGroup) { - throw new CustomValidationException(sprintf('Customer Group by key %s not found', $priceData['customerGroupKey'])); + throw new CustomValidationException(\sprintf('Customer Group by key %s not found', $priceData['customerGroupKey'])); } $priceData['customerGroup'] = $customerGroup; @@ -769,7 +770,7 @@ protected function prepareUnitAssociation($data) $data['unit'] = $this->getManager()->find(Unit::class, $data['unitId']); if (empty($data['unit'])) { - throw new CustomValidationException(sprintf('Unit by id %s not found', $data['unitId'])); + throw new CustomValidationException(\sprintf('Unit by id %s not found', $data['unitId'])); } // New unit data send? create new unit for this variant @@ -802,14 +803,14 @@ protected function updateUnitReference($unitData) // Unit identifier send and unit not found? throw exception => Not allowed to create a new unit in this case if (!$unit && isset($unitData['id'])) { - throw new CustomValidationException(sprintf('Unit by id %s not found', $unitData['id'])); + throw new CustomValidationException(\sprintf('Unit by id %s not found', $unitData['id'])); } // To create a new unit, the unit name and unit is required. Otherwise we throw an exception if (!$unit && isset($unitData['name'], $unitData['unit'])) { $unit = new Unit(); } elseif (!$unit) { - throw new CustomValidationException(sprintf('To create a unit you need to pass `name` and `unit`')); + throw new CustomValidationException(\sprintf('To create a unit you need to pass `name` and `unit`')); } $unit->fromArray($unitData); @@ -836,7 +837,7 @@ private function considerTaxInput(array $variant): array ); if (empty($tax)) { - throw new CustomValidationException(sprintf('No product tax configured for variant: %s', $variant['id'])); + throw new CustomValidationException(\sprintf('No product tax configured for variant: %s', $variant['id'])); } $variant['prices'] = $this->getArticleResource()->getTaxPrices( @@ -875,7 +876,7 @@ private function mergePriceData(array $priceData, Tax $tax): array if (\array_key_exists('from', $priceData)) { $priceData['from'] = (int) $priceData['from']; if ($priceData['from'] <= 0) { - throw new CustomValidationException(sprintf('Invalid Price "from" value')); + throw new CustomValidationException(\sprintf('Invalid Price "from" value')); } } if (\array_key_exists('to', $priceData)) { @@ -977,7 +978,7 @@ private function getUnitFindCondition(array $data) return ['name' => $data['name']]; } - throw new CustomValidationException(sprintf('To create a unit you need to pass `name` and `unit`')); + throw new CustomValidationException(\sprintf('To create a unit you need to pass `name` and `unit`')); } /** @@ -1016,7 +1017,7 @@ private function prepareEsdAssociation($data, Detail $variant) $saveFile = $esdDir . '/' . $saveFileName; if (!is_writable($esdDir)) { - throw new RuntimeException(sprintf('Unable to save ESD-file, as the directory "%s" is not writable.', $esdDir)); + throw new RuntimeException(\sprintf('Unable to save ESD-file, as the directory "%s" is not writable.', $esdDir)); } copy($file, $saveFile); diff --git a/engine/Shopware/Components/AttributeSubscriber.php b/engine/Shopware/Components/AttributeSubscriber.php index cc16fe32296..f19a400105e 100644 --- a/engine/Shopware/Components/AttributeSubscriber.php +++ b/engine/Shopware/Components/AttributeSubscriber.php @@ -1,4 +1,5 @@ sendResponse(); exit; } - exit(sprintf("Failed to create the attribute models, please check the permissions of the '%s' directory", $generator->getPath())); + exit(\sprintf("Failed to create the attribute models, please check the permissions of the '%s' directory", $generator->getPath())); } } diff --git a/engine/Shopware/Components/Auth.php b/engine/Shopware/Components/Auth.php index 189fce845a0..2fc9f2aa28a 100644 --- a/engine/Shopware/Components/Auth.php +++ b/engine/Shopware/Components/Auth.php @@ -1,4 +1,5 @@ Request()->getRequestUri())); + throw new CSRFTokenValidationException(\sprintf('The provided CSRF-Token is invalid. If you\'re sure that the request to path "%s" should be valid, the called controller action needs to be whitelisted using the CSRFWhitelistAware interface.', $controller->Request()->getRequestUri())); } } @@ -148,7 +148,7 @@ public function checkFrontendTokenValidation(Enlight_Event_EventArgs $args) } if (!$this->checkRequest($request)) { - throw new CSRFTokenValidationException(sprintf('The provided X-CSRF-Token for path "%s" is invalid. Please go back, reload the page and try again.', $request->getRequestUri())); + throw new CSRFTokenValidationException(\sprintf('The provided X-CSRF-Token for path "%s" is invalid. Please go back, reload the page and try again.', $request->getRequestUri())); } // mark request as validated to avoid double validation @@ -165,7 +165,7 @@ public function clearExistingCookie(): void $name, Random::getAlphanumericString(30), 0, - sprintf('%s/', $shop->getPath() ?: ''), + \sprintf('%s/', $shop->getPath() ?: ''), '', $shop->getSecure(), false diff --git a/engine/Shopware/Components/CacheManager.php b/engine/Shopware/Components/CacheManager.php index 55dd4fb7af4..28991271e01 100644 --- a/engine/Shopware/Components/CacheManager.php +++ b/engine/Shopware/Components/CacheManager.php @@ -1,4 +1,5 @@ rename($dir, $tempFileName); $finder->directories() ->in(\dirname($dir, 1)) - ->name(sprintf('*.%s', $tempFileExtension)); + ->name(\sprintf('*.%s', $tempFileExtension)); if ($finder->hasResults()) { $fileSystem->remove($finder); diff --git a/engine/Shopware/Components/CacheSubscriber.php b/engine/Shopware/Components/CacheSubscriber.php index d99eab8d3ec..b716f0e0886 100644 --- a/engine/Shopware/Components/CacheSubscriber.php +++ b/engine/Shopware/Components/CacheSubscriber.php @@ -1,4 +1,5 @@ fetch(PDO::FETCH_ASSOC); if (empty($originalCategory)) { - throw new RuntimeException(sprintf('Category "%s" not found', $originalCategoryId)); + throw new RuntimeException(\sprintf('Category "%s" not found', $originalCategoryId)); } $newPosStmt = $this->connection diff --git a/engine/Shopware/Components/Check/File.php b/engine/Shopware/Components/Check/File.php index cf6530c20a3..af6de20093e 100644 --- a/engine/Shopware/Components/Check/File.php +++ b/engine/Shopware/Components/Check/File.php @@ -1,4 +1,5 @@ sourceFile = $sourceFile; @@ -503,7 +504,7 @@ private function handleMaxCompatibleVersion(array $check): array if (version_compare($check['version'], $check['maxCompatibleVersion'], '>')) { $check['check'] = false; $maxCompatibleVersion = str_replace('.99', '', $check['maxCompatibleVersion']); - $check['notice'] = sprintf($this->snippetManager->getNamespace('backend/systeminfo/view')->get('php_version_is_too_new_warning'), $maxCompatibleVersion); + $check['notice'] = \sprintf($this->snippetManager->getNamespace('backend/systeminfo/view')->get('php_version_is_too_new_warning'), $maxCompatibleVersion); } return $check; diff --git a/engine/Shopware/Components/Compatibility/LegacyEventManager.php b/engine/Shopware/Components/Compatibility/LegacyEventManager.php index 82ab747acd2..481d7f37e25 100644 --- a/engine/Shopware/Components/Compatibility/LegacyEventManager.php +++ b/engine/Shopware/Components/Compatibility/LegacyEventManager.php @@ -1,4 +1,5 @@ getRetinaSource() !== null) { - return sprintf('%s, %s 2x', $thumbnail->getSource(), $thumbnail->getRetinaSource()); + return \sprintf('%s, %s 2x', $thumbnail->getSource(), $thumbnail->getRetinaSource()); } return $thumbnail->getSource(); @@ -1137,7 +1137,7 @@ private function formatPrice(?float $price): string $price = str_replace('.', ',', (string) $price); // Replace points with commas $commaPos = strpos($price, ','); if ($commaPos) { - $part = substr($price, $commaPos + 1, \strlen($price) - $commaPos); + $part = (string) substr($price, $commaPos + 1, \strlen($price) - $commaPos); switch (\strlen($part)) { case 1: $price .= '0'; diff --git a/engine/Shopware/Components/Config.php b/engine/Shopware/Components/Config.php index 9fac818ffca..cd06d1f071f 100644 --- a/engine/Shopware/Components/Config.php +++ b/engine/Shopware/Components/Config.php @@ -1,4 +1,5 @@ container->get('corelogger')->warning(sprintf('Event "%s" is deprecated. Do not use it anymore.', $eventName)); + $this->container->get('corelogger')->warning(\sprintf('Event "%s" is deprecated. Do not use it anymore.', $eventName)); } } } diff --git a/engine/Shopware/Components/Cron/CronJob.php b/engine/Shopware/Components/Cron/CronJob.php index f4dc95810d1..f1ae7775a2e 100644 --- a/engine/Shopware/Components/Cron/CronJob.php +++ b/engine/Shopware/Components/Cron/CronJob.php @@ -1,4 +1,5 @@ _handler = $handler; diff --git a/engine/Shopware/Components/CustomerStream/CookieSubscriber.php b/engine/Shopware/Components/CustomerStream/CookieSubscriber.php index 7a8250f8f33..bec33718de0 100644 --- a/engine/Shopware/Components/CustomerStream/CookieSubscriber.php +++ b/engine/Shopware/Components/CustomerStream/CookieSubscriber.php @@ -1,4 +1,5 @@ getStream($streamId); if (!$stream) { - throw new RuntimeException(sprintf('Stream by id %s not found', $streamId)); + throw new RuntimeException(\sprintf('Stream by id %s not found', $streamId)); } if (empty($stream['conditions'])) { - throw new RuntimeException(sprintf('Stream %s has no conditions', $stream['name'])); + throw new RuntimeException(\sprintf('Stream %s has no conditions', $stream['name'])); } $conditions = $this->reflectionHelper->unserialize( json_decode($stream['conditions'], true), - sprintf('Error while unserialize stream conditions') + \sprintf('Error while unserialize stream conditions') ); $criteria = new Criteria(); diff --git a/engine/Shopware/Components/CustomerStream/CustomerStreamCriteriaFactoryInterface.php b/engine/Shopware/Components/CustomerStream/CustomerStreamCriteriaFactoryInterface.php index 42ab9034145..bc2f5e099dc 100644 --- a/engine/Shopware/Components/CustomerStream/CustomerStreamCriteriaFactoryInterface.php +++ b/engine/Shopware/Components/CustomerStream/CustomerStreamCriteriaFactoryInterface.php @@ -1,4 +1,5 @@ exec('SET @@session.sql_mode = ""'); if (isset($dbConfig['timezone'])) { - $conn->exec(sprintf('SET @@session.time_zone = %s;', $conn->quote($dbConfig['timezone']))); + $conn->exec(\sprintf('SET @@session.time_zone = %s;', $conn->quote($dbConfig['timezone']))); } foreach (($dbConfig['session'] ?? []) as $sessionKey => $sessionValue) { if (\is_int($sessionValue)) { - $conn->exec(sprintf('SET @@session.`%s` = %d;', $sessionKey, $sessionValue)); + $conn->exec(\sprintf('SET @@session.`%s` = %d;', $sessionKey, $sessionValue)); } elseif (\is_float($sessionValue)) { - $conn->exec(sprintf('SET @@session.`%s` = %f;', $sessionKey, $sessionValue)); + $conn->exec(\sprintf('SET @@session.`%s` = %f;', $sessionKey, $sessionValue)); } elseif (\is_string($sessionValue)) { - $conn->exec(sprintf('SET @@session.`%s` = %s;', $sessionKey, $conn->quote($sessionValue))); + $conn->exec(\sprintf('SET @@session.`%s` = %s;', $sessionKey, $conn->quote($sessionValue))); } elseif ($sessionValue === null) { - $conn->exec(sprintf('SET @@session.`%s` = NULL;', $sessionKey)); + $conn->exec(\sprintf('SET @@session.`%s` = NULL;', $sessionKey)); } else { throw new InvalidArgumentException( - sprintf('Unexpected database session value for %s: %s', $sessionKey, serialize($sessionValue)) + \sprintf('Unexpected database session value for %s: %s', $sessionKey, serialize($sessionValue)) ); } } @@ -96,7 +97,7 @@ public static function createPDO(array $dbConfig) $e->getMessage() ); - throw new RuntimeException(sprintf('Could not connect to database. Message from SQL Server: %s', $message)); + throw new RuntimeException(\sprintf('Could not connect to database. Message from SQL Server: %s', $message)); } return $conn; diff --git a/engine/Shopware/Components/DependencyInjection/Bridge/Front.php b/engine/Shopware/Components/DependencyInjection/Bridge/Front.php index 03a765eff89..a08faaf6898 100644 --- a/engine/Shopware/Components/DependencyInjection/Bridge/Front.php +++ b/engine/Shopware/Components/DependencyInjection/Bridge/Front.php @@ -1,4 +1,5 @@ setPublic(true); if ($def->isAbstract()) { - throw new InvalidArgumentException(sprintf('The service "%s" must not be abstract as event listeners are lazy-loaded.', $id)); + throw new InvalidArgumentException(\sprintf('The service "%s" must not be abstract as event listeners are lazy-loaded.', $id)); } foreach ($events as $event) { $priority = isset($event['priority']) ? $event['priority'] : 0; if (!isset($event['event'])) { - throw new InvalidArgumentException(sprintf('Service "%s" must define the "event" attribute on "%s" tags.', $id, 'shopware.event_listener')); + throw new InvalidArgumentException(\sprintf('Service "%s" must define the "event" attribute on "%s" tags.', $id, 'shopware.event_listener')); } if (!isset($event['method'])) { - throw new InvalidArgumentException(sprintf('Service "%s" must define the "method" attribute on "%s" tags.', $id, 'shopware.event_listener')); + throw new InvalidArgumentException(\sprintf('Service "%s" must define the "method" attribute on "%s" tags.', $id, 'shopware.event_listener')); } $definition->addMethodCall('addListenerService', [$event['event'], [$id, $event['method']], $priority]); diff --git a/engine/Shopware/Components/DependencyInjection/Compiler/EventSubscriberCompilerPass.php b/engine/Shopware/Components/DependencyInjection/Compiler/EventSubscriberCompilerPass.php index c4be6cf553a..80171a420b8 100644 --- a/engine/Shopware/Components/DependencyInjection/Compiler/EventSubscriberCompilerPass.php +++ b/engine/Shopware/Components/DependencyInjection/Compiler/EventSubscriberCompilerPass.php @@ -1,4 +1,5 @@ setPublic(true); if ($def->isAbstract()) { - throw new InvalidArgumentException(sprintf('The service "%s" must not be abstract as event subscribers are lazy-loaded.', $id)); + throw new InvalidArgumentException(\sprintf('The service "%s" must not be abstract as event subscribers are lazy-loaded.', $id)); } // We must assume that the class value has been correctly filled, even if the service is created by a factory @@ -58,7 +59,7 @@ public function process(ContainerBuilder $container) $refClass = new ReflectionClass($class); $interface = 'Enlight\Event\SubscriberInterface'; if (!$refClass->implementsInterface($interface)) { - throw new InvalidArgumentException(sprintf('Service "%s" must implement interface "%s".', $id, $interface)); + throw new InvalidArgumentException(\sprintf('Service "%s" must implement interface "%s".', $id, $interface)); } $definition->addMethodCall( diff --git a/engine/Shopware/Components/DependencyInjection/Compiler/LegacyApiResourcesPass.php b/engine/Shopware/Components/DependencyInjection/Compiler/LegacyApiResourcesPass.php index 64b66ae32c2..9706d42bd22 100644 --- a/engine/Shopware/Components/DependencyInjection/Compiler/LegacyApiResourcesPass.php +++ b/engine/Shopware/Components/DependencyInjection/Compiler/LegacyApiResourcesPass.php @@ -1,4 +1,5 @@ getParameterNameLoggerMaxFiles($servicePrefix)), - sprintf('%%%s%%', $this->getParameterNameLogLevel($servicePrefix)), + \sprintf('%%kernel.logs_dir%%/%s_%%kernel.environment%%.log', $servicePrefix), + \sprintf('%%%s%%', $this->getParameterNameLoggerMaxFiles($servicePrefix)), + \sprintf('%%%s%%', $this->getParameterNameLogLevel($servicePrefix)), ])) ->addMethodCall('pushProcessor', [new Reference('monolog.processor.uid')]) ->setPublic(false) @@ -99,26 +100,26 @@ protected function createLogger(string $servicePrefix): Definition protected function getServiceIdLogger(string $servicePrefix): string { - return sprintf('%s.logger', $servicePrefix); + return \sprintf('%s.logger', $servicePrefix); } protected function getServiceIdLoggerFormatter(string $servicePrefix): string { - return sprintf('%s.logger_formatter', $servicePrefix); + return \sprintf('%s.logger_formatter', $servicePrefix); } protected function getServiceIdLoggerHandler(string $servicePrefix): string { - return sprintf('%s.logger_handler', $servicePrefix); + return \sprintf('%s.logger_handler', $servicePrefix); } protected function getParameterNameLoggerMaxFiles(string $servicePrefix): string { - return sprintf('%s.logger.max_files', $servicePrefix); + return \sprintf('%s.logger.max_files', $servicePrefix); } protected function getParameterNameLogLevel(string $servicePrefix): string { - return sprintf('%s.logger.level', $servicePrefix); + return \sprintf('%s.logger.level', $servicePrefix); } } diff --git a/engine/Shopware/Components/DependencyInjection/Compiler/PluginResourceCompilerPass.php b/engine/Shopware/Components/DependencyInjection/Compiler/PluginResourceCompilerPass.php index cbfb3f549d2..9813f3fdb19 100644 --- a/engine/Shopware/Components/DependencyInjection/Compiler/PluginResourceCompilerPass.php +++ b/engine/Shopware/Components/DependencyInjection/Compiler/PluginResourceCompilerPass.php @@ -1,4 +1,5 @@ _subshop['id'])) { - throw new Enlight_Exception(sprintf('Could not load template path for order "%s"', $orderID)); + throw new Enlight_Exception(\sprintf('Could not load template path for order "%s"', $orderID)); } if (!empty($config['_allowMultipleDocuments'])) { $document->_allowMultipleDocuments = $config['_allowMultipleDocuments']; @@ -328,7 +329,7 @@ public function render($_renderer = '') $mpdf->Output($tmpFile, 'F'); $stream = fopen($tmpFile, 'rb'); - $path = sprintf('documents/%s.pdf', $this->_documentHash); + $path = \sprintf('documents/%s.pdf', $this->_documentHash); $filesystem = Shopware()->Container()->get('shopware.filesystem.private'); $filesystem->putStream($path, $stream); diff --git a/engine/Shopware/Components/Emotion/ComponentInstaller.php b/engine/Shopware/Components/Emotion/ComponentInstaller.php index 95dd44190b5..3eedca5f117 100644 --- a/engine/Shopware/Components/Emotion/ComponentInstaller.php +++ b/engine/Shopware/Components/Emotion/ComponentInstaller.php @@ -1,4 +1,5 @@ findOneBy(['name' => $pluginName]); if (!$plugin) { - throw new Exception(sprintf('Plugin by name %s not found', $pluginName)); + throw new Exception(\sprintf('Plugin by name %s not found', $pluginName)); } $repo = $this->em->getRepository(Component::class); diff --git a/engine/Shopware/Components/Emotion/EmotionComponentViewSubscriber.php b/engine/Shopware/Components/Emotion/EmotionComponentViewSubscriber.php index 389cac75edc..0289b966822 100644 --- a/engine/Shopware/Components/Emotion/EmotionComponentViewSubscriber.php +++ b/engine/Shopware/Components/Emotion/EmotionComponentViewSubscriber.php @@ -1,4 +1,5 @@ rootDirectory . '/files/downloads/' . $name . time() . '.zip'; if ($zip->open($filename, ZipArchive::CREATE) !== true) { - throw new Exception(sprintf('Could not create zip file "%s"!', $filename)); + throw new Exception(\sprintf('Could not create zip file "%s"!', $filename)); } $emotionData = $this->transformer->transform($emotionId, true); @@ -147,7 +148,7 @@ public function export($emotionId) $zip->addFromString('emotion.json', json_encode($exportData, JSON_THROW_ON_ERROR)); if (!$zip->close()) { - throw new Exception(sprintf('Could not close zip file "%s"!', $filename)); + throw new Exception(\sprintf('Could not close zip file "%s"!', $filename)); } $this->presetResource->delete($preset->getId()); diff --git a/engine/Shopware/Components/Emotion/EmotionExporterInterface.php b/engine/Shopware/Components/Emotion/EmotionExporterInterface.php index 8942fe863e4..096c56972e8 100644 --- a/engine/Shopware/Components/Emotion/EmotionExporterInterface.php +++ b/engine/Shopware/Components/Emotion/EmotionExporterInterface.php @@ -1,4 +1,5 @@ open($filePath) !== true) { - throw new EmotionImportException(sprintf('Could not open zip file "%s"!', $filePath)); + throw new EmotionImportException(\sprintf('Could not open zip file "%s"!', $filePath)); } if ($zip->locateName('emotion.json') === false) { - throw new EmotionImportException(sprintf('Missing emotion.json in %s!', $filePath)); + throw new EmotionImportException(\sprintf('Missing emotion.json in %s!', $filePath)); } if ($zip->extractTo($extractPath) !== true) { - throw new EmotionImportException(sprintf('Could not extract zip file %s to %s!', $filePath, $extractPath)); + throw new EmotionImportException(\sprintf('Could not extract zip file %s to %s!', $filePath, $extractPath)); } $zip->close(); @@ -168,12 +169,12 @@ private function checkRequiredPlugins(array $requiredPlugins) || !$plugin['installed'] || version_compare($plugin['currentVersion'], $requiredPlugin['version'], '<') ) { - $missingPlugins[] = sprintf('%s (%s)', $requiredPlugin['name'], $requiredPlugin['version']); + $missingPlugins[] = \sprintf('%s (%s)', $requiredPlugin['name'], $requiredPlugin['version']); } } if ($missingPlugins) { - throw new EmotionImportException(sprintf('The following plugins are required to use this shopping world:
%s', implode('
', $missingPlugins))); + throw new EmotionImportException(\sprintf('The following plugins are required to use this shopping world:
%s', implode('
', $missingPlugins))); } } diff --git a/engine/Shopware/Components/Emotion/EmotionImporterInterface.php b/engine/Shopware/Components/Emotion/EmotionImporterInterface.php index 401d5c6e38e..71fb8e9daff 100644 --- a/engine/Shopware/Components/Emotion/EmotionImporterInterface.php +++ b/engine/Shopware/Components/Emotion/EmotionImporterInterface.php @@ -1,4 +1,5 @@ getPresetData(), true); if (!$presetData || !\is_array($presetData) || !\array_key_exists('elements', $presetData)) { - throw new PresetAssetImportException(sprintf('The preset data of the %s preset seems to be invalid.', $preset->getName())); + throw new PresetAssetImportException(\sprintf('The preset data of the %s preset seems to be invalid.', $preset->getName())); } // continue if no sync data present or we just have an assets key which is empty diff --git a/engine/Shopware/Components/Emotion/Preset/PresetDataSynchronizerInterface.php b/engine/Shopware/Components/Emotion/Preset/PresetDataSynchronizerInterface.php index 99c91bfa8c7..cc3cfdbe89e 100644 --- a/engine/Shopware/Components/Emotion/Preset/PresetDataSynchronizerInterface.php +++ b/engine/Shopware/Components/Emotion/Preset/PresetDataSynchronizerInterface.php @@ -1,4 +1,5 @@ + * @var ArrayCollection */ protected $elements; @@ -69,7 +70,7 @@ public function getAttributes() } /** - * @param ArrayCollection<\Shopware\Components\Form\Interfaces\Element> $elements + * @param ArrayCollection $elements */ public function setElements($elements) { @@ -77,7 +78,7 @@ public function setElements($elements) } /** - * @return ArrayCollection<\Shopware\Components\Form\Interfaces\Element> + * @return ArrayCollection */ public function getElements() { diff --git a/engine/Shopware/Components/Form/Container/FieldSet.php b/engine/Shopware/Components/Form/Container/FieldSet.php index 2bdc9ada407..f05308e1140 100644 --- a/engine/Shopware/Components/Form/Container/FieldSet.php +++ b/engine/Shopware/Components/Form/Container/FieldSet.php @@ -1,4 +1,5 @@ name) { - throw new Exception(sprintf('Field %s requires a configured name', \get_class($this))); + throw new Exception(\sprintf('Field %s requires a configured name', \get_class($this))); } } } diff --git a/engine/Shopware/Components/Form/Field/Boolean.php b/engine/Shopware/Components/Form/Field/Boolean.php index 6e6b49c85b5..fab73a1f2db 100644 --- a/engine/Shopware/Components/Form/Field/Boolean.php +++ b/engine/Shopware/Components/Form/Field/Boolean.php @@ -1,4 +1,5 @@ store) { - throw new Exception(sprintf('Field %s requires a configured store', $this->name)); + throw new Exception(\sprintf('Field %s requires a configured store', $this->name)); } } } diff --git a/engine/Shopware/Components/Form/Field/Text.php b/engine/Shopware/Components/Form/Field/Text.php index 47ec6870969..f33e7cbdce6 100644 --- a/engine/Shopware/Components/Form/Field/Text.php +++ b/engine/Shopware/Components/Form/Field/Text.php @@ -1,4 +1,5 @@ $elements + * @param ArrayCollection $elements */ public function setElements($elements); /** * Returns all elements of this container. * - * @return ArrayCollection<\Shopware\Components\Form\Interfaces\Element> + * @return ArrayCollection */ public function getElements(); diff --git a/engine/Shopware/Components/Form/Interfaces/Element.php b/engine/Shopware/Components/Form/Interfaces/Element.php index ea45eec9928..d740204ca12 100644 --- a/engine/Shopware/Components/Form/Interfaces/Element.php +++ b/engine/Shopware/Components/Form/Interfaces/Element.php @@ -1,4 +1,5 @@ save($key, json_encode($content))) { - throw new RuntimeException(sprintf('Could not write cacheKey "%s"', $key)); + throw new RuntimeException(\sprintf('Could not write cacheKey "%s"', $key)); } } @@ -265,7 +266,7 @@ private function verifyIgnoredParameters(Request $request) /** * Normalize URL to consistently return the same path even when variables are present */ - $uri = sprintf( + $uri = \sprintf( '%s%s%s', $request->getSchemeAndHttpHost(), $path, diff --git a/engine/Shopware/Components/HttpCache/UrlProvider/BlogProvider.php b/engine/Shopware/Components/HttpCache/UrlProvider/BlogProvider.php index a1ced3aae6e..6cc53e04f9d 100644 --- a/engine/Shopware/Components/HttpCache/UrlProvider/BlogProvider.php +++ b/engine/Shopware/Components/HttpCache/UrlProvider/BlogProvider.php @@ -1,4 +1,5 @@ prepareSubQuery()->getSQL()) ) ->where('blog.active = 1'); diff --git a/engine/Shopware/Components/HttpCache/UrlProvider/CategoryProvider.php b/engine/Shopware/Components/HttpCache/UrlProvider/CategoryProvider.php index 77560829b8c..a141a421a33 100644 --- a/engine/Shopware/Components/HttpCache/UrlProvider/CategoryProvider.php +++ b/engine/Shopware/Components/HttpCache/UrlProvider/CategoryProvider.php @@ -1,4 +1,5 @@ leftJoin('emo_cat', 's_categories', 'cat', 'emo_cat.category_id = cat.id') ->where('emo.active = 1') - ->andWhere(sprintf('emo_cat.category_id IN (%s)', $this->prepareSubQuery()->getSQL())) + ->andWhere(\sprintf('emo_cat.category_id IN (%s)', $this->prepareSubQuery()->getSQL())) ->andWhere('emo.valid_to > NOW() OR emo.valid_to IS NULL'); } diff --git a/engine/Shopware/Components/HttpCache/UrlProvider/FormProvider.php b/engine/Shopware/Components/HttpCache/UrlProvider/FormProvider.php index 53f9630fae5..93f9d157135 100644 --- a/engine/Shopware/Components/HttpCache/UrlProvider/FormProvider.php +++ b/engine/Shopware/Components/HttpCache/UrlProvider/FormProvider.php @@ -1,4 +1,5 @@ where(sprintf('article.id IN (%s)', $this->prepareSubQuery()->getSQL())) + ->where(\sprintf('article.id IN (%s)', $this->prepareSubQuery()->getSQL())) ->groupBy('details.ordernumber') ->orderBy('details.ordernumber', 'ASC') ->setParameter(':shop', $context->getShopId()); @@ -92,7 +93,7 @@ public function getCount(Context $context) { return (int) $this->getBaseQuery() ->addSelect(['COUNT(DISTINCT details.ordernumber)']) - ->where(sprintf('article.id IN (%s)', $this->prepareSubQuery()->getSQL())) + ->where(\sprintf('article.id IN (%s)', $this->prepareSubQuery()->getSQL())) ->setParameter(':shop', $context->getShopId()) ->execute() ->fetchColumn(); diff --git a/engine/Shopware/Components/HttpCache/UrlProviderFactory.php b/engine/Shopware/Components/HttpCache/UrlProviderFactory.php index 324b2ce96aa..a4e299d59f8 100644 --- a/engine/Shopware/Components/HttpCache/UrlProviderFactory.php +++ b/engine/Shopware/Components/HttpCache/UrlProviderFactory.php @@ -1,4 +1,5 @@ connection->query(sprintf('use `%s`', $dbName)); + $this->connection->query(\sprintf('use `%s`', $dbName)); if (($contents = file_get_contents($file)) === false) { - throw new Exception(sprintf('Could not open file: %s', $file)); + throw new Exception(\sprintf('Could not open file: %s', $file)); } $rows = explode(";\n", trim($contents)); @@ -69,7 +70,7 @@ public function setupShop($url, $dbName) { $parts = parse_url($url); if ($parts === false || !\array_key_exists('host', $parts) || !\array_key_exists('scheme', $parts)) { - throw new InvalidArgumentException(sprintf('Invalid Shop URL (%s)', $url)); + throw new InvalidArgumentException(\sprintf('Invalid Shop URL (%s)', $url)); } $isSecure = $parts['scheme'] === 'https'; @@ -86,7 +87,7 @@ public function setupShop($url, $dbName) $path = '/' . $path; } - $this->connection->query(sprintf('use `%s`', $dbName)); + $this->connection->query(\sprintf('use `%s`', $dbName)); $stmt = $this->connection->prepare('UPDATE `s_core_shops` SET `host` = :host, `base_path` = :path, `secure` = :isSecure WHERE `main_id` IS NULL'); $stmt->execute([ @@ -101,7 +102,7 @@ public function setupShop($url, $dbName) */ public function emptyDatabase($dbName) { - $this->connection->query(sprintf('use `%s`', $dbName)); + $this->connection->query(\sprintf('use `%s`', $dbName)); $sql = <<<'SQL' SET FOREIGN_KEY_CHECKS = 0; @@ -130,7 +131,7 @@ public function emptyDatabase($dbName) public function dropDatabase($dbName) { $this->connection->exec( - sprintf( + \sprintf( 'DROP DATABASE IF EXISTS `%s`', $dbName ) @@ -145,14 +146,14 @@ public function dropDatabase($dbName) public function createDatabase($dbName) { $this->connection->exec( - sprintf( + \sprintf( 'CREATE DATABASE `%s`', $dbName ) ); $this->connection->exec( - sprintf( + \sprintf( 'ALTER DATABASE `%s` DEFAULT CHARACTER SET = utf8 COLLATE = utf8_unicode_ci;', $dbName ) diff --git a/engine/Shopware/Components/LastArticlesSubscriber.php b/engine/Shopware/Components/LastArticlesSubscriber.php index 55f4b59fb7f..1407e2f6bbc 100644 --- a/engine/Shopware/Components/LastArticlesSubscriber.php +++ b/engine/Shopware/Components/LastArticlesSubscriber.php @@ -1,4 +1,5 @@ host)); + throw new LicenseHostException(new LicenseInformation($info), \sprintf('License key is not valid for domain %s', $request->host)); } $info['edition'] = $info['product']; diff --git a/engine/Shopware/Components/License/Struct/LicenseInformation.php b/engine/Shopware/Components/License/Struct/LicenseInformation.php index 466f546a6d9..466df2db293 100644 --- a/engine/Shopware/Components/License/Struct/LicenseInformation.php +++ b/engine/Shopware/Components/License/Struct/LicenseInformation.php @@ -1,4 +1,5 @@ markMigrationAsFailed($migration, $e); - throw new Exception(sprintf('Could not apply migration (%s). Error: %s ', \get_class($migration), $e->getMessage())); + throw new Exception(\sprintf('Could not apply migration (%s). Error: %s ', \get_class($migration), $e->getMessage())); } $this->markMigrationAsFinished($migration); @@ -235,14 +235,14 @@ public function run($modus = AbstractMigration::MODUS_INSTALL) $this->createSchemaTable(); $currentVersion = $this->getCurrentVersion(); - $this->log(sprintf('Current MigrationNumber: %s', $currentVersion)); + $this->log(\sprintf('Current MigrationNumber: %s', $currentVersion)); $migrations = $this->getMigrationsForVersion($currentVersion); - $this->log(sprintf('Found %s migrations to apply', \count($migrations))); + $this->log(\sprintf('Found %s migrations to apply', \count($migrations))); foreach ($migrations as $migration) { - $this->log(sprintf('Apply MigrationNumber: %s - %s', $migration->getVersion(), $migration->getLabel())); + $this->log(\sprintf('Apply MigrationNumber: %s - %s', $migration->getVersion(), $migration->getLabel())); try { $this->apply($migration, $modus); } catch (Exception $e) { @@ -264,7 +264,7 @@ protected function loadMigration(array $result, string $migrationPath): Abstract /** @var AbstractMigration $migrationClass */ $migrationClass = new $migrationClassName($this->getConnection()); } catch (Exception $e) { - throw new RuntimeException(sprintf('Could not instantiate Object of class "%s"', $migrationClassName)); + throw new RuntimeException(\sprintf('Could not instantiate Object of class "%s"', $migrationClassName)); } $this->validateMigration($migrationClass, $result); @@ -308,7 +308,7 @@ protected function validateMigration(AbstractMigration $migrationClass, $result) $version = (int) $result['0']; if ($migrationClass->getVersion() !== $version) { - throw new Exception(sprintf('Version mismatch. Version in filename: %s, Version in Class: %s', $result['1'], $migrationClass->getVersion())); + throw new Exception(\sprintf('Version mismatch. Version in filename: %s, Version in Class: %s', $result['1'], $migrationClass->getVersion())); } } } diff --git a/engine/Shopware/Components/Migrations/PluginMigrationManager.php b/engine/Shopware/Components/Migrations/PluginMigrationManager.php index 7775f134855..a9cc74af26f 100644 --- a/engine/Shopware/Components/Migrations/PluginMigrationManager.php +++ b/engine/Shopware/Components/Migrations/PluginMigrationManager.php @@ -135,14 +135,14 @@ public function run($modus = AbstractMigration::MODUS_INSTALL, bool $keepUserDat } $currentVersion = $this->getCurrentVersion(); - $this->log(sprintf('Current MigrationNumber: %s', $currentVersion)); + $this->log(\sprintf('Current MigrationNumber: %s', $currentVersion)); $migrations = $this->getMigrationsForDowngrade($currentVersion); - $this->log(sprintf('Found %s migrations to apply', \count($migrations))); + $this->log(\sprintf('Found %s migrations to apply', \count($migrations))); foreach ($migrations as $migration) { - $this->log(sprintf('Revert MigrationNumber: %s - %s', $migration->getVersion(), $migration->getLabel())); + $this->log(\sprintf('Revert MigrationNumber: %s - %s', $migration->getVersion(), $migration->getLabel())); try { $this->apply($migration, $modus, $keepUserData); } catch (Exception $e) { @@ -154,12 +154,12 @@ public function run($modus = AbstractMigration::MODUS_INSTALL, bool $keepUserDat public function log($str): void { - $this->logger->info(sprintf('[Migration from %s] %s', $this->plugin->getName(), $str)); + $this->logger->info(\sprintf('[Migration from %s] %s', $this->plugin->getName(), $str)); } protected function loadMigration(array $result, string $migrationPath): AbstractMigration { - $migrationClassName = sprintf('%s\\Migrations\\Migration%d', $this->plugin->getName(), $result['1']); + $migrationClassName = \sprintf('%s\\Migrations\\Migration%d', $this->plugin->getName(), $result['1']); if (!class_exists($migrationClassName, false)) { $file = $migrationPath . '/' . $result['0']; require $file; @@ -232,7 +232,7 @@ private function downMigration(AbstractMigration $migration, bool $keepUserData) } catch (Exception $e) { $this->markMigrationAsFailed($migration, $e); - throw new RuntimeException(sprintf('Could not revert migration (%s). Error: %s ', \get_class($migration), $e->getMessage())); + throw new RuntimeException(\sprintf('Could not revert migration (%s). Error: %s ', \get_class($migration), $e->getMessage())); } $this->removeMigration($migration); diff --git a/engine/Shopware/Components/Model/Cache.php b/engine/Shopware/Components/Model/Cache.php index 4b0b4a57d32..e4260f124f1 100644 --- a/engine/Shopware/Components/Model/Cache.php +++ b/engine/Shopware/Components/Model/Cache.php @@ -1,4 +1,5 @@ getPath() . $className . '.php'; if (file_exists($file) && !is_writable($file)) { - throw new Exception(sprintf('File: "%s" isn\'t writable, please check the file permissions for this model!', $file), 501); + throw new Exception(\sprintf('File: "%s" isn\'t writable, please check the file permissions for this model!', $file), 501); } $result = file_put_contents($file, $sourceCode); @@ -433,10 +434,10 @@ protected function createTargetDirectory($dir) { if (!is_dir($dir)) { if (@mkdir($dir, 0777, true) === false && !is_dir($dir)) { - throw new RuntimeException(sprintf("Unable to create directory (%s)\n", $dir)); + throw new RuntimeException(\sprintf("Unable to create directory (%s)\n", $dir)); } } elseif (!is_writable($dir)) { - throw new RuntimeException(sprintf("Unable to write in directory (%s)\n", $dir)); + throw new RuntimeException(\sprintf("Unable to write in directory (%s)\n", $dir)); } } diff --git a/engine/Shopware/Components/Model/LazyFetchModelEntity.php b/engine/Shopware/Components/Model/LazyFetchModelEntity.php index 773e9e63904..7b39294ffd1 100644 --- a/engine/Shopware/Components/Model/LazyFetchModelEntity.php +++ b/engine/Shopware/Components/Model/LazyFetchModelEntity.php @@ -1,4 +1,5 @@ fieldMappings as $field => $mapping) { if (!($metadata->reflFields[$field] instanceof ReflectionProperty)) { - throw new InvalidArgumentException(sprintf('Expected an instance of %s', ReflectionProperty::class)); + throw new InvalidArgumentException(\sprintf('Expected an instance of %s', ReflectionProperty::class)); } $data[$field] = $metadata->reflFields[$field]->getValue($entity); @@ -350,7 +351,7 @@ protected function serializeEntity($entity) foreach ($metadata->associationMappings as $field => $mapping) { if (!($metadata->reflFields[$field] instanceof ReflectionProperty)) { - throw new InvalidArgumentException(sprintf('Expected an instance of %s', ReflectionProperty::class)); + throw new InvalidArgumentException(\sprintf('Expected an instance of %s', ReflectionProperty::class)); } $key = $inflector->tableize($field); diff --git a/engine/Shopware/Components/Model/ModelRepository.php b/engine/Shopware/Components/Model/ModelRepository.php index 90391e0faaf..042b51c0bbf 100644 --- a/engine/Shopware/Components/Model/ModelRepository.php +++ b/engine/Shopware/Components/Model/ModelRepository.php @@ -1,4 +1,5 @@ getParameters(); @@ -118,7 +119,7 @@ public function setParameters($parameters) */ public function addParameters(array $parameters) { - trigger_error(sprintf('%s::%s() is deprecated. Please use addParameter().', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s::%s() is deprecated. Please use addParameter().', __CLASS__, __METHOD__), E_USER_DEPRECATED); $existingParameters = $this->getParameters(); $newParameters = new ArrayCollection(); diff --git a/engine/Shopware/Components/Model/QueryOperatorValidator.php b/engine/Shopware/Components/Model/QueryOperatorValidator.php index 6669e6b5168..6cba40b7b4c 100644 --- a/engine/Shopware/Components/Model/QueryOperatorValidator.php +++ b/engine/Shopware/Components/Model/QueryOperatorValidator.php @@ -1,4 +1,5 @@ $word) { $conditions[] = $field . ' LIKE :phrase' . $index; - $select[] = sprintf(' IF(%s LIKE %s, %s, 0) ', $field, ':phrase' . $index, $ranking * 0.5); - $select[] = sprintf(' IF(%s = %s, %s, 0) ', $field, ':match' . $index, $ranking); + $select[] = \sprintf(' IF(%s LIKE %s, %s, 0) ', $field, ':phrase' . $index, $ranking * 0.5); + $select[] = \sprintf(' IF(%s = %s, %s, 0) ', $field, ':match' . $index, $ranking); } - $select[] = sprintf(' IF(%s = :full, %s, 0) ', $field, $ranking * 2); + $select[] = \sprintf(' IF(%s = :full, %s, 0) ', $field, $ranking * 2); } foreach ($terms as $index => $word) { diff --git a/engine/Shopware/Components/MultiEdit/Resource/Product.php b/engine/Shopware/Components/MultiEdit/Resource/Product.php index b62be6e27f9..e1ee4c4a27b 100644 --- a/engine/Shopware/Components/MultiEdit/Resource/Product.php +++ b/engine/Shopware/Components/MultiEdit/Resource/Product.php @@ -1,4 +1,5 @@ backupPath)) { - throw new RuntimeException(sprintf('Could not find nor create "%s"', $this->backupPath)); + throw new RuntimeException(\sprintf('Could not find nor create "%s"', $this->backupPath)); } } } @@ -232,7 +233,7 @@ public function restore($id, $offset = 0) $backup = $entityManager->find(BackupModel::class, $id); if (!$backup instanceof BackupModel) { - throw new RuntimeException(sprintf('Backup by id %d not found', $id)); + throw new RuntimeException(\sprintf('Backup by id %d not found', $id)); } $path = $backup->getPath(); @@ -306,7 +307,7 @@ public function delete($id) $backup = $entityManager->find(BackupModel::class, $id); if (!$backup) { - throw new RuntimeException(sprintf('Backup by id %d not found', $id)); + throw new RuntimeException(\sprintf('Backup by id %d not found', $id)); } $dir = \dirname($backup->getPath()); @@ -459,7 +460,7 @@ protected function getPrefixFromTable($table) $prefix = $this->affectedTables[$table]['prefix']; if (!$prefix) { - throw new RuntimeException(sprintf('Empty prefix for %s', $table)); + throw new RuntimeException(\sprintf('Empty prefix for %s', $table)); } return $prefix; @@ -477,7 +478,7 @@ protected function getAffectedColumns($table) $columns = $this->affectedTables[$table]['columns']; if (!$columns) { - throw new RuntimeException(sprintf('Empty column for %s', $table)); + throw new RuntimeException(\sprintf('Empty column for %s', $table)); } return $columns; @@ -548,7 +549,7 @@ protected function dumpTable($table, $name, $ids, $newBackup) $fileHandle = fopen($outFileData, 'w'); if (!\is_resource($fileHandle)) { - throw new RuntimeException(sprintf('Could not open stream at "%s"', $outFileData)); + throw new RuntimeException(\sprintf('Could not open stream at "%s"', $outFileData)); } $columns = $this->getAffectedColumns($table); @@ -654,7 +655,7 @@ protected function createZip($name) $zip = new ZipArchive(); if ($zip->open($zipPath, ZipArchive::CREATE) !== true) { - throw new RuntimeException(sprintf('Could not open %s, please check the permissions.', $zipPath)); + throw new RuntimeException(\sprintf('Could not open %s, please check the permissions.', $zipPath)); } $files = $this->getDirectoryList($this->outputPath); @@ -699,7 +700,7 @@ private function extractedFilesFromZip(string $path, string $dir): void $zip->open($path); $success = $zip->extractTo($dir); if (!$success) { - throw new RuntimeException(sprintf('Could not extract %s to %s', $path, $dir)); + throw new RuntimeException(\sprintf('Could not extract %s to %s', $path, $dir)); } $zip->close(); } diff --git a/engine/Shopware/Components/MultiEdit/Resource/Product/BatchProcess.php b/engine/Shopware/Components/MultiEdit/Resource/Product/BatchProcess.php index 572dc9b19c6..580f55b4a3e 100644 --- a/engine/Shopware/Components/MultiEdit/Resource/Product/BatchProcess.php +++ b/engine/Shopware/Components/MultiEdit/Resource/Product/BatchProcess.php @@ -1,4 +1,5 @@ find(Queue::class, $queueId); if (!$queue) { - throw new RuntimeException(sprintf('Queue with ID %s not found', $queueId)); + throw new RuntimeException(\sprintf('Queue with ID %s not found', $queueId)); } $operations = json_decode($queue->getOperations(), true); @@ -336,7 +337,7 @@ public function batchProcess($queueId) } } catch (Exception $e) { $connection->rollBack(); - throw new RuntimeException(sprintf('Error updating details: %s', $e->getMessage()), 0, $e); + throw new RuntimeException(\sprintf('Error updating details: %s', $e->getMessage()), 0, $e); } $remaining = $queue->getArticleDetails()->count(); diff --git a/engine/Shopware/Components/MultiEdit/Resource/Product/DqlHelper.php b/engine/Shopware/Components/MultiEdit/Resource/Product/DqlHelper.php index 0802b383ce8..fc6d8524580 100644 --- a/engine/Shopware/Components/MultiEdit/Resource/Product/DqlHelper.php +++ b/engine/Shopware/Components/MultiEdit/Resource/Product/DqlHelper.php @@ -1,4 +1,5 @@ getReturn(); } else { - throw new RuntimeException(sprintf('Column with type %s was not configured, yet', $type)); + throw new RuntimeException(\sprintf('Column with type %s was not configured, yet', $type)); } } } diff --git a/engine/Shopware/Components/MultiEdit/Resource/Product/Queue.php b/engine/Shopware/Components/MultiEdit/Resource/Product/Queue.php index f2b8049527c..44b42ea970e 100644 --- a/engine/Shopware/Components/MultiEdit/Resource/Product/Queue.php +++ b/engine/Shopware/Components/MultiEdit/Resource/Product/Queue.php @@ -1,4 +1,5 @@ find(QueueModel::class, $queueId); if (!$queue) { - throw new RuntimeException(sprintf('Queue with ID %s not found', $queueId)); + throw new RuntimeException(\sprintf('Queue with ID %s not found', $queueId)); } } else { $newBackup = true; diff --git a/engine/Shopware/Components/MultiEdit/Resource/Product/Value.php b/engine/Shopware/Components/MultiEdit/Resource/Product/Value.php index 7480813e0ff..477f4df8b01 100644 --- a/engine/Shopware/Components/MultiEdit/Resource/Product/Value.php +++ b/engine/Shopware/Components/MultiEdit/Resource/Product/Value.php @@ -1,4 +1,5 @@ connection->fetchColumn('SELECT number FROM s_order_number WHERE name = ? FOR UPDATE', [$name]); if ($number === false) { - throw new RuntimeException(sprintf('Number range with name "%s" does not exist.', $name)); + throw new RuntimeException(\sprintf('Number range with name "%s" does not exist.', $name)); } $this->connection->executeUpdate('UPDATE s_order_number SET number = number + 1 WHERE name = ?', [$name]); diff --git a/engine/Shopware/Components/NumberRangeIncrementerInterface.php b/engine/Shopware/Components/NumberRangeIncrementerInterface.php index 946eba4022e..1e56b00181b 100644 --- a/engine/Shopware/Components/NumberRangeIncrementerInterface.php +++ b/engine/Shopware/Components/NumberRangeIncrementerInterface.php @@ -1,4 +1,5 @@ publicKeyPath = $publicKey; @@ -85,7 +86,7 @@ public function isValid($message, $signature) } while ($errors[] = openssl_error_string()) { } - throw new RuntimeException(sprintf("Error during private key read: \n%s", implode("\n", $errors))); + throw new RuntimeException(\sprintf("Error during private key read: \n%s", implode("\n", $errors))); } /** @@ -103,7 +104,7 @@ private function getKeyResource() if ($keyResource === false) { while ($errors[] = openssl_error_string()) { } - throw new RuntimeException(sprintf("Error during public key read: \n%s", implode("\n", $errors))); + throw new RuntimeException(\sprintf("Error during public key read: \n%s", implode("\n", $errors))); } $this->keyResource = $keyResource; diff --git a/engine/Shopware/Components/OptinService.php b/engine/Shopware/Components/OptinService.php index 081cd9f8802..20f071dcef7 100644 --- a/engine/Shopware/Components/OptinService.php +++ b/engine/Shopware/Components/OptinService.php @@ -1,4 +1,5 @@ pattern, $orderNumber) === 0) { - throw new InvalidOrderNumberException(sprintf('Order number "%s" does not match pattern "%s"', $orderNumber, $this->pattern)); + throw new InvalidOrderNumberException(\sprintf('Order number "%s" does not match pattern "%s"', $orderNumber, $this->pattern)); } return true; diff --git a/engine/Shopware/Components/Password/Encoder/Argon2i.php b/engine/Shopware/Components/Password/Encoder/Argon2i.php index 599ba8e4e3a..d411f05fd8e 100644 --- a/engine/Shopware/Components/Password/Encoder/Argon2i.php +++ b/engine/Shopware/Components/Password/Encoder/Argon2i.php @@ -1,4 +1,5 @@ options); if (!\is_string($hash)) { - throw new DomainException(sprintf('Password could not be encoded by the encoder %s.', PASSWORD_ARGON2I)); + throw new DomainException(\sprintf('Password could not be encoded by the encoder %s.', PASSWORD_ARGON2I)); } return $hash; diff --git a/engine/Shopware/Components/Password/Encoder/Argon2id.php b/engine/Shopware/Components/Password/Encoder/Argon2id.php index a6645223fe4..a5b6cb132f9 100644 --- a/engine/Shopware/Components/Password/Encoder/Argon2id.php +++ b/engine/Shopware/Components/Password/Encoder/Argon2id.php @@ -1,4 +1,5 @@ options); if (!\is_string($hash)) { - throw new DomainException(sprintf('Password could not be encoded by the encoder %s.', $this->getName())); + throw new DomainException(\sprintf('Password could not be encoded by the encoder %s.', $this->getName())); } return $hash; diff --git a/engine/Shopware/Components/Password/Encoder/Bcrypt.php b/engine/Shopware/Components/Password/Encoder/Bcrypt.php index b158d159087..9b1cede4260 100644 --- a/engine/Shopware/Components/Password/Encoder/Bcrypt.php +++ b/engine/Shopware/Components/Password/Encoder/Bcrypt.php @@ -1,4 +1,5 @@ options); if (!\is_string($hash)) { - throw new DomainException(sprintf('Password could not be encoded by the encoder %s.', $this->getName())); + throw new DomainException(\sprintf('Password could not be encoded by the encoder %s.', $this->getName())); } return $hash; diff --git a/engine/Shopware/Components/Password/Encoder/LegacyBackendMd5.php b/engine/Shopware/Components/Password/Encoder/LegacyBackendMd5.php index 5f5d7119c2e..61710331210 100644 --- a/engine/Shopware/Components/Password/Encoder/LegacyBackendMd5.php +++ b/engine/Shopware/Components/Password/Encoder/LegacyBackendMd5.php @@ -1,4 +1,5 @@ getName())); + throw new DomainException(\sprintf('Invalid hash provided for the encoder %s.', $this->getName())); } list($iterations, $salt) = explode(self::DELIMITER, $hash); @@ -143,7 +144,7 @@ protected function generateInternal($password, $salt, $iterations) } if (!\is_string($hash)) { - throw new DomainException(sprintf('The password could not be hashed by %s.', $this->getName())); + throw new DomainException(\sprintf('The password could not be hashed by %s.', $this->getName())); } return $iterations . ':' . $salt . ':' . $hash; diff --git a/engine/Shopware/Components/Password/Manager.php b/engine/Shopware/Components/Password/Manager.php index c1401c603b1..c1800daa636 100644 --- a/engine/Shopware/Components/Password/Manager.php +++ b/engine/Shopware/Components/Password/Manager.php @@ -1,4 +1,5 @@ getName())); if (isset($this->encoder[$name])) { - throw new Exception(sprintf('Encoder by name %s already registered', $name)); + throw new Exception(\sprintf('Encoder by name %s already registered', $name)); } $this->encoder[$name] = $encoder; @@ -80,13 +81,13 @@ public function getEncoderByName($name) $name = strtolower(trim($name)); if (!isset($this->encoder[$name])) { - throw new DomainException(sprintf('Encoder by name %s not found', $name)); + throw new DomainException(\sprintf('Encoder by name %s not found', $name)); } $encoder = $this->encoder[$name]; if (method_exists($encoder, 'isCompatible') && !$encoder->isCompatible()) { - throw new Exception(sprintf('Encoder by name %s is not compatible with your system', $name)); + throw new Exception(\sprintf('Encoder by name %s is not compatible with your system', $name)); } return $encoder; @@ -166,7 +167,7 @@ public function encodePassword($password, $encoderName) $encodedPassword = $encoder->encodePassword($password); if (!\is_string($encodedPassword)) { - throw new DomainException(sprintf('The password could not be encoded by %s.', $encoderName)); + throw new DomainException(\sprintf('The password could not be encoded by %s.', $encoderName)); } return $encodedPassword; diff --git a/engine/Shopware/Components/Plugin.php b/engine/Shopware/Components/Plugin.php index 8b69adaa4cf..831a940b705 100644 --- a/engine/Shopware/Components/Plugin.php +++ b/engine/Shopware/Components/Plugin.php @@ -1,4 +1,5 @@ getContainerPrefix(), $key); + $parameterKey = \sprintf('shopware.filesystem.%s', $key); + $serviceId = \sprintf('%s.filesystem.%s', $this->getContainerPrefix(), $key); $filesystem = new Definition( PrefixFilesystem::class, diff --git a/engine/Shopware/Components/Plugin/Bootstrap.php b/engine/Shopware/Components/Plugin/Bootstrap.php index bad6a17c14d..ed3f82a52d1 100644 --- a/engine/Shopware/Components/Plugin/Bootstrap.php +++ b/engine/Shopware/Components/Plugin/Bootstrap.php @@ -1,4 +1,5 @@ Path() . 'Controllers/' . ucfirst($module) . '/' . ucfirst($controller) . '.php'; if (!file_exists($path)) { - throw new Enlight_Exception(sprintf('Controller "%s" can\'t load failure', $controller)); + throw new Enlight_Exception(\sprintf('Controller "%s" can\'t load failure', $controller)); } // register plugin model directory diff --git a/engine/Shopware/Components/Plugin/CachedConfigReader.php b/engine/Shopware/Components/Plugin/CachedConfigReader.php index 858f34f8a12..cb354ebf1a9 100644 --- a/engine/Shopware/Components/Plugin/CachedConfigReader.php +++ b/engine/Shopware/Components/Plugin/CachedConfigReader.php @@ -1,4 +1,5 @@ findOneBy(['name' => $pluginName]); if ($plugin === null) { - throw new WriterException(sprintf('Plugin by name "%s" not found.', $pluginName)); + throw new WriterException(\sprintf('Plugin by name "%s" not found.', $pluginName)); } /** @var Form|null $form */ $form = $formRepository->findOneBy(['pluginId' => $plugin->getId()]); if ($form === null) { - throw new WriterException(sprintf('Plugin form by plugin id "%u" not found.', $plugin->getId())); + throw new WriterException(\sprintf('Plugin form by plugin id "%u" not found.', $plugin->getId())); } $parentValues = $this->getParent()->readValues($pluginName, $shopId); @@ -151,11 +151,11 @@ public function writeValue(?int $shopId, Form $form, string $name, $value, $pare /** @var Element|null $element */ $element = $elementRepository->findOneBy(['form' => $form, 'name' => $name]); if ($element === null) { - throw new WriterException(sprintf('Config element "%s" not found.', $name)); + throw new WriterException(\sprintf('Config element "%s" not found.', $name)); } if ($shopId !== 1 && $element->getScope() === 0) { - $message = sprintf("Element '%s' is not writeable for shop %u", $element->getName(), $shopId); + $message = \sprintf("Element '%s' is not writeable for shop %u", $element->getName(), $shopId); $baseException = new InvalidArgumentException($message); throw new WriterException('Element is not valid', 0, $baseException); } diff --git a/engine/Shopware/Components/Plugin/Configuration/Layers/ConfigurationLayerInterface.php b/engine/Shopware/Components/Plugin/Configuration/Layers/ConfigurationLayerInterface.php index 63b936ab2cf..489d1259cf9 100644 --- a/engine/Shopware/Components/Plugin/Configuration/Layers/ConfigurationLayerInterface.php +++ b/engine/Shopware/Components/Plugin/Configuration/Layers/ConfigurationLayerInterface.php @@ -1,4 +1,5 @@ menuRepository->findOneBy($menuItem['parent']); if (!$parent) { - throw new InvalidArgumentException(sprintf('Unable to find parent for query %s', print_r($menuItem['parent'], true))); + throw new InvalidArgumentException(\sprintf('Unable to find parent for query %s', print_r($menuItem['parent'], true))); } } diff --git a/engine/Shopware/Components/Plugin/Namespace.php b/engine/Shopware/Components/Plugin/Namespace.php index 7594dde5a30..70aa4640d54 100644 --- a/engine/Shopware/Components/Plugin/Namespace.php +++ b/engine/Shopware/Components/Plugin/Namespace.php @@ -1,4 +1,5 @@ namespace->get('shopware_version_blacklisted'), $shopwareVersion)); + throw new Exception(\sprintf($this->namespace->get('shopware_version_blacklisted'), $shopwareVersion)); } if (isset($compatibility['minVersion'])) { $min = $compatibility['minVersion']; if ($min !== '' && !$this->assertVersion($shopwareVersion, $min, '>=')) { - throw new Exception(sprintf($this->namespace->get('plugin_min_shopware_version'), $min)); + throw new Exception(\sprintf($this->namespace->get('plugin_min_shopware_version'), $min)); } } if (isset($compatibility['maxVersion'])) { $max = $compatibility['maxVersion']; if ($max !== '' && !$this->assertVersion($shopwareVersion, $max, '<=')) { - throw new Exception(sprintf($this->namespace->get('plugin_max_shopware_version'), $max)); + throw new Exception(\sprintf($this->namespace->get('plugin_max_shopware_version'), $max)); } } } @@ -124,32 +125,32 @@ private function assertRequiredPlugins(array $requiredPlugins): void ]); if (!$plugin) { - throw new Exception(sprintf($this->namespace->get('required_plugin_not_found'), $requiredPlugin['pluginName'])); + throw new Exception(\sprintf($this->namespace->get('required_plugin_not_found'), $requiredPlugin['pluginName'])); } if ($plugin->getInstalled() === null) { - throw new Exception(sprintf($this->namespace->get('required_plugin_not_installed'), $requiredPlugin['pluginName'])); + throw new Exception(\sprintf($this->namespace->get('required_plugin_not_installed'), $requiredPlugin['pluginName'])); } if (!$plugin->getActive()) { - throw new Exception(sprintf($this->namespace->get('required_plugin_not_active'), $requiredPlugin['pluginName'])); + throw new Exception(\sprintf($this->namespace->get('required_plugin_not_active'), $requiredPlugin['pluginName'])); } if (isset($requiredPlugin['blacklist']) && \in_array($plugin->getVersion(), $requiredPlugin['blacklist'])) { - throw new Exception(sprintf($this->namespace->get('required_plugin_blacklisted'), $plugin->getName(), $plugin->getVersion())); + throw new Exception(\sprintf($this->namespace->get('required_plugin_blacklisted'), $plugin->getName(), $plugin->getVersion())); } if (isset($requiredPlugin['minVersion'])) { $min = $requiredPlugin['minVersion']; if ($min !== '' && !$this->assertVersion($plugin->getVersion(), $min, '>=')) { - throw new Exception(sprintf($this->namespace->get('plugin_version_required'), $min, $plugin->getName())); + throw new Exception(\sprintf($this->namespace->get('plugin_version_required'), $min, $plugin->getName())); } } if (isset($requiredPlugin['maxVersion'])) { $max = $requiredPlugin['maxVersion']; if ($max !== '' && !$this->assertVersion($plugin->getVersion(), $max, '<=')) { - throw new Exception(sprintf($this->namespace->get('plugin_version_max'), $plugin->getName(), $max)); + throw new Exception(\sprintf($this->namespace->get('plugin_version_max'), $plugin->getName(), $max)); } } } diff --git a/engine/Shopware/Components/Plugin/ResourceSubscriber.php b/engine/Shopware/Components/Plugin/ResourceSubscriber.php index cb214827709..68bdad0894e 100644 --- a/engine/Shopware/Components/Plugin/ResourceSubscriber.php +++ b/engine/Shopware/Components/Plugin/ResourceSubscriber.php @@ -1,4 +1,5 @@ getMessage()), $e->getCode(), $e); + throw new InvalidArgumentException(\sprintf('Unable to parse file "%s". Message: %s', $file, $e->getMessage()), $e->getCode(), $e); } return $this->parseInfo($dom); diff --git a/engine/Shopware/Components/Plugin/XmlReader/StoreValueParser/StoreExtjsValueParser.php b/engine/Shopware/Components/Plugin/XmlReader/StoreValueParser/StoreExtjsValueParser.php index 5522cf49e8c..d8a067e0e92 100644 --- a/engine/Shopware/Components/Plugin/XmlReader/StoreValueParser/StoreExtjsValueParser.php +++ b/engine/Shopware/Components/Plugin/XmlReader/StoreValueParser/StoreExtjsValueParser.php @@ -1,4 +1,5 @@ query('//entries/entry'); if (!$entries instanceof DOMNodeList || $entries->length === 0) { - throw new RuntimeException(sprintf('Required element "entry" is missing in file "%s".', static::$xmlFile)); + throw new RuntimeException(\sprintf('Required element "entry" is missing in file "%s".', static::$xmlFile)); } $menu = []; diff --git a/engine/Shopware/Components/Plugin/XmlReader/XmlPluginReader.php b/engine/Shopware/Components/Plugin/XmlReader/XmlPluginReader.php index a46859dbe6d..79cf200c289 100644 --- a/engine/Shopware/Components/Plugin/XmlReader/XmlPluginReader.php +++ b/engine/Shopware/Components/Plugin/XmlReader/XmlPluginReader.php @@ -1,4 +1,5 @@ query('//plugin/compatibility'); if ($compatibility instanceof DOMNodeList) { if (\count($compatibility) > 1) { - throw new InvalidArgumentException(sprintf('Element with name "compatibility" found multiple times in file "%s", but expected to be there only once', static::$xmlFile)); + throw new InvalidArgumentException(\sprintf('Element with name "compatibility" found multiple times in file "%s", but expected to be there only once', static::$xmlFile)); } $compatibility = $compatibility->item(0); if ($compatibility instanceof DOMNode) { diff --git a/engine/Shopware/Components/Plugin/XmlReader/XmlReaderBase.php b/engine/Shopware/Components/Plugin/XmlReader/XmlReaderBase.php index f103a95cbbd..b04316a530e 100644 --- a/engine/Shopware/Components/Plugin/XmlReader/XmlReaderBase.php +++ b/engine/Shopware/Components/Plugin/XmlReader/XmlReaderBase.php @@ -1,4 +1,5 @@ xsdFile); } catch (Exception $e) { - throw new InvalidArgumentException(sprintf('Unable to parse file "%s". Message: %s', $xmlFile, $e->getMessage()), $e->getCode(), $e); + throw new InvalidArgumentException(\sprintf('Unable to parse file "%s". Message: %s', $xmlFile, $e->getMessage()), $e->getCode(), $e); } return $this->parseFile($dom); @@ -73,7 +74,7 @@ public static function parseTranslatableNodeList(DOMNodeList $list): ?array foreach ($list as $item) { $language = $item->getAttribute('lang') ?: self::DEFAULT_LANG; if (!\is_string($language)) { - throw new RuntimeException(sprintf('Attribute "lang" needs to be a string in file "%s"', static::$xmlFile)); + throw new RuntimeException(\sprintf('Attribute "lang" needs to be a string in file "%s"', static::$xmlFile)); } // XSD Requires en-GB, Zend uses en_GB @@ -101,7 +102,7 @@ public static function parseTranslatableElement(DOMNode $element, string $name): foreach ($list as $item) { $language = $item->getAttribute('lang') ?: self::DEFAULT_LANG; if (!\is_string($language)) { - throw new RuntimeException(sprintf('Attribute "lang" needs to be a string in file "%s"', static::$xmlFile)); + throw new RuntimeException(\sprintf('Attribute "lang" needs to be a string in file "%s"', static::$xmlFile)); } // XSD Requires en-GB, Zend uses en_GB @@ -200,12 +201,12 @@ public static function getElementChildValueByName(DOMElement $element, string $n $children = self::getChildren($element, $name); if (\count($children) > 1) { - throw new InvalidArgumentException(sprintf('Element with name "%s" found multiple times in file "%s", but expected to be there only once', $name, static::$xmlFile)); + throw new InvalidArgumentException(\sprintf('Element with name "%s" found multiple times in file "%s", but expected to be there only once', $name, static::$xmlFile)); } if (\count($children) === 0) { if ($throwException) { - throw new InvalidArgumentException(sprintf('Element with name "%s" not found in file "%s"', $name, static::$xmlFile)); + throw new InvalidArgumentException(\sprintf('Element with name "%s" not found in file "%s"', $name, static::$xmlFile)); } return null; diff --git a/engine/Shopware/Components/Plugin/XmlReader/XmlReaderInterface.php b/engine/Shopware/Components/Plugin/XmlReader/XmlReaderInterface.php index 7fb56c329dc..f4d24f73d6a 100644 --- a/engine/Shopware/Components/Plugin/XmlReader/XmlReaderInterface.php +++ b/engine/Shopware/Components/Plugin/XmlReader/XmlReaderInterface.php @@ -1,4 +1,5 @@ modify(sprintf('-%d months', $months)) + ->modify(\sprintf('-%d months', $months)) ->format('Y-m-d H:i:s'); $query = <<<'SQL' @@ -63,7 +64,7 @@ public function cleanupGuestUsers($months) public function cleanupCanceledOrders($months) { $threshold = (new DateTime()) - ->modify(sprintf('-%d months', $months)) + ->modify(\sprintf('-%d months', $months)) ->format('Y-m-d H:i:s'); $query = <<<'SQL' diff --git a/engine/Shopware/Components/Privacy/PrivacyServiceInterface.php b/engine/Shopware/Components/Privacy/PrivacyServiceInterface.php index 7a9bdd41541..413c3c3f10e 100644 --- a/engine/Shopware/Components/Privacy/PrivacyServiceInterface.php +++ b/engine/Shopware/Components/Privacy/PrivacyServiceInterface.php @@ -1,4 +1,5 @@ isOptional()) { - throw new RuntimeException(sprintf('Required constructor parameter missing: "$%s".', $paramName)); + throw new RuntimeException(\sprintf('Required constructor parameter missing: "$%s".', $paramName)); } $newParams[] = $constructorParam->getDefaultValue(); @@ -122,7 +123,7 @@ private function verifyClass(ReflectionClass $class, string $docPath, array $dir // Trying to execute a class outside the Shopware DocumentRoot if ($fileDir !== $docPath) { - throw new InvalidArgumentException(sprintf('Class "%s" out of scope', $class->getFileName()), 1); + throw new InvalidArgumentException(\sprintf('Class "%s" out of scope', $class->getFileName()), 1); } $fileName = substr($fileName, \strlen($docPath)); @@ -143,13 +144,13 @@ private function verifyClass(ReflectionClass $class, string $docPath, array $dir } if ($error) { - throw new InvalidArgumentException(sprintf('Class "%s" out of scope', $class->getFileName()), 2); + throw new InvalidArgumentException(\sprintf('Class "%s" out of scope', $class->getFileName()), 2); } $className = $class->getName(); $classImplements = class_implements($className); if (!\is_array($classImplements) || !\array_key_exists(ReflectionAwareInterface::class, $classImplements)) { - throw new InvalidArgumentException(sprintf('Class %s has to implement the interface %s', $className, ReflectionAwareInterface::class)); + throw new InvalidArgumentException(\sprintf('Class %s has to implement the interface %s', $className, ReflectionAwareInterface::class)); } } } diff --git a/engine/Shopware/Components/Register/OptinCleanupService.php b/engine/Shopware/Components/Register/OptinCleanupService.php index 9aaa67fddf2..2b558e0edc2 100644 --- a/engine/Shopware/Components/Register/OptinCleanupService.php +++ b/engine/Shopware/Components/Register/OptinCleanupService.php @@ -1,4 +1,5 @@ $value) { if (\is_object($value)) { - trigger_error(sprintf('Using objects as params in %s:%s is deprecated since Shopware 5.6 and will result in an exception with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('Using objects as params in %s:%s is deprecated since Shopware 5.6 and will result in an exception with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); } $route[] = $key; diff --git a/engine/Shopware/Components/Routing/Generators/RewriteGenerator.php b/engine/Shopware/Components/Routing/Generators/RewriteGenerator.php index fb2103a417d..dc0be022181 100644 --- a/engine/Shopware/Components/Routing/Generators/RewriteGenerator.php +++ b/engine/Shopware/Components/Routing/Generators/RewriteGenerator.php @@ -1,4 +1,5 @@ getAttribute(PDO::ATTR_ERRMODE) !== PDO::ERRMODE_EXCEPTION) { - throw new InvalidArgumentException(sprintf('"%s" requires PDO error mode attribute be set to throw Exceptions (i.e. $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION))', __CLASS__)); + throw new InvalidArgumentException(\sprintf('"%s" requires PDO error mode attribute be set to throw Exceptions (i.e. $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION))', __CLASS__)); } $this->pdo = $pdoOrDsn; @@ -251,7 +252,7 @@ public function createTable() $sql = "CREATE TABLE $this->table ($this->idCol VARCHAR(128) NOT NULL PRIMARY KEY, $this->dataCol VARBINARY(MAX) NOT NULL, $this->expiryCol INTEGER NOT NULL, $this->timeCol INTEGER NOT NULL)"; break; default: - throw new DomainException(sprintf('Creating the session table is currently not implemented for PDO driver "%s".', $this->driver)); + throw new DomainException(\sprintf('Creating the session table is currently not implemented for PDO driver "%s".', $this->driver)); } try { @@ -659,7 +660,7 @@ private function doAdvisoryLock($sessionId) case 'sqlite': throw new DomainException('SQLite does not support advisory locks.'); default: - throw new DomainException(sprintf('Advisory locks are currently not implemented for PDO driver "%s".', $this->driver)); + throw new DomainException(\sprintf('Advisory locks are currently not implemented for PDO driver "%s".', $this->driver)); } } @@ -686,7 +687,7 @@ private function getSelectSql() // we already locked when starting transaction break; default: - throw new DomainException(sprintf('Transactional locks are currently not implemented for PDO driver "%s".', $this->driver)); + throw new DomainException(\sprintf('Transactional locks are currently not implemented for PDO driver "%s".', $this->driver)); } } diff --git a/engine/Shopware/Components/ShopRegistrationService.php b/engine/Shopware/Components/ShopRegistrationService.php index 48624958402..c673791e942 100644 --- a/engine/Shopware/Components/ShopRegistrationService.php +++ b/engine/Shopware/Components/ShopRegistrationService.php @@ -1,4 +1,5 @@ getVersion() === 3) { $this->registerTheme($template); } else { - throw new RuntimeException(sprintf('Tried to load unsupported template version %s for template: %s', $template->getVersion(), $template->getName())); + throw new RuntimeException(\sprintf('Tried to load unsupported template version %s for template: %s', $template->getVersion(), $template->getName())); } $this->container->get(Enlight_Template_Manager::class)->setCompileId( - sprintf('frontend_%s_%s_%s', $template->toString(), $localeName, $shop->getId()) + \sprintf('frontend_%s_%s_%s', $template->toString(), $localeName, $shop->getId()) ); } diff --git a/engine/Shopware/Components/ShopRegistrationServiceInterface.php b/engine/Shopware/Components/ShopRegistrationServiceInterface.php index 8d8b5f897bc..ab5fa415905 100644 --- a/engine/Shopware/Components/ShopRegistrationServiceInterface.php +++ b/engine/Shopware/Components/ShopRegistrationServiceInterface.php @@ -1,4 +1,5 @@ em->getRepository('Shopware\Models\Shop\Locale')->findOneByLocale($localeName); if (!$locale) { - throw new Exception(sprintf('Locale "%s" not found.', $localeName)); + throw new Exception(\sprintf('Locale "%s" not found.', $localeName)); } $outputAdapter = new Enlight_Config_Adapter_File([ diff --git a/engine/Shopware/Components/Snippet/DbAdapter.php b/engine/Shopware/Components/Snippet/DbAdapter.php index ba6d8dcf96b..45917a844a5 100644 --- a/engine/Shopware/Components/Snippet/DbAdapter.php +++ b/engine/Shopware/Components/Snippet/DbAdapter.php @@ -1,4 +1,5 @@ getRealPath() . ')'; } elseif ($diffGroups) { - $invalidSnippets[] = sprintf( + $invalidSnippets[] = \sprintf( 'Invalid snippet group(s): %s (%s)', implode(', ', $diffGroups), $entry->getRealPath() diff --git a/engine/Shopware/Components/Snippet/Writer/DatabaseWriter.php b/engine/Shopware/Components/Snippet/Writer/DatabaseWriter.php index 07c86e52c1b..17e2567e542 100644 --- a/engine/Shopware/Components/Snippet/Writer/DatabaseWriter.php +++ b/engine/Shopware/Components/Snippet/Writer/DatabaseWriter.php @@ -1,4 +1,5 @@ db->commit(); } catch (Exception $e) { $this->db->rollBack(); - throw new Exception(sprintf('An error occurred when importing namespace "%s" for locale "%s"', $namespace, $localeId), 0, $e); + throw new Exception(\sprintf('An error occurred when importing namespace "%s" for locale "%s"', $namespace, $localeId), 0, $e); } } diff --git a/engine/Shopware/Components/Snippet/Writer/QueryWriter.php b/engine/Shopware/Components/Snippet/Writer/QueryWriter.php index 188d01bde21..e2562c280a2 100644 --- a/engine/Shopware/Components/Snippet/Writer/QueryWriter.php +++ b/engine/Shopware/Components/Snippet/Writer/QueryWriter.php @@ -1,4 +1,5 @@ availableTypes[$type])) { - throw new RuntimeException(sprintf('Invalid type \'%s\' given.', $type)); + throw new RuntimeException(\sprintf('Invalid type \'%s\' given.', $type)); } $namespace = $this->availableTypes[$type]; diff --git a/engine/Shopware/Components/StateTranslatorServiceInterface.php b/engine/Shopware/Components/StateTranslatorServiceInterface.php index 739d8cdf369..eda1484c1b8 100644 --- a/engine/Shopware/Components/StateTranslatorServiceInterface.php +++ b/engine/Shopware/Components/StateTranslatorServiceInterface.php @@ -1,4 +1,5 @@ allowedProtocols, true)) { - throw new InvalidArgumentException(sprintf("Invalid stream protocol '%s'", $urlArray['scheme'])); + throw new InvalidArgumentException(\sprintf("Invalid stream protocol '%s'", $urlArray['scheme'])); } return true; diff --git a/engine/Shopware/Components/StreamProtocolValidatorInterface.php b/engine/Shopware/Components/StreamProtocolValidatorInterface.php index fa3cca416e3..b811490ff41 100644 --- a/engine/Shopware/Components/StreamProtocolValidatorInterface.php +++ b/engine/Shopware/Components/StreamProtocolValidatorInterface.php @@ -1,4 +1,5 @@ $modelName] ); if (!$mailModel instanceof Mail) { - throw new Enlight_Exception(sprintf('Mail-Template with name "%s" could not be found.', $modelName)); + throw new Enlight_Exception(\sprintf('Mail-Template with name "%s" could not be found.', $modelName)); } } diff --git a/engine/Shopware/Components/Theme.php b/engine/Shopware/Components/Theme.php index d7551abeb3d..48305e36cba 100644 --- a/engine/Shopware/Components/Theme.php +++ b/engine/Shopware/Components/Theme.php @@ -1,4 +1,5 @@ values || !\is_array($this->values)) { - throw new Exception(sprintf('Config set %s defined without values array.', $this->name)); + throw new Exception(\sprintf('Config set %s defined without values array.', $this->name)); } } } diff --git a/engine/Shopware/Components/Theme/Configuration.php b/engine/Shopware/Components/Theme/Configuration.php index 58c1eb296a6..1e8d99b6941 100644 --- a/engine/Shopware/Components/Theme/Configuration.php +++ b/engine/Shopware/Components/Theme/Configuration.php @@ -1,4 +1,5 @@ getTemplate($theme); if (!$template instanceof Template) { - $this->logger->error(sprintf('Could not synchronize theme. "%s" instance for theme "%s" not found', Template::class, $theme->getName())); + $this->logger->error(\sprintf('Could not synchronize theme. "%s" instance for theme "%s" not found', Template::class, $theme->getName())); return; } @@ -205,7 +206,7 @@ private function synchronizeSets(Theme $theme, Template $template): void // Iterates all configurations sets of the file system foreach ($collection as $item) { if (!$item instanceof ConfigSet) { - throw new Exception(sprintf("Theme %s adds a configuration set which isn't an instance of Shopware\Components\Theme\ConfigSet.", $theme->getTemplate())); + throw new Exception(\sprintf("Theme %s adds a configuration set which isn't an instance of Shopware\Components\Theme\ConfigSet.", $theme->getTemplate())); } $item->validate(); diff --git a/engine/Shopware/Components/Theme/DBALTimestampPersistor.php b/engine/Shopware/Components/Theme/DBALTimestampPersistor.php index b8f1cda1563..6f7321154bc 100644 --- a/engine/Shopware/Components/Theme/DBALTimestampPersistor.php +++ b/engine/Shopware/Components/Theme/DBALTimestampPersistor.php @@ -1,4 +1,5 @@ pathResolver->getFrontendThemeDirectory())) { - throw new Exception(sprintf('Theme directory %s isn\'t writable', $this->pathResolver->getFrontendThemeDirectory())); + throw new Exception(\sprintf('Theme directory %s isn\'t writable', $this->pathResolver->getFrontendThemeDirectory())); } if (!isset($data['template']) || empty($data['template'])) { throw new Exception('Passed data array contains no valid theme name under the array key "template".'); diff --git a/engine/Shopware/Components/Theme/Inheritance.php b/engine/Shopware/Components/Theme/Inheritance.php index 81496994f75..e6e346fc8e3 100644 --- a/engine/Shopware/Components/Theme/Inheritance.php +++ b/engine/Shopware/Components/Theme/Inheritance.php @@ -1,4 +1,5 @@ $theme->getTemplate(), ]); if (!$template instanceof Template) { - throw new Exception(sprintf('Template of theme %s not found', $theme->getTemplate())); + throw new Exception(\sprintf('Template of theme %s not found', $theme->getTemplate())); } $parent = $this->repository->findOneBy([ 'template' => $theme->getExtend(), ]); if (!$parent instanceof Template) { - throw new Exception(sprintf('Parent %s of theme %s not found', $theme->getExtend(), $theme->getTemplate())); + throw new Exception(\sprintf('Parent %s of theme %s not found', $theme->getExtend(), $theme->getTemplate())); } $template->setParent($parent); diff --git a/engine/Shopware/Components/Theme/JavascriptCollector.php b/engine/Shopware/Components/Theme/JavascriptCollector.php index ce72c723ebe..e0015656e84 100644 --- a/engine/Shopware/Components/Theme/JavascriptCollector.php +++ b/engine/Shopware/Components/Theme/JavascriptCollector.php @@ -1,4 +1,5 @@ getPathname() . DIRECTORY_SEPARATOR . 'Theme.php'; if (!file_exists($file)) { - throw new Exception(sprintf('Theme directory %s contains no Theme.php', $directory->getPathname())); + throw new Exception(\sprintf('Theme directory %s contains no Theme.php', $directory->getPathname())); } require_once $file; if (!class_exists($class)) { - throw new Exception(sprintf('Theme file %s contains unexpected class %s', $file, $class)); + throw new Exception(\sprintf('Theme file %s contains unexpected class %s', $file, $class)); } return new $class(); diff --git a/engine/Shopware/Components/Thumbnail/Generator/Basic.php b/engine/Shopware/Components/Thumbnail/Generator/Basic.php index 6c794a7f382..70f64939a05 100644 --- a/engine/Shopware/Components/Thumbnail/Generator/Basic.php +++ b/engine/Shopware/Components/Thumbnail/Generator/Basic.php @@ -1,4 +1,5 @@ mediaService->has($imagePath)) { - throw new RuntimeException(sprintf('File not found: %s', $imagePath)); + throw new RuntimeException(\sprintf('File not found: %s', $imagePath)); } $content = $this->mediaService->read($imagePath); if (!\is_string($content)) { - throw new RuntimeException(sprintf('Could not read image from file: %s', $imagePath)); + throw new RuntimeException(\sprintf('Could not read image from file: %s', $imagePath)); } $image = $this->createImageResource($content, $imagePath); @@ -129,7 +130,7 @@ private function createImageResource(string $fileContent, string $imagePath) { $image = imagecreatefromstring($fileContent); if ($image === false) { - throw new RuntimeException(sprintf('Image is not in a recognized format (%s)', $imagePath)); + throw new RuntimeException(\sprintf('Image is not in a recognized format (%s)', $imagePath)); } return $image; @@ -301,12 +302,12 @@ private function downloadImage(string $destination): string } $handle = fopen($tmpFilename, 'wb'); if (!\is_resource($handle)) { - throw new RuntimeException(sprintf('Could not open file at: %s', $tmpFilename)); + throw new RuntimeException(\sprintf('Could not open file at: %s', $tmpFilename)); } $fromHandle = $this->mediaService->readStream($destination); if (!\is_resource($fromHandle)) { - throw new RuntimeException(sprintf('Could not open file at: %s', $destination)); + throw new RuntimeException(\sprintf('Could not open file at: %s', $destination)); } stream_copy_to_stream( $fromHandle, @@ -320,7 +321,7 @@ private function uploadImage(string $destination, string $tmpFilename): void { $fileHandle = fopen($tmpFilename, 'rb'); if (!\is_resource($fileHandle)) { - throw new RuntimeException(sprintf('Could not open file at: %s', $tmpFilename)); + throw new RuntimeException(\sprintf('Could not open file at: %s', $tmpFilename)); } $this->mediaService->writeStream($destination, $fileHandle); fclose($fileHandle); diff --git a/engine/Shopware/Components/Thumbnail/Generator/GeneratorInterface.php b/engine/Shopware/Components/Thumbnail/Generator/GeneratorInterface.php index ff9f94d4682..d236e074ab1 100644 --- a/engine/Shopware/Components/Thumbnail/Generator/GeneratorInterface.php +++ b/engine/Shopware/Components/Thumbnail/Generator/GeneratorInterface.php @@ -1,4 +1,5 @@ getPath(); if ($media->getType() !== $media::TYPE_IMAGE) { - throw new Exception(sprintf('File %s is not an image.', $imagePath)); + throw new Exception(\sprintf('File %s is not an image.', $imagePath)); } if (empty($thumbnailSizes)) { diff --git a/engine/Shopware/Components/Translation.php b/engine/Shopware/Components/Translation.php index a0850afc688..eb2ec439c08 100644 --- a/engine/Shopware/Components/Translation.php +++ b/engine/Shopware/Components/Translation.php @@ -1,4 +1,5 @@ ]*?>!', ' ', $text); diff --git a/engine/Shopware/Components/Translation/ObjectTranslator.php b/engine/Shopware/Components/Translation/ObjectTranslator.php index 19990721265..e79e21db701 100644 --- a/engine/Shopware/Components/Translation/ObjectTranslator.php +++ b/engine/Shopware/Components/Translation/ObjectTranslator.php @@ -1,4 +1,5 @@ getViolations() instanceof ConstraintViolationListInterface) { $errors = []; foreach ($exception->getViolations() as $violation) { - $errors[] = sprintf( + $errors[] = \sprintf( '%s: %s', $violation->getPropertyPath(), $violation->getMessage() diff --git a/engine/Shopware/Controllers/Api/GenerateArticleImages.php b/engine/Shopware/Controllers/Api/GenerateArticleImages.php index 088e1c82368..b180636dd5f 100644 --- a/engine/Shopware/Controllers/Api/GenerateArticleImages.php +++ b/engine/Shopware/Controllers/Api/GenerateArticleImages.php @@ -1,4 +1,5 @@ resource->getRepository()->find($id); if (!$product) { - throw new ApiException\NotFoundException(sprintf('Product by id %d not found', $id)); + throw new ApiException\NotFoundException(\sprintf('Product by id %d not found', $id)); } $this->resource->generateImages($product, (bool) $request->getParam('force', 0)); diff --git a/engine/Shopware/Controllers/Api/Manufacturers.php b/engine/Shopware/Controllers/Api/Manufacturers.php index 9ddef8777b9..efaad3206aa 100644 --- a/engine/Shopware/Controllers/Api/Manufacturers.php +++ b/engine/Shopware/Controllers/Api/Manufacturers.php @@ -1,4 +1,5 @@ getClientOriginalName(); if ($file->getError() !== UPLOAD_ERR_OK) { - throw new Exception(sprintf('Could not upload file "%s"', $file->getClientOriginalName())); + throw new Exception(\sprintf('Could not upload file "%s"', $file->getClientOriginalName())); } // use custom name if provided diff --git a/engine/Shopware/Controllers/Api/Orders.php b/engine/Shopware/Controllers/Api/Orders.php index fe538b266e1..c41a53d0a85 100644 --- a/engine/Shopware/Controllers/Api/Orders.php +++ b/engine/Shopware/Controllers/Api/Orders.php @@ -1,4 +1,5 @@ getManager()->flush(); if (!method_exists($model, 'getId')) { - throw new RuntimeException(sprintf('Model "%s" has no "getId" method', $this->model)); + throw new RuntimeException(\sprintf('Model "%s" has no "getId" method', $this->model)); } $detail = $this->getDetail($model->getId()); diff --git a/engine/Shopware/Controllers/Backend/Article.php b/engine/Shopware/Controllers/Backend/Article.php index 81a134cb8e9..ee8d6644c8f 100644 --- a/engine/Shopware/Controllers/Backend/Article.php +++ b/engine/Shopware/Controllers/Backend/Article.php @@ -1,4 +1,5 @@ getConfiguratorSet(); if (!$configuratorSet instanceof Set) { - throw new Exception(sprintf('Should not happen. The product with the given ID "%s" must be a variant product at this point.', $productId)); + throw new Exception(\sprintf('Should not happen. The product with the given ID "%s" must be a variant product at this point.', $productId)); } $dependencies = $this->getRepository()->getConfiguratorDependenciesQuery($configuratorSet->getId())->getArrayResult(); $priceVariations = $this->getRepository()->getConfiguratorPriceVariationsQuery($configuratorSet->getId())->getArrayResult(); @@ -1683,7 +1684,7 @@ public function createEsdAction() if (!$variant) { $this->View()->assign([ 'success' => false, - 'message' => sprintf('Product variant by id %s not found', $variantId), + 'message' => \sprintf('Product variant by id %s not found', $variantId), ]); return; @@ -1712,7 +1713,7 @@ public function saveEsdAction() if (!$esd) { $this->View()->assign([ 'success' => false, - 'message' => sprintf('ESD by id %s not found', $esdId), + 'message' => \sprintf('ESD by id %s not found', $esdId), ]); return; @@ -1851,7 +1852,7 @@ public function saveSerialsAction() if (!$esd) { $this->View()->assign([ 'success' => false, - 'message' => sprintf('ESD by id %s not found', $esdId), + 'message' => \sprintf('ESD by id %s not found', $esdId), ]); return; @@ -2001,7 +2002,7 @@ public function uploadEsdFileAction() $filePath = (string) $file->getRealPath(); $upstream = fopen($filePath, 'rb'); if (!\is_resource($upstream)) { - throw new RuntimeException(sprintf('Could not open file at: %s', $filePath)); + throw new RuntimeException(\sprintf('Could not open file at: %s', $filePath)); } $filesystem->writeStream($destinationPath, $upstream); fclose($upstream); @@ -2040,7 +2041,7 @@ public function getEsdDownloadAction() $response = $this->Response(); $response->headers->set('content-type', $mimeType); - $response->headers->set('content-disposition', sprintf('attachment; filename="%s"', basename($path))); + $response->headers->set('content-disposition', \sprintf('attachment; filename="%s"', basename($path))); $response->headers->set('content-length', $meta['size']); $response->headers->set('content-transfer-encoding', 'binary'); $response->sendHeaders(); @@ -2048,7 +2049,7 @@ public function getEsdDownloadAction() $upstream = $filesystem->readStream($path); if (!\is_resource($upstream)) { - throw new RuntimeException(sprintf('Could not open file from: %s', $path)); + throw new RuntimeException(\sprintf('Could not open file from: %s', $path)); } $downstream = fopen('php://output', 'wb'); if (!\is_resource($downstream)) { @@ -2079,7 +2080,7 @@ public function getChartData() $dateFormat = '%Y%m'; $limit = 12; - $sql = sprintf(" + $sql = \sprintf(" SELECT SUM(price*quantity) AS revenue, SUM(quantity) AS orders, @@ -2398,7 +2399,7 @@ protected function getConfiguratorDependencyRepository() */ protected function getConfiguratorGroupRepository() { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.8. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.8. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); if ($this->configuratorGroupRepository === null) { $this->configuratorGroupRepository = $this->get('models')->getRepository(Group::class); @@ -3338,15 +3339,15 @@ protected function prepareGeneratorData(array $groups, $offset, $limit) $selectSql = []; // We have remove the first group id, but we need the first id in the select, from and where path. - $selectSql[] = sprintf($selectTemplate, $firstId, $firstId, $firstId, $firstId, $firstId, $firstId, $firstId, $firstId, $firstId, $firstId, $firstId, $firstId); - $groupSql[] = sprintf($fromTemplate, $firstId, $firstId, $firstId, $firstId); - $whereSql = sprintf($whereTemplate, $firstId, $firstId, $firstId, implode(',', $first['options'])); + $selectSql[] = \sprintf($selectTemplate, $firstId, $firstId, $firstId, $firstId, $firstId, $firstId, $firstId, $firstId, $firstId, $firstId, $firstId, $firstId); + $groupSql[] = \sprintf($fromTemplate, $firstId, $firstId, $firstId, $firstId); + $whereSql = \sprintf($whereTemplate, $firstId, $firstId, $firstId, implode(',', $first['options'])); // Now we iterate all other groups, and create a select sql path and a cross join sql path. foreach ($activeGroups as $group) { $groupId = (int) $group['id']; - $selectSql[] = sprintf($selectTemplate, $groupId, $groupId, $groupId, $groupId, $groupId, $groupId, $groupId, $groupId, $groupId, $groupId, $groupId, $groupId); - $groupSql[] = sprintf($joinTemplate, $groupId, $groupId, $groupId, $groupId, implode(',', $group['options']), $groupId, $groupId, $groupId); + $selectSql[] = \sprintf($selectTemplate, $groupId, $groupId, $groupId, $groupId, $groupId, $groupId, $groupId, $groupId, $groupId, $groupId, $groupId, $groupId); + $groupSql[] = \sprintf($joinTemplate, $groupId, $groupId, $groupId, $groupId, implode(',', $group['options']), $groupId, $groupId, $groupId); } // Concat the sql statement @@ -3530,7 +3531,7 @@ protected function prepareVariantPrice($detailData, $priceVariations, $optionIds */ protected function getDependencyByOptionId($optionId, $dependencies) { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.8. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.8. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); $returnValue = []; foreach ($dependencies as $dependency) { @@ -4479,7 +4480,7 @@ protected function getCommandMapping($syntax) */ protected function getViolationFields($violations) { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.8. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.8. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); $fields = []; foreach ($violations as $violation) { diff --git a/engine/Shopware/Controllers/Backend/ArticleList.php b/engine/Shopware/Controllers/Backend/ArticleList.php index 4c004280917..70a095f2c55 100644 --- a/engine/Shopware/Controllers/Backend/ArticleList.php +++ b/engine/Shopware/Controllers/Backend/ArticleList.php @@ -1,4 +1,5 @@ Request()->getParam('offset', 0); $filterArray = json_decode($filterArray, true); if ($filterArray === false) { - throw new RuntimeException(sprintf('Could not decode "%s"', $this->Request()->getParam('filterArray'))); + throw new RuntimeException(\sprintf('Could not decode "%s"', $this->Request()->getParam('filterArray'))); } /** @var array|false $operations */ $operations = json_decode($operations, true); if ($operations === false) { - throw new RuntimeException(sprintf('Could not decode "%s"', $this->Request()->getParam('operations'))); + throw new RuntimeException(\sprintf('Could not decode "%s"', $this->Request()->getParam('operations'))); } /** @var ResourceInterface $resource */ diff --git a/engine/Shopware/Controllers/Backend/ArticlePriceVariation.php b/engine/Shopware/Controllers/Backend/ArticlePriceVariation.php index 659fa852ae7..2752add4903 100644 --- a/engine/Shopware/Controllers/Backend/ArticlePriceVariation.php +++ b/engine/Shopware/Controllers/Backend/ArticlePriceVariation.php @@ -1,4 +1,5 @@ categoryRepository === null) { $this->categoryRepository = $this->getManager()->getRepository(Category::class); @@ -98,7 +99,7 @@ public function getCategoryRepository() */ public function getArticleRepository() { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); if ($this->articleRepository === null) { $this->articleRepository = $this->getManager()->getRepository(Product::class); @@ -116,7 +117,7 @@ public function getArticleRepository() */ public function getRepository() { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); if ($this->blogRepository === null) { $this->blogRepository = $this->getManager()->getRepository(Blog::class); @@ -134,7 +135,7 @@ public function getRepository() */ public function getBlogCommentRepository() { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); if ($this->blogCommentRepository === null) { $this->blogCommentRepository = $this->getManager()->getRepository(Comment::class); diff --git a/engine/Shopware/Controllers/Backend/Cache.php b/engine/Shopware/Controllers/Backend/Cache.php index 1c4185c61b9..cc566264fd2 100644 --- a/engine/Shopware/Controllers/Backend/Cache.php +++ b/engine/Shopware/Controllers/Backend/Cache.php @@ -1,4 +1,5 @@ ', $parents = false) { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); if (empty($query)) { $where = 'parent=1'; diff --git a/engine/Shopware/Controllers/Backend/Config.php b/engine/Shopware/Controllers/Backend/Config.php index 921884c0c79..cd63a735c90 100644 --- a/engine/Shopware/Controllers/Backend/Config.php +++ b/engine/Shopware/Controllers/Backend/Config.php @@ -1,4 +1,5 @@ getRepository('shop'); if (!$shopRepository instanceof ShopRepository) { - throw new RuntimeException(sprintf('%s needed', ShopRepository::class)); + throw new RuntimeException(\sprintf('%s needed', ShopRepository::class)); } $elements = $this->Request()->getParam('elements'); @@ -562,7 +563,7 @@ public function saveValuesAction() switch ($name) { case 'tax': if (!$model instanceof Tax) { - throw new RuntimeException(sprintf('Model object is not an instance of expected class "%s"', Tax::class)); + throw new RuntimeException(\sprintf('Model object is not an instance of expected class "%s"', Tax::class)); } $this->saveTaxRules($data, $model); @@ -571,7 +572,7 @@ public function saveValuesAction() case 'customerGroup': if (isset($data['discounts'])) { if (!$model instanceof CustomerGroup) { - throw new RuntimeException(sprintf('Model object is not an instance of expected class "%s"', CustomerGroup::class)); + throw new RuntimeException(\sprintf('Model object is not an instance of expected class "%s"', CustomerGroup::class)); } $model->getDiscounts()->clear(); $manager->flush(); @@ -717,7 +718,7 @@ public function saveValuesAction() case 'document': if (!$model instanceof Document) { - throw new RuntimeException(sprintf('Model object is not an instance of expected class "%s"', Document::class)); + throw new RuntimeException(\sprintf('Model object is not an instance of expected class "%s"', Document::class)); } if (!empty($data['id'])) { @@ -998,7 +999,7 @@ protected function getRepository($name) $repository = DocumentElement::class; break; default: - throw new RuntimeException(sprintf('Repository with name "%s" not found', $name)); + throw new RuntimeException(\sprintf('Repository with name "%s" not found', $name)); } self::$repositories[$name] = $this->get('models')->getRepository($repository); } diff --git a/engine/Shopware/Controllers/Backend/CoreLicense.php b/engine/Shopware/Controllers/Backend/CoreLicense.php index 3d6b3f18f94..d4b0ab3a108 100644 --- a/engine/Shopware/Controllers/Backend/CoreLicense.php +++ b/engine/Shopware/Controllers/Backend/CoreLicense.php @@ -1,4 +1,5 @@ View()->assign([ 'success' => true, 'finish' => false, - 'text' => sprintf($snippets->get('refresh_stream'), $handled, $total), + 'text' => \sprintf($snippets->get('refresh_stream'), $handled, $total), 'progress' => $handled / $total, ]); } @@ -193,7 +193,7 @@ public function buildSearchIndexAction() 'success' => true, 'finish' => false, 'params' => ['lastId' => (int) array_pop($ids)], - 'text' => sprintf($snippets->get('refresh_customer'), $handled, $total), + 'text' => \sprintf($snippets->get('refresh_customer'), $handled, $total), 'progress' => $handled / $total, ]); } diff --git a/engine/Shopware/Controllers/Backend/Document.php b/engine/Shopware/Controllers/Backend/Document.php index 4f3f6398895..6960bd4c549 100644 --- a/engine/Shopware/Controllers/Backend/Document.php +++ b/engine/Shopware/Controllers/Backend/Document.php @@ -1,4 +1,5 @@ View()->assign([ 'success' => false, - 'message' => sprintf( + 'message' => \sprintf( 'Uploaded file %s is no zip file', $name ), @@ -343,19 +344,19 @@ public function uploadAction() return; } - $downloadPath = sprintf('%s%s', sys_get_temp_dir(), DIRECTORY_SEPARATOR); + $downloadPath = \sprintf('%s%s', sys_get_temp_dir(), DIRECTORY_SEPARATOR); if (!is_writable($downloadPath)) { $this->View()->assign([ 'success' => false, - 'error' => sprintf("Target Directory %s isn't writable", $downloadPath), + 'error' => \sprintf("Target Directory %s isn't writable", $downloadPath), ]); return; } - $tempFile = sprintf('%s%s', Random::getAlphanumericString(32), '.zip'); - $copyTo = sprintf('%s%s', $downloadPath, $tempFile); + $tempFile = \sprintf('%s%s', Random::getAlphanumericString(32), '.zip'); + $copyTo = \sprintf('%s%s', $downloadPath, $tempFile); $fileSystem->copy($file, $copyTo); $fileSystem->remove($file->getPathname()); @@ -373,7 +374,7 @@ public function uploadAction() */ public function importAction() { - $filePath = sprintf( + $filePath = \sprintf( '%s%s%s', sys_get_temp_dir(), DIRECTORY_SEPARATOR, @@ -407,7 +408,7 @@ public function afterImportAction() throw new InvalidArgumentException('File path can not be empty', 1); } - $filePath = sprintf( + $filePath = \sprintf( '%s%s%s', sys_get_temp_dir(), DIRECTORY_SEPARATOR, @@ -1384,7 +1385,7 @@ private function processDataFieldValue(Field $field, $value): ?string } if (\is_array($value)) { - throw new UnexpectedValueException(sprintf('Use field value type "%s" if arrays should be saved. Got value type "%s" instead', Field::VALUE_TYPE_JSON, $valueType)); + throw new UnexpectedValueException(\sprintf('Use field value type "%s" if arrays should be saved. Got value type "%s" instead', Field::VALUE_TYPE_JSON, $valueType)); } return $value; diff --git a/engine/Shopware/Controllers/Backend/EmotionPreset.php b/engine/Shopware/Controllers/Backend/EmotionPreset.php index 7f300c71e8c..cc484bf0caf 100644 --- a/engine/Shopware/Controllers/Backend/EmotionPreset.php +++ b/engine/Shopware/Controllers/Backend/EmotionPreset.php @@ -1,4 +1,5 @@ export->sSmarty = $this->View()->Engine(); diff --git a/engine/Shopware/Controllers/Backend/ExtJs.php b/engine/Shopware/Controllers/Backend/ExtJs.php index f272fb4f3f3..11e44516087 100644 --- a/engine/Shopware/Controllers/Backend/ExtJs.php +++ b/engine/Shopware/Controllers/Backend/ExtJs.php @@ -1,4 +1,5 @@ \n\"Logo\"
", $configValue ); @@ -199,7 +200,7 @@ public function saveConfigurationAction() if ($key === 'logo') { $hash = Random::getAlphanumericString(16); - $value = sprintf( + $value = \sprintf( '

', $hash, $hash, @@ -563,7 +564,7 @@ private function renderPayPalView(string $view): void $this->get('plugins')->Controller()->ViewRenderer()->setNoRender(false); $this->Front()->Plugins()->Json()->setRenderer(false); - $this->View()->loadTemplate(sprintf('backend/first_run_wizard/template/%s.tpl', $view)); + $this->View()->loadTemplate(\sprintf('backend/first_run_wizard/template/%s.tpl', $view)); } private function getVersion(): string diff --git a/engine/Shopware/Controllers/Backend/FirstRunWizardPluginManager.php b/engine/Shopware/Controllers/Backend/FirstRunWizardPluginManager.php index a50a46577e9..d596ab7bd1d 100644 --- a/engine/Shopware/Controllers/Backend/FirstRunWizardPluginManager.php +++ b/engine/Shopware/Controllers/Backend/FirstRunWizardPluginManager.php @@ -1,4 +1,5 @@ Request()->getParam('payPalPlus'); if (!class_exists('\SwagPaymentPayPalUnified\Setup\FirstRunWizardInstaller')) { - throw new Exception(sprintf('Class %s does not exist.', '\SwagPaymentPayPalUnified\Setup\FirstRunWizardInstaller')); + throw new Exception(\sprintf('Class %s does not exist.', '\SwagPaymentPayPalUnified\Setup\FirstRunWizardInstaller')); } $payPalInstaller = new FirstRunWizardInstaller(); diff --git a/engine/Shopware/Controllers/Backend/Form.php b/engine/Shopware/Controllers/Backend/Form.php index 7d9dcb89e6b..38127545086 100644 --- a/engine/Shopware/Controllers/Backend/Form.php +++ b/engine/Shopware/Controllers/Backend/Form.php @@ -1,4 +1,5 @@ forward('createLog', 'logger', 'backend'); } diff --git a/engine/Shopware/Controllers/Backend/Logger.php b/engine/Shopware/Controllers/Backend/Logger.php index cfa448f3e59..579e5ede66e 100644 --- a/engine/Shopware/Controllers/Backend/Logger.php +++ b/engine/Shopware/Controllers/Backend/Logger.php @@ -1,4 +1,5 @@ get(MediaServiceInterface::class); @set_time_limit(0); @@ -330,7 +331,7 @@ public function removeMediaAction() // Check if the media is loaded. if ($media === null || empty($media)) { - $this->View()->assign(['success' => false, 'message' => sprintf('Media with id %s not found', $id)]); + $this->View()->assign(['success' => false, 'message' => \sprintf('Media with id %s not found', $id)]); return; } @@ -818,7 +819,7 @@ private function getMediaThumbnailPaths(array $media): array // Iterate thumbnail sizes foreach ($sizes as $size) { if (strpos($size, 'x') === false) { - $size = sprintf('%sx%s', $size, $size); + $size = \sprintf('%sx%s', $size, $size); } $projectDir = $this->container->getParameter('shopware.app.rootDir'); diff --git a/engine/Shopware/Controllers/Backend/Newsletter.php b/engine/Shopware/Controllers/Backend/Newsletter.php index 51eb6a3606d..97cbd863447 100644 --- a/engine/Shopware/Controllers/Backend/Newsletter.php +++ b/engine/Shopware/Controllers/Backend/Newsletter.php @@ -1,4 +1,5 @@ campaignsRepository === null) { $this->campaignsRepository = $this->get('models')->getRepository(Newsletter::class); @@ -590,7 +591,7 @@ public function listSenderAction() */ public function getPreviewNewslettersQuery() { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); $builder = $this->get('models')->createQueryBuilder(); diff --git a/engine/Shopware/Controllers/Backend/Notification.php b/engine/Shopware/Controllers/Backend/Notification.php index 050270e38e4..0fd0f432c3f 100644 --- a/engine/Shopware/Controllers/Backend/Notification.php +++ b/engine/Shopware/Controllers/Backend/Notification.php @@ -1,4 +1,5 @@ getMailForOrder($order->getId(), $status->getId()); } catch (Exception $e) { - $warning = sprintf( + $warning = \sprintf( $namespace->get('warning/mail_creation_failed'), $status->getName(), $e->getMessage() @@ -898,7 +898,7 @@ public function batchProcessAction() $modelManager->flush($order); } catch (Exception $e) { $data['success'] = false; - $data['errorMessage'] = sprintf( + $data['errorMessage'] = \sprintf( $namespace->get('save_order_failed', 'Error when saving the order. Error: %s'), $e->getMessage() ); @@ -930,7 +930,7 @@ public function batchProcessAction() } catch (Exception $e) { $data['mail'] = null; $data['success'] = false; - $data['errorMessage'] = sprintf( + $data['errorMessage'] = \sprintf( $namespace->get('send_mail_failed', 'Error when sending mail. Error: %s'), $e->getMessage() ); @@ -984,7 +984,7 @@ public function mergeDocumentsAction() $models = $this->getOrderDocumentsQuery($data->orders, $data->docType)->getResult(); foreach ($models as $model) { foreach ($model->getDocuments() as $document) { - $file = $this->downloadFileFromFilesystem(sprintf('documents/%s.pdf', $document->getHash())); + $file = $this->downloadFileFromFilesystem(\sprintf('documents/%s.pdf', $document->getHash())); if ($file !== null) { $files[] = $file; } @@ -1109,7 +1109,7 @@ public function deleteDocumentAction() ->setParameter('documentId', $documentId) ->execute(); - $file = sprintf('documents/%s.pdf', $documentHash); + $file = \sprintf('documents/%s.pdf', $documentHash); if ($filesystem->has($file)) { $filesystem->delete($file); } @@ -1248,7 +1248,7 @@ public function createDocumentAction() public function openPdfAction() { $filesystem = $this->container->get('shopware.filesystem.private'); - $file = sprintf('documents/%s.pdf', basename($this->Request()->getParam('id'))); + $file = \sprintf('documents/%s.pdf', basename($this->Request()->getParam('id'))); if ($filesystem->has($file) === false) { $this->View()->assign([ @@ -1286,7 +1286,7 @@ public function openPdfAction() $this->View()->assign([ 'success' => false, 'data' => $this->Request()->getParams(), - 'message' => sprintf('Could not open file: %s', $file), + 'message' => \sprintf('Could not open file: %s', $file), ]); return; @@ -1436,7 +1436,7 @@ protected function getDispatchRepository() */ protected function getDocumentRepository() { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.8. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.8. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); if (self::$documentRepository === null) { self::$documentRepository = $this->getManager()->getRepository(Document::class); @@ -1812,7 +1812,7 @@ private function addAttachments(Enlight_Components_Mail $mail, int $orderId, arr $filesystem = $this->container->get('shopware.filesystem.private'); foreach ($attachments as $attachment) { - $filePath = sprintf('documents/%s.pdf', $attachment['hash']); + $filePath = \sprintf('documents/%s.pdf', $attachment['hash']); $fileName = $this->getFileName($orderId, (int) $attachment['type'][0]['id']); if ($filesystem->has($filePath) === false) { @@ -2313,7 +2313,7 @@ private function downloadFileFromFilesystem(string $path): ?string if (!\is_resource($source)) { $this->View()->assign([ 'success' => false, - 'message' => sprintf('Could not read from path: %s', $path), + 'message' => \sprintf('Could not read from path: %s', $path), ]); return null; @@ -2322,7 +2322,7 @@ private function downloadFileFromFilesystem(string $path): ?string if (!\is_resource($downstream)) { $this->View()->assign([ 'success' => false, - 'message' => sprintf('Could not read from path: %s', $tmpFile), + 'message' => \sprintf('Could not read from path: %s', $tmpFile), ]); return null; diff --git a/engine/Shopware/Controllers/Backend/Overview.php b/engine/Shopware/Controllers/Backend/Overview.php index a41597b65e4..c2f64036db8 100644 --- a/engine/Shopware/Controllers/Backend/Overview.php +++ b/engine/Shopware/Controllers/Backend/Overview.php @@ -1,4 +1,5 @@ getNumber(), $customer->getFirstname() . ' ' . $customer->getLastname(), diff --git a/engine/Shopware/Controllers/Backend/Payment.php b/engine/Shopware/Controllers/Backend/Payment.php index ea97a088338..ee5398d0077 100644 --- a/engine/Shopware/Controllers/Backend/Payment.php +++ b/engine/Shopware/Controllers/Backend/Payment.php @@ -1,4 +1,5 @@ $value) { @@ -189,7 +190,7 @@ public function saveConfigData(array $data) */ public function prepareDataForSaving($data) { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); $output = []; $output['httpCache'] = $this->prepareHttpCacheConfigForSaving($data['httpCache'][0]); @@ -214,7 +215,7 @@ public function prepareDataForSaving($data) */ public function prepareForSavingDefault(array $data) { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); unset($data['id']); @@ -230,7 +231,7 @@ public function prepareForSavingDefault(array $data) */ public function prepareSeoConfigForSaving(array $data) { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); unset($data['id']); @@ -257,7 +258,7 @@ public function prepareSeoConfigForSaving(array $data) */ public function prepareHttpCacheConfigForSaving(array $data) { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); $modelManager = $this->container->get(ModelManager::class); $repo = $modelManager->getRepository(Plugin::class); @@ -309,7 +310,7 @@ function ($url) { */ public function saveConfig($name, $value) { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); $modelManager = $this->container->get(ModelManager::class); $shopRepository = $modelManager->getRepository(Shop::class); @@ -370,7 +371,7 @@ public function saveConfig($name, $value) */ public function readConfig($configName, $defaultValue = '') { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); // If we have a simple config item, we can return it by using Shopware()->Config() if (strpos($configName, ':') === false) { diff --git a/engine/Shopware/Controllers/Backend/PluginInstaller.php b/engine/Shopware/Controllers/Backend/PluginInstaller.php index eb659cffd86..41c170d9aea 100644 --- a/engine/Shopware/Controllers/Backend/PluginInstaller.php +++ b/engine/Shopware/Controllers/Backend/PluginInstaller.php @@ -1,4 +1,5 @@ View()->assign([ 'success' => false, - 'message' => sprintf('Plugin not found %s', $this->Request()->getParam('technicalName')), + 'message' => \sprintf('Plugin not found %s', $this->Request()->getParam('technicalName')), ]); return; @@ -226,7 +227,7 @@ public function uploadAction() if ($extension !== 'zip') { $this->View()->assign([ 'success' => false, - 'message' => sprintf('Wrong archive extension %s. Zip archive expected', $extension), + 'message' => \sprintf('Wrong archive extension %s. Zip archive expected', $extension), ]); unlink($file->getPathname()); diff --git a/engine/Shopware/Controllers/Backend/PluginManager.php b/engine/Shopware/Controllers/Backend/PluginManager.php index 5a20915cd4a..2d713417986 100644 --- a/engine/Shopware/Controllers/Backend/PluginManager.php +++ b/engine/Shopware/Controllers/Backend/PluginManager.php @@ -1,4 +1,5 @@ getHash() . '_' . $productFeed->getFileName(); diff --git a/engine/Shopware/Controllers/Backend/Property.php b/engine/Shopware/Controllers/Backend/Property.php index 981c045e159..2318d86f838 100644 --- a/engine/Shopware/Controllers/Backend/Property.php +++ b/engine/Shopware/Controllers/Backend/Property.php @@ -1,4 +1,5 @@ false, - 'message' => sprintf("Destination directory '%s' does not exist.", $destPath), + 'message' => \sprintf("Destination directory '%s' does not exist.", $destPath), ]); return; @@ -424,7 +425,7 @@ public function importSnippetAction() if (!is_writable($destPath)) { echo json_encode([ 'success' => false, - 'message' => sprintf("Destination directory '%s' does not have write permissions.", $destPath), + 'message' => \sprintf("Destination directory '%s' does not have write permissions.", $destPath), ]); return; @@ -434,7 +435,7 @@ public function importSnippetAction() if ($filePath === false) { echo json_encode([ 'success' => false, - 'message' => sprintf('Could not create a tmp file for %s', $filePath), + 'message' => \sprintf('Could not create a tmp file for %s', $filePath), ]); return; @@ -443,7 +444,7 @@ public function importSnippetAction() if (move_uploaded_file($_FILES['file']['tmp_name'], $filePath) === false) { echo json_encode([ 'success' => false, - 'message' => sprintf('Could not move %s to %s.', $_FILES['file']['tmp_name'], $filePath), + 'message' => \sprintf('Could not move %s to %s.', $_FILES['file']['tmp_name'], $filePath), ]); return; @@ -618,7 +619,7 @@ public function exportSnippetAction() $value = $this->database->quote($row['value']); $value = str_replace("\n", '\\n', $value); - $rows[] = sprintf( + $rows[] = \sprintf( "(%s, %s, %s, '%s', '%s', '%s', NOW(), %d)", $this->database->quote($row['namespace']), $this->database->quote($row['name']), @@ -865,7 +866,7 @@ protected function toTree($item) */ protected function prefixProperties($properties = [], $prefix = '') { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.8. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.8. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); foreach ($properties as $key => $property) { if (isset($property['property'])) { diff --git a/engine/Shopware/Controllers/Backend/Supplier.php b/engine/Shopware/Controllers/Backend/Supplier.php index 6b634b698a8..0838ac2410c 100644 --- a/engine/Shopware/Controllers/Backend/Supplier.php +++ b/engine/Shopware/Controllers/Backend/Supplier.php @@ -1,4 +1,5 @@ Request()->getParam('filter'); $sort = $this->Request()->getParam('sort', [['property' => 'name']]); diff --git a/engine/Shopware/Controllers/Backend/Theme.php b/engine/Shopware/Controllers/Backend/Theme.php index 9d0e41933e4..0899ef72d6b 100644 --- a/engine/Shopware/Controllers/Backend/Theme.php +++ b/engine/Shopware/Controllers/Backend/Theme.php @@ -1,4 +1,5 @@ getRepository()->find($parentId); if (!$parent instanceof Template) { - throw new Exception(sprintf('Shop template by id %s not found', $parentId)); + throw new Exception(\sprintf('Shop template by id %s not found', $parentId)); } } @@ -249,14 +250,14 @@ public function uploadAction() $system->remove($file->getPathname()); - throw new Exception(sprintf('Uploaded file %s is no zip file', $name)); + throw new Exception(\sprintf('Uploaded file %s is no zip file', $name)); } $targetDirectory = $this->container->get(PathResolver::class)->getFrontendThemeDirectory(); if (!is_writable($targetDirectory)) { $this->View()->assign([ 'success' => false, - 'error' => sprintf("Target Directory %s isn't writable", $targetDirectory), + 'error' => \sprintf("Target Directory %s isn't writable", $targetDirectory), ]); return; diff --git a/engine/Shopware/Controllers/Backend/Translation.php b/engine/Shopware/Controllers/Backend/Translation.php index 604a401107e..9278a822a26 100644 --- a/engine/Shopware/Controllers/Backend/Translation.php +++ b/engine/Shopware/Controllers/Backend/Translation.php @@ -1,4 +1,5 @@ View()->assign([ 'success' => false, 'data' => $this->Request()->getParams(), - 'message' => sprintf('User with ID "%s" not found', $userID), + 'message' => \sprintf('User with ID "%s" not found', $userID), ]); return; diff --git a/engine/Shopware/Controllers/Backend/Vote.php b/engine/Shopware/Controllers/Backend/Vote.php index 6f5412ab0b7..49d3c6f8ac2 100644 --- a/engine/Shopware/Controllers/Backend/Vote.php +++ b/engine/Shopware/Controllers/Backend/Vote.php @@ -1,4 +1,5 @@ container->get(ModelManager::class)->createQueryBuilder(); $builder->select(['customer.email', 'customer.languageId']) diff --git a/engine/Shopware/Controllers/Frontend/Address.php b/engine/Shopware/Controllers/Frontend/Address.php index 0da10d8d813..99bb9b118a6 100644 --- a/engine/Shopware/Controllers/Frontend/Address.php +++ b/engine/Shopware/Controllers/Frontend/Address.php @@ -1,4 +1,5 @@ repository @@ -521,7 +522,7 @@ public function getDateFilterData($blogCategoryIds, $selectedFilters, $shopId = */ public function getAuthorFilterData($blogCategoryIds, $filter, $shopId = null) { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); // Date filter query $filterData = $this->repository @@ -544,7 +545,7 @@ public function getAuthorFilterData($blogCategoryIds, $filter, $shopId = null) */ public function getTagsFilterData($blogCategoryIds, $filter, $shopId = null) { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); // Date filter query $filterData = $this->repository @@ -565,7 +566,7 @@ public function getTagsFilterData($blogCategoryIds, $filter, $shopId = null) */ public function getCategoryBreadcrumb($categoryId) { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); return array_reverse(Shopware()->Modules()->Categories()->sGetCategoriesByParent($categoryId)); } diff --git a/engine/Shopware/Controllers/Frontend/Custom.php b/engine/Shopware/Controllers/Frontend/Custom.php index b064dc1aef4..0ae9534254f 100644 --- a/engine/Shopware/Controllers/Frontend/Custom.php +++ b/engine/Shopware/Controllers/Frontend/Custom.php @@ -1,4 +1,5 @@ Modules()->Articles()->sGetArticleNameByOrderNumber($orderNumber); - $element['value'] = sprintf('%s (%s)', $product, $this->get('shopware.escaper')->escapeHtml($orderNumber)); + $element['value'] = \sprintf('%s (%s)', $product, $this->get('shopware.escaper')->escapeHtml($orderNumber)); $this->_elements[$id]['value'] = $element['value']; } catch (InvalidOrderNumberException $exception) { // Explicit empty catch @@ -227,7 +228,7 @@ protected function getContent($formId) $getBasket = Shopware()->Modules()->Basket()->sGetBasket(); foreach ($getBasket[CartKey::POSITIONS] ?? [] as $basketRow) { if (empty($basketRow['modus'])) { - $text .= sprintf( + $text .= \sprintf( "\n%s x %s (%s) - %s %s", $basketRow['quantity'], $basketRow['articlename'], @@ -376,7 +377,7 @@ protected function _createInputElement(array $element, $post = null) case 'hidden': case 'email': case 'text': - $output .= sprintf( + $output .= \sprintf( "\r\n", $element['typ'], $element['class'], @@ -390,7 +391,7 @@ protected function _createInputElement(array $element, $post = null) break; case 'nourl': - $output .= sprintf( + $output .= \sprintf( "\r\n", 'text', $element['class'], @@ -409,7 +410,7 @@ protected function _createInputElement(array $element, $post = null) } else { $checked = ''; } - $output .= sprintf( + $output .= \sprintf( "\r\n", $element['typ'], $element['class'], @@ -423,7 +424,7 @@ protected function _createInputElement(array $element, $post = null) break; case 'file': - $output .= sprintf( + $output .= \sprintf( "\r\n", $element['typ'], $element['class'], @@ -442,14 +443,14 @@ protected function _createInputElement(array $element, $post = null) if (strpos($element['label'], ';') !== false) { $placeholders = explode(';', $element['label']); - $placeholder0 = sprintf('placeholder="%s%s"', $placeholders[0], $requiredFieldSnippet); - $placeholder1 = sprintf('placeholder="%s%s"', $placeholders[1], $requiredFieldSnippet); + $placeholder0 = \sprintf('placeholder="%s%s"', $placeholders[0], $requiredFieldSnippet); + $placeholder1 = \sprintf('placeholder="%s%s"', $placeholders[1], $requiredFieldSnippet); } else { $placeholder0 = $placeholder; $placeholder1 = $placeholder; } - $output .= sprintf( + $output .= \sprintf( "\r\n", $element['class'][0], $requiredField, @@ -459,7 +460,7 @@ protected function _createInputElement(array $element, $post = null) $element['name'][0], $element['name'][0] ); - $output .= sprintf( + $output .= \sprintf( "\r\n", $element['class'][1], $requiredField, @@ -475,7 +476,7 @@ protected function _createInputElement(array $element, $post = null) if (empty($post) && $element['value']) { $post = $element['value']; } - $output .= sprintf( + $output .= \sprintf( "\r\n", $element['class'], $requiredField, @@ -489,7 +490,7 @@ protected function _createInputElement(array $element, $post = null) case 'select': $values = explode(';', $element['value']); - $output .= sprintf( + $output .= \sprintf( "\r\n"; @@ -527,7 +528,7 @@ protected function _createInputElement(array $element, $post = null) $checked = ' checked'; } - $output .= sprintf( + $output .= \sprintf( ' %s ', $element['class'], $requiredField, diff --git a/engine/Shopware/Controllers/Frontend/Index.php b/engine/Shopware/Controllers/Frontend/Index.php index f8c9c800d17..ffa7a22874a 100644 --- a/engine/Shopware/Controllers/Frontend/Index.php +++ b/engine/Shopware/Controllers/Frontend/Index.php @@ -1,4 +1,5 @@ load($signature); if (!$data) { - throw new RuntimeException(sprintf('Basket for signature %s not found', $signature)); + throw new RuntimeException(\sprintf('Basket for signature %s not found', $signature)); } $persister->delete($signature); @@ -321,7 +322,7 @@ protected function sendSignatureIsInvalidNotificationMail($paymentName, $orderNu Payment transaction number: %s. EOD; - $content = sprintf($content, $paymentName, $orderNumber, $transactionNumber); + $content = \sprintf($content, $paymentName, $orderNumber, $transactionNumber); try { $mail = $this->get('mail'); diff --git a/engine/Shopware/Controllers/Frontend/Register.php b/engine/Shopware/Controllers/Frontend/Register.php index 1b712259124..b70d1093ca4 100644 --- a/engine/Shopware/Controllers/Frontend/Register.php +++ b/engine/Shopware/Controllers/Frontend/Register.php @@ -1,4 +1,5 @@ Modules()->Admin()->sSaveRegisterSendConfirmation($customer->getEmail()); } catch (Exception $e) { - $message = sprintf('Could not send user registration email to address %s', $customer->getEmail()); + $message = \sprintf('Could not send user registration email to address %s', $customer->getEmail()); $this->get('corelogger')->error($message, ['exception' => $e->getMessage()]); } } diff --git a/engine/Shopware/Controllers/Frontend/RobotsTxt.php b/engine/Shopware/Controllers/Frontend/RobotsTxt.php index a84547fe5b9..2777a03b48b 100644 --- a/engine/Shopware/Controllers/Frontend/RobotsTxt.php +++ b/engine/Shopware/Controllers/Frontend/RobotsTxt.php @@ -1,4 +1,5 @@ redirect(['controller' => 'sitemap_index.xml']); } diff --git a/engine/Shopware/Controllers/Frontend/Tellafriend.php b/engine/Shopware/Controllers/Frontend/Tellafriend.php index d351c23e254..39c5050cd4a 100644 --- a/engine/Shopware/Controllers/Frontend/Tellafriend.php +++ b/engine/Shopware/Controllers/Frontend/Tellafriend.php @@ -1,4 +1,5 @@ Request()->getParam('emotionId'); $query = $repository->getEmotionById($emotionId); diff --git a/engine/Shopware/Controllers/Widgets/Captcha.php b/engine/Shopware/Controllers/Widgets/Captcha.php index c92e5cfca0d..e4d3be1cd90 100644 --- a/engine/Shopware/Controllers/Widgets/Captcha.php +++ b/engine/Shopware/Controllers/Widgets/Captcha.php @@ -63,7 +63,7 @@ public function indexAction() $captcha = $this->container->get('shopware.captcha.repository')->getConfiguredCaptcha(); $captchaName = $captcha->getName(); - $this->View()->loadTemplate(sprintf('widgets/captcha/%s.tpl', $captchaName)); + $this->View()->loadTemplate(\sprintf('widgets/captcha/%s.tpl', $captchaName)); $this->View()->assign($captcha->getTemplateData()); } @@ -86,7 +86,7 @@ public function getCaptchaByNameAction() $captcha = $captchaRepository->getCaptchaByName('nocaptcha'); } - $this->View()->loadTemplate(sprintf('widgets/captcha/%s.tpl', $captcha->getName())); + $this->View()->loadTemplate(\sprintf('widgets/captcha/%s.tpl', $captcha->getName())); $this->View()->assign($captcha->getTemplateData()); } } diff --git a/engine/Shopware/Controllers/Widgets/Emotion.php b/engine/Shopware/Controllers/Widgets/Emotion.php index 62384f02a62..af1101bd86a 100644 --- a/engine/Shopware/Controllers/Widgets/Emotion.php +++ b/engine/Shopware/Controllers/Widgets/Emotion.php @@ -1,4 +1,5 @@ from('s_premium_dispatch', 'd') - ->join('d', sprintf('(SELECT %s)', $sqlBasket), 'b', '1=1') + ->join('d', \sprintf('(SELECT %s)', $sqlBasket), 'b', '1=1') ->join('d', 's_premium_dispatch_countries', 'dc', 'd.id = dc.dispatchID AND dc.countryID=b.countryID') ->join('d', 's_premium_dispatch_paymentmeans', 'dp', 'd.id = dp.dispatchID AND dp.paymentID=b.paymentID') ->leftJoin('d', 's_premium_holidays', 'h', 'h.date = CURDATE()') ->leftJoin('d', 's_premium_dispatch_holidays', 'dh', 'd.id=dh.dispatchID AND h.id=dh.holidayID') - ->leftJoin('d', sprintf('(%s)', $joinSubSelect->getSQL()), 'dk', 'dk.dispatchID=d.id') + ->leftJoin('d', \sprintf('(%s)', $joinSubSelect->getSQL()), 'dk', 'dk.dispatchID=d.id') ->leftJoin('b', 's_user', 'u', ' u.id=b.userID AND u.active=1') ->leftJoin('u', 's_user_addresses', 'ub', 'ub.user_id = u.id AND ub.id = :billingAddressId') ->leftJoin('u', 's_user_addresses', 'us', 'us.user_id = u.id AND us.id = :shippingAddressId') @@ -3096,7 +3097,7 @@ public function sGetPremiumShippingcosts($country = null) try { $calculationType = (int) $dispatch['calculation']; if (!\in_array($calculationType, Dispatch::CALCULATIONS, true)) { - throw new RuntimeException(sprintf('Invalid shipping calculation type "%d"', $calculationType)); + throw new RuntimeException(\sprintf('Invalid shipping calculation type "%d"', $calculationType)); } $from = $this->shippingCostService->getShippingCostMultiplier($calculationType, $basket, $dispatch); } catch (RuntimeException $e) { @@ -3875,7 +3876,7 @@ private function getUserBillingData(int $userId, array $userData): array $entityManager = Shopware()->Container()->get(ModelManager::class); $customer = $entityManager->find(Customer::class, $userId); if (!$customer) { - throw new Exception(sprintf('Customer with id %s not found', $userId)); + throw new Exception(\sprintf('Customer with id %s not found', $userId)); } $billing = $this->convertToLegacyAddressArray($customer->getDefaultBillingAddress()); $billing['attributes'] = $this->attributeLoader->load('s_user_addresses_attributes', $billing['id']); diff --git a/engine/Shopware/Core/sArticles.php b/engine/Shopware/Core/sArticles.php index d13b2c8cfbc..602d270990d 100644 --- a/engine/Shopware/Core/sArticles.php +++ b/engine/Shopware/Core/sArticles.php @@ -1,4 +1,5 @@ productComparisons->sGetComparisonProperties($articles); } @@ -266,7 +267,7 @@ public function sGetComparisonProperties($articles) */ public function sFillUpComparisonArticles($properties, $articles) { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Use sArticlesComparisons::sFillUpComparisonArticles instead.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Use sArticlesComparisons::sFillUpComparisonArticles instead.', __CLASS__, __METHOD__), E_USER_DEPRECATED); return $this->productComparisons->sFillUpComparisonArticles($properties, $articles); } @@ -396,7 +397,7 @@ public function sSaveComment($article) */ public function sGetArticlesBySupplier($supplierID = null) { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.8. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.8. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); if (!empty($supplierID)) { $this->frontController->Request()->setQuery('sSearch', $supplierID); @@ -460,7 +461,7 @@ public function sGetArticlesByCategory($categoryId = null, ?Criteria $criteria = */ public function sGetSupplierById($id) { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.8. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.8. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); $id = (int) $id; $categoryId = (int) $this->frontController->Request()->getQuery('sCategory'); @@ -661,7 +662,7 @@ public function sGetArticleCharts($category = null) */ public function sCheckIfEsd($id, $detailsID, $realtime = false) { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); // Check if this product is esd-only (check in variants, too -> later) $id = (int) $id; @@ -907,7 +908,7 @@ public function sGetCheapestPrice( $returnArrayIfConfigurator = false, $checkLiveshopping = false ) { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); if ($group != $this->sSYSTEM->sUSERGROUP) { $fetchGroup = $group; @@ -1154,7 +1155,7 @@ public function sFormatPrice($price) $price = str_replace('.', ',', (string) $price); // Replaces points with commas $commaPos = strpos((string) $price, ','); if ($commaPos) { - $part = substr((string) $price, $commaPos + 1, \strlen((string) $price) - $commaPos); + $part = (string) substr((string) $price, $commaPos + 1, \strlen((string) $price) - $commaPos); switch (\strlen($part)) { case 1: $price .= '0'; @@ -1183,7 +1184,7 @@ public function sFormatPrice($price) public function sRound($moneyfloat = null) { if (is_numeric($moneyfloat)) { - $moneyfloat = sprintf('%F', $moneyfloat); + $moneyfloat = \sprintf('%F', $moneyfloat); } $money_str = explode('.', (string) $moneyfloat); if (empty($money_str[1])) { @@ -1356,7 +1357,7 @@ public function getArticleMainCover($articleId, $articleAlbum) */ public function getArticleListingCover($articleId, $forceMainImage = false) { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Use the sArticles::sGetArticlePictures instead.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Use the sArticles::sGetArticlePictures instead.', __CLASS__, __METHOD__), E_USER_DEPRECATED); return $this->sGetArticlePictures($articleId, true, 0, null, false, false, $forceMainImage); } @@ -1595,7 +1596,7 @@ public function sGetArticleNameByArticleId($articleId, $returnAll = false) */ public function sGetArticleTaxById($id) { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); $checkForProduct = $this->db->fetchRow( 'SELECT s_core_tax.tax AS tax @@ -1624,7 +1625,7 @@ public function sGetArticleTaxById($id) */ public function sGetTranslations($data, $object) { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Use sArticle::sGetTranslation instead.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Use sArticle::sGetTranslation instead.', __CLASS__, __METHOD__), E_USER_DEPRECATED); if (Shopware()->Shop()->get('skipbackend') || empty($data)) { return $data; @@ -1845,7 +1846,7 @@ public function sGetConfiguratorImage($sArticle, $sCombination = '') if (!empty($option['selected'])) { $replacedOptionVal = str_replace(' ', '', $optionVal); \assert(\is_string($replacedOptionVal)); - $referenceImages[strtolower(sprintf('%s:%s', $groupVal, $replacedOptionVal))] = true; + $referenceImages[strtolower(\sprintf('%s:%s', $groupVal, $replacedOptionVal))] = true; } } } @@ -2144,7 +2145,7 @@ private function buildCategoryLink(int $categoryId, Enlight_Controller_Request_R $queryPrams = http_build_query($params, '', '&'); - return sprintf('%s?%s', $this->config->get('sBASEFILE'), $queryPrams); + return \sprintf('%s?%s', $this->config->get('sBASEFILE'), $queryPrams); } /** @@ -2264,7 +2265,7 @@ private function getDataOfProductImage(?array $image, Album $productAlbum): arra foreach ($sizes as $key => $size) { if (str_starts_with($size, 'x')) { - $size = sprintf('%sx%s', $size, $size); + $size = \sprintf('%sx%s', $size, $size); } if (isset($image['type']) && $image['type'] === Media::TYPE_IMAGE || $image['media']['type'] === Media::TYPE_IMAGE) { diff --git a/engine/Shopware/Core/sArticlesComparisons.php b/engine/Shopware/Core/sArticlesComparisons.php index aee683925e9..c6a2d56df3f 100644 --- a/engine/Shopware/Core/sArticlesComparisons.php +++ b/engine/Shopware/Core/sArticlesComparisons.php @@ -1,4 +1,5 @@ Container()->get(Enlight_Template_Manager::class); - $template = $smarty->createTemplate(sprintf('string:%s', $snippet)); + $template = $smarty->createTemplate(\sprintf('string:%s', $snippet)); $template->assign('sMinimumCharge', $voucherDetails['minimumcharge']); $sErrorMessages[] = $template->fetch(); @@ -1832,7 +1833,7 @@ public function updateCartItems(array $cartItems) $params ); } catch (Zend_Db_Exception $e) { - throw new Enlight_Exception(sprintf('Basket Update ##01 Could not update quantity %s', $sql)); + throw new Enlight_Exception(\sprintf('Basket Update ##01 Could not update quantity %s', $sql)); } } } @@ -2066,7 +2067,7 @@ public function sAddArticle($id, $quantity = 1) try { $this->db->query($sql, $params); } catch (Zend_Db_Exception $e) { - throw new Enlight_Exception(sprintf('BASKET-INSERT #02 SQL-Error%s', $sql)); + throw new Enlight_Exception(\sprintf('BASKET-INSERT #02 SQL-Error%s', $sql)); } $insertId = (int) $this->db->lastInsertId(); diff --git a/engine/Shopware/Core/sCategories.php b/engine/Shopware/Core/sCategories.php index 4766cd4d968..4687eb384d0 100644 --- a/engine/Shopware/Core/sCategories.php +++ b/engine/Shopware/Core/sCategories.php @@ -1,4 +1,5 @@ sBlacklist)) { - $where = sprintf(' AND similarShown.related_article_id NOT IN (%s)', implode(',', $this->sBlacklist)); + $where = \sprintf(' AND similarShown.related_article_id NOT IN (%s)', implode(',', $this->sBlacklist)); } $sql = " @@ -208,7 +208,7 @@ public function sGetAlsoBoughtArticles($articleID, $limit = 0) $where = ''; if (!empty($this->sBlacklist)) { - $where = sprintf(' AND alsoBought.related_article_id NOT IN (%s)', implode(',', $this->sBlacklist)); + $where = \sprintf(' AND alsoBought.related_article_id NOT IN (%s)', implode(',', $this->sBlacklist)); } $sql = " diff --git a/engine/Shopware/Core/sOrder.php b/engine/Shopware/Core/sOrder.php index 2b2b72261d6..00957c25363 100644 --- a/engine/Shopware/Core/sOrder.php +++ b/engine/Shopware/Core/sOrder.php @@ -1,4 +1,5 @@ db->insert('s_order', $data); $orderID = $this->db->lastInsertId(); } catch (Exception $e) { - throw new Enlight_Exception(sprintf('##sOrder-sTemporaryOrder-#01:%s', $e->getMessage()), 0, $e); + throw new Enlight_Exception(\sprintf('##sOrder-sTemporaryOrder-#01:%s', $e->getMessage()), 0, $e); } if (!$affectedRows || !$orderID) { throw new Enlight_Exception('##sOrder-sTemporaryOrder-#01: No rows affected or no order id saved', 0); @@ -524,7 +525,7 @@ public function sCreateTemporaryOrder() $this->db->insert('s_order_details', $data); $orderDetailId = $this->db->lastInsertId(); } catch (Exception $e) { - throw new Enlight_Exception(sprintf('##sOrder-sTemporaryOrder-Position-#02:%s', $e->getMessage()), 0, $e); + throw new Enlight_Exception(\sprintf('##sOrder-sTemporaryOrder-Position-#02:%s', $e->getMessage()), 0, $e); } // Create order detail attributes @@ -645,11 +646,11 @@ public function sSaveOrder() $this->db->commit(); } catch (Exception $e) { $this->db->rollBack(); - throw new Enlight_Exception(sprintf('Shopware Order Fatal-Error %s :%s', $_SERVER['HTTP_HOST'], $e->getMessage()), 0, $e); + throw new Enlight_Exception(\sprintf('Shopware Order Fatal-Error %s :%s', $_SERVER['HTTP_HOST'], $e->getMessage()), 0, $e); } if (!$affectedRows || !$orderID) { - throw new Enlight_Exception(sprintf('Shopware Order Fatal-Error %s : No rows affected or no order id created.', $_SERVER['HTTP_HOST']), 0); + throw new Enlight_Exception(\sprintf('Shopware Order Fatal-Error %s : No rows affected or no order id created.', $_SERVER['HTTP_HOST']), 0); } try { @@ -708,7 +709,7 @@ public function sSaveOrder() VALUES (%d, %s, %d, %s, %f, %d, %s, %d, %s, %d, %d, %d, %f, %s, %s, %s, %s) '; - $sql = sprintf( + $sql = \sprintf( $preparedQuery, $orderID, $this->db->quote((string) $orderNumber), @@ -754,7 +755,7 @@ public function sSaveOrder() $this->db->executeUpdate($sql); $orderdetailsID = (int) $this->db->lastInsertId(); } catch (Exception $e) { - throw new Enlight_Exception(sprintf('Shopware Order Fatal-Error %s :%s', $_SERVER['HTTP_HOST'], $e->getMessage()), 0, $e); + throw new Enlight_Exception(\sprintf('Shopware Order Fatal-Error %s :%s', $_SERVER['HTTP_HOST'], $e->getMessage()), 0, $e); } $this->sBasketData[CartKey::POSITIONS][$key]['orderDetailId'] = $orderdetailsID; @@ -2103,7 +2104,7 @@ private function getOrderStatus($orderId) */ private function logOrderMailException(Exception $e, $orderNumber, $email) { - $message = sprintf( + $message = \sprintf( 'Could not send order mail for ordernumber %s to address %s', $orderNumber, $email diff --git a/engine/Shopware/Core/sRewriteTable.php b/engine/Shopware/Core/sRewriteTable.php index 8577587c839..e1f16d94efb 100644 --- a/engine/Shopware/Core/sRewriteTable.php +++ b/engine/Shopware/Core/sRewriteTable.php @@ -1,4 +1,5 @@ template->fetch('string:' . $type->getSeoUrlTemplate(), ['type' => $typeArray, 'item' => $item, 'context' => $context]); $path = $this->sCleanupPath($path); - $org_path = sprintf('sViewport=%s&sAction=detail&id=%d', $type->getControllerName(), $item['id']); + $org_path = \sprintf('sViewport=%s&sAction=detail&id=%d', $type->getControllerName(), $item['id']); $this->sInsertUrl($org_path, $path); } } @@ -867,7 +868,7 @@ public function sCategoryPath($categoryId) */ public function getData() { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED); return $this->data; } diff --git a/engine/Shopware/Core/sSystem.php b/engine/Shopware/Core/sSystem.php index a323ef4044d..ada8172806f 100644 --- a/engine/Shopware/Core/sSystem.php +++ b/engine/Shopware/Core/sSystem.php @@ -1,4 +1,5 @@ $dir) { if (!is_dir($dir)) { if (@mkdir($dir, 0777, true) === false && !is_dir($dir)) { - throw new RuntimeException(sprintf("Unable to create the %s directory (%s)\n", $name, $dir)); + throw new RuntimeException(\sprintf("Unable to create the %s directory (%s)\n", $name, $dir)); } } elseif (!is_writable($dir)) { - throw new RuntimeException(sprintf("Unable to write in the %s directory (%s)\n", $name, $dir)); + throw new RuntimeException(\sprintf("Unable to write in the %s directory (%s)\n", $name, $dir)); } } diff --git a/engine/Shopware/Models/Analytics/Repository.php b/engine/Shopware/Models/Analytics/Repository.php index de9a4adfdc0..5b22348e51f 100644 --- a/engine/Shopware/Models/Analytics/Repository.php +++ b/engine/Shopware/Models/Analytics/Repository.php @@ -1,4 +1,5 @@ + * @var ArrayCollection * * @ORM\ManyToMany(targetEntity="Shopware\Models\Article\Configurator\Set", mappedBy="options") */ @@ -104,14 +105,14 @@ class Option extends ModelEntity private $group; /** - * @var ArrayCollection<\Shopware\Models\Article\Configurator\Dependency> + * @var ArrayCollection * * @ORM\OneToMany(targetEntity="Shopware\Models\Article\Configurator\Dependency", mappedBy="parentOption", orphanRemoval=true) */ private $dependencyParents; /** - * @var ArrayCollection<\Shopware\Models\Article\Configurator\Dependency> + * @var ArrayCollection * * @ORM\OneToMany(targetEntity="Shopware\Models\Article\Configurator\Dependency", mappedBy="childOption", orphanRemoval=true) */ @@ -187,7 +188,7 @@ public function setGroup($group) } /** - * @return ArrayCollection<\Shopware\Models\Article\Configurator\Dependency> + * @return ArrayCollection */ public function getDependencyParents() { @@ -195,7 +196,7 @@ public function getDependencyParents() } /** - * @param ArrayCollection<\Shopware\Models\Article\Configurator\Dependency> $dependencyParents + * @param ArrayCollection $dependencyParents */ public function setDependencyParents($dependencyParents) { @@ -203,7 +204,7 @@ public function setDependencyParents($dependencyParents) } /** - * @return ArrayCollection<\Shopware\Models\Article\Configurator\Dependency> + * @return ArrayCollection */ public function getDependencyChildren() { @@ -211,7 +212,7 @@ public function getDependencyChildren() } /** - * @param ArrayCollection<\Shopware\Models\Article\Configurator\Dependency> $dependencyChildren + * @param ArrayCollection $dependencyChildren */ public function setDependencyChildren($dependencyChildren) { diff --git a/engine/Shopware/Models/Article/Configurator/PriceVariation.php b/engine/Shopware/Models/Article/Configurator/PriceVariation.php index 953a31269bc..72b0c9cc022 100644 --- a/engine/Shopware/Models/Article/Configurator/PriceVariation.php +++ b/engine/Shopware/Models/Article/Configurator/PriceVariation.php @@ -1,4 +1,5 @@ + * @var ArrayCollection * * @ORM\OneToMany(targetEntity="Shopware\Models\Article\Configurator\Template\Price", mappedBy="template", orphanRemoval=true, cascade={"persist"}) */ diff --git a/engine/Shopware/Models/Article/Detail.php b/engine/Shopware/Models/Article/Detail.php index a292a341283..40657df49a6 100644 --- a/engine/Shopware/Models/Article/Detail.php +++ b/engine/Shopware/Models/Article/Detail.php @@ -1,4 +1,5 @@ + * @var ArrayCollection
* * @ORM\OneToMany(targetEntity="Shopware\Models\Article\Article", mappedBy="supplier", fetch="EXTRA_LAZY") * @ORM\JoinColumn(name="id", referencedColumnName="supplierID") @@ -277,7 +278,7 @@ public function setDescription($description) /** * Returns all articles assigned to this supplier * - * @return ArrayCollection<\Shopware\Models\Article\Article> + * @return ArrayCollection
*/ public function getArticles() { @@ -287,7 +288,7 @@ public function getArticles() /** * Takes an array of articles, in most cases doctrine will take care of this. * - * @param ArrayCollection<\Shopware\Models\Article\Article> $articles + * @param ArrayCollection
$articles * * @return Supplier */ diff --git a/engine/Shopware/Models/Article/SupplierRepository.php b/engine/Shopware/Models/Article/SupplierRepository.php index dace2aca603..abaaef2b435 100644 --- a/engine/Shopware/Models/Article/SupplierRepository.php +++ b/engine/Shopware/Models/Article/SupplierRepository.php @@ -1,4 +1,5 @@ + * @var \Doctrine\Common\Collections\ArrayCollection * * @ORM\OneToMany(targetEntity="Shopware\Models\Customer\Customer", mappedBy="priceGroup") */ @@ -142,7 +143,7 @@ public function getName() * the Customer.group property (OWNING SIDE) and the Group.customers (INVERSE SIDE) property. * The customer data is joined over the s_user.groupkey field. * - * @return \Doctrine\Common\Collections\ArrayCollection<\Shopware\Models\Customer\Customer> + * @return \Doctrine\Common\Collections\ArrayCollection */ public function getCustomers() { @@ -155,7 +156,7 @@ public function getCustomers() * the Customer.group property (OWNING SIDE) and the Group.customers (INVERSE SIDE) property. * The customer data is joined over the s_user.groupkey field. * - * @param \Doctrine\Common\Collections\ArrayCollection<\Shopware\Models\Customer\Customer> $customers + * @param \Doctrine\Common\Collections\ArrayCollection $customers */ public function setCustomers($customers) { diff --git a/engine/Shopware/Models/Customer/Repository.php b/engine/Shopware/Models/Customer/Repository.php index 84541b0df7c..24fc2c9f742 100644 --- a/engine/Shopware/Models/Customer/Repository.php +++ b/engine/Shopware/Models/Customer/Repository.php @@ -1,4 +1,5 @@ $var_name; } - throw new Enlight_Exception(sprintf('Property %s does not exist', $var_name)); + throw new Enlight_Exception(\sprintf('Property %s does not exist', $var_name)); } /** @@ -297,7 +298,7 @@ public function getOrder() [$this->_id]); if (!\is_array($order)) { - throw new Enlight_Exception(sprintf('Order with id %d not found!', $this->_id)); + throw new Enlight_Exception(\sprintf('Order with id %d not found!', $this->_id)); } $this->_order = new ArrayObject($order, ArrayObject::ARRAY_AS_PROPS); @@ -1039,7 +1040,7 @@ private function getCountry(int $countryId): array { $country = $this->countryGateway->getCountry($countryId, $this->context); if (!$country instanceof Country) { - throw new RuntimeException(sprintf('Country with ID "%s" not found', $countryId)); + throw new RuntimeException(\sprintf('Country with ID "%s" not found', $countryId)); } return $this->structConverter->convertCountryStruct($country); diff --git a/engine/Shopware/Models/Emotion/Data.php b/engine/Shopware/Models/Emotion/Data.php index 19c736b0cac..d16561c48f7 100644 --- a/engine/Shopware/Models/Emotion/Data.php +++ b/engine/Shopware/Models/Emotion/Data.php @@ -1,4 +1,5 @@ + * @var ArrayCollection * * @ORM\OneToMany(targetEntity="Shopware\Models\Emotion\Emotion", mappedBy="template") */ diff --git a/engine/Shopware/Models/Form/Field.php b/engine/Shopware/Models/Form/Field.php index 43696ff68b4..c3a562d351d 100644 --- a/engine/Shopware/Models/Form/Field.php +++ b/engine/Shopware/Models/Form/Field.php @@ -1,4 +1,5 @@ + * @var ArrayCollection * * @ORM\OneToMany(targetEntity="Shopware\Models\MultiEdit\QueueArticle", mappedBy="queue", cascade={"persist"}, fetch="EXTRA_LAZY") */ diff --git a/engine/Shopware/Models/MultiEdit/QueueArticle.php b/engine/Shopware/Models/MultiEdit/QueueArticle.php index 9ab0292bc23..c151d1abc20 100644 --- a/engine/Shopware/Models/MultiEdit/QueueArticle.php +++ b/engine/Shopware/Models/MultiEdit/QueueArticle.php @@ -1,4 +1,5 @@ + * @var ArrayCollection
* * @ORM\OneToMany(targetEntity="Shopware\Models\Article\Article", mappedBy="propertyGroup", fetch="EXTRA_LAZY") * @ORM\JoinColumn(name="id", referencedColumnName="filtergroupID") diff --git a/engine/Shopware/Models/Property/Option.php b/engine/Shopware/Models/Property/Option.php index d82e4178ec5..286347a82eb 100644 --- a/engine/Shopware/Models/Property/Option.php +++ b/engine/Shopware/Models/Property/Option.php @@ -1,4 +1,5 @@ + * @var \Doctrine\Common\Collections\ArrayCollection * * @ORM\OneToMany(targetEntity="Shopware\Models\User\Rule", mappedBy="role", cascade={"remove"}) */ @@ -123,7 +124,7 @@ class Role extends ModelEntity implements Zend_Acl_Role_Interface * The children property contains all inherited Shopware\Models\User\Role instances. * The children inherits all privileges from his parent. * - * @var \Doctrine\Common\Collections\ArrayCollection<\Shopware\Models\User\Role> + * @var \Doctrine\Common\Collections\ArrayCollection * * @ORM\OneToMany(targetEntity="\Shopware\Models\User\Role", mappedBy="parent") */ diff --git a/engine/Shopware/Models/User/Rule.php b/engine/Shopware/Models/User/Rule.php index e61ac2987d1..a2fc8a26c9f 100644 --- a/engine/Shopware/Models/User/Rule.php +++ b/engine/Shopware/Models/User/Rule.php @@ -1,4 +1,5 @@ self::CHECK_TYPE, 'errorLevel' => $requirement['level'], - 'message' => sprintf( + 'message' => \sprintf( $this->namespace->get('check_emotiontemplate_failure'), implode(',', $names) ), diff --git a/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Checks/LicenseCheck.php b/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Checks/LicenseCheck.php index e7c4a9f685a..f0a52c44e7e 100644 --- a/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Checks/LicenseCheck.php +++ b/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Checks/LicenseCheck.php @@ -1,4 +1,5 @@ self::CHECK_TYPE, 'errorLevel' => Validation::REQUIREMENT_VALID, - 'message' => sprintf( + 'message' => \sprintf( $successMessage, $minMySQLVersion, $version @@ -85,7 +86,7 @@ public function check($requirement) return [ 'type' => self::CHECK_TYPE, 'errorLevel' => $requirement['level'], - 'message' => sprintf( + 'message' => \sprintf( $failMessage, $minMySQLVersion, $version diff --git a/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Checks/PHPExtensionCheck.php b/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Checks/PHPExtensionCheck.php index 537ee2518a9..d18f69adf23 100644 --- a/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Checks/PHPExtensionCheck.php +++ b/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Checks/PHPExtensionCheck.php @@ -1,4 +1,5 @@ self::CHECK_TYPE, 'errorLevel' => Validation::REQUIREMENT_VALID, - 'message' => sprintf( + 'message' => \sprintf( $successMessage, $requiredExtension ), @@ -78,7 +79,7 @@ public function check($requirement) return [ 'type' => self::CHECK_TYPE, 'errorLevel' => $requirement['level'], - 'message' => sprintf( + 'message' => \sprintf( $failMessage, $requiredExtension ), diff --git a/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Checks/PHPVersionCheck.php b/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Checks/PHPVersionCheck.php index 9b7477e7fe8..17287002d25 100644 --- a/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Checks/PHPVersionCheck.php +++ b/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Checks/PHPVersionCheck.php @@ -1,4 +1,5 @@ self::CHECK_TYPE, 'errorLevel' => Validation::REQUIREMENT_VALID, - 'message' => sprintf( + 'message' => \sprintf( $successMessage, $minPHPVersion, PHP_VERSION @@ -81,7 +82,7 @@ public function check($requirement) return [ 'type' => self::CHECK_TYPE, 'errorLevel' => $requirement['level'], - 'message' => sprintf( + 'message' => \sprintf( $failMessage, $minPHPVersion, PHP_VERSION diff --git a/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Checks/RegexCheck.php b/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Checks/RegexCheck.php index 0c220782779..2c01cebbced 100644 --- a/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Checks/RegexCheck.php +++ b/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Checks/RegexCheck.php @@ -1,4 +1,5 @@ self::CHECK_TYPE, 'errorLevel' => $requirement['level'], - 'message' => sprintf($message, implode('
', $files)), + 'message' => \sprintf($message, implode('
', $files)), ]; } diff --git a/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Checks/WritableCheck.php b/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Checks/WritableCheck.php index 35560504edd..759027385e7 100644 --- a/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Checks/WritableCheck.php +++ b/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Checks/WritableCheck.php @@ -1,4 +1,5 @@ self::CHECK_TYPE, 'errorLevel' => Validation::REQUIREMENT_VALID, - 'message' => sprintf( + 'message' => \sprintf( $successMessage, implode('
', $checkedDirectories) ), @@ -97,7 +98,7 @@ public function check($requirement) return [ 'type' => self::CHECK_TYPE, 'errorLevel' => $requirement['level'], - 'message' => sprintf( + 'message' => \sprintf( $failMessage, implode('
', $directories) ), diff --git a/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Download.php b/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Download.php index 1caa8f9b02a..81c511013f8 100644 --- a/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Download.php +++ b/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Download.php @@ -1,4 +1,5 @@ 0) { - throw new Exception(sprintf('File on destination %s does already exist.', $destinationUri)); + throw new Exception(\sprintf('File on destination %s does already exist.', $destinationUri)); } $partFile = $destinationUri . '.part'; diff --git a/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Exception/ExtensionMissingException.php b/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Exception/ExtensionMissingException.php index a1fe17e7cdb..a46325a590b 100644 --- a/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Exception/ExtensionMissingException.php +++ b/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Exception/ExtensionMissingException.php @@ -1,4 +1,5 @@ getPerms()), -4); + $permission = substr(\sprintf('%o', $fileInfo->getPerms()), -4); } catch (Exception $e) { // cannot get permissions... return; @@ -143,7 +144,7 @@ private function fixDirectoryPermission(SplFileInfo $fileInfo) private function fixFilePermission(SplFileInfo $fileInfo) { try { - $permission = substr(sprintf('%o', $fileInfo->getPerms()), -4); + $permission = substr(\sprintf('%o', $fileInfo->getPerms()), -4); } catch (Exception $e) { // cannot get permissions... return; diff --git a/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/PluginCheck.php b/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/PluginCheck.php index 48c30a2480f..d7df001a256 100644 --- a/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/PluginCheck.php +++ b/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/PluginCheck.php @@ -1,4 +1,5 @@ $description, 'updatable' => $inStore && version_compare($plugin['version'], $storePlugins[$key]->getVersion(), '<'), 'updatableAfterUpgrade' => $inStore && $targetVersionUpdateAvailable && $storePlugins[$key]->getVersion() !== $updatesAvailable[$key]->getVersion(), - 'id' => sprintf('plugin_incompatible-%s', $name), + 'id' => \sprintf('plugin_incompatible-%s', $name), 'technicalName' => $technicalName, 'errorLevel' => $targetVersionUpdateAvailable ? Validation::REQUIREMENT_VALID : Validation::REQUIREMENT_WARNING, 'success' => true, diff --git a/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Steps/DownloadStep.php b/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Steps/DownloadStep.php index d2228be536e..fdad1b56875 100644 --- a/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Steps/DownloadStep.php +++ b/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Steps/DownloadStep.php @@ -1,4 +1,5 @@ seek($offset); } catch (Exception $e) { @unlink($this->source); - throw new Exception(sprintf('Could not open update package:
%s', $e->getMessage()), 0, $e); + throw new Exception(\sprintf('Could not open update package:
%s', $e->getMessage()), 0, $e); } /** @var ZipEntry $entry */ diff --git a/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Steps/ValidResult.php b/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Steps/ValidResult.php index 3e001f32f89..47258304415 100644 --- a/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Steps/ValidResult.php +++ b/engine/Shopware/Plugins/Default/Backend/SwagUpdate/Components/Steps/ValidResult.php @@ -1,4 +1,5 @@ container->get('corelogger')->error( - sprintf('SwagUpdate: There are %d files without write permission. FTP credentials are needed.', $wrongPermissionCount), + \sprintf('SwagUpdate: There are %d files without write permission. FTP credentials are needed.', $wrongPermissionCount), $result ); @@ -260,7 +261,7 @@ public function startUpdateAction() $updateFilePath = $projectDir . 'files/update/update.json'; if (!file_put_contents($updateFilePath, $payload)) { - throw new Exception(sprintf('Could not write file %s', $updateFilePath)); + throw new Exception(\sprintf('Could not write file %s', $updateFilePath)); } $this->redirect($base . '/recovery/update/index.php'); diff --git a/engine/Shopware/Plugins/Default/Core/ControllerBase/Bootstrap.php b/engine/Shopware/Plugins/Default/Core/ControllerBase/Bootstrap.php index cda21d5d873..ea5191498da 100644 --- a/engine/Shopware/Plugins/Default/Core/ControllerBase/Bootstrap.php +++ b/engine/Shopware/Plugins/Default/Core/ControllerBase/Bootstrap.php @@ -1,4 +1,5 @@ exportProductFiles(); - return sprintf('%s succeeded.', $job->getName()); + return \sprintf('%s succeeded.', $job->getName()); } /** @@ -64,10 +65,10 @@ public function exportProductFiles() $cacheDir = Shopware()->Container()->getParameter('shopware.product_export.cache_dir'); if (!is_dir($cacheDir)) { if (@mkdir($cacheDir, 0777, true) === false) { - throw new RuntimeException(sprintf("Unable to create the %s directory (%s)\n", 'Productexport', $cacheDir)); + throw new RuntimeException(\sprintf("Unable to create the %s directory (%s)\n", 'Productexport', $cacheDir)); } } elseif (!is_writable($cacheDir)) { - throw new RuntimeException(sprintf("Unable to write in the %s directory (%s)\n", 'Productexport', $cacheDir)); + throw new RuntimeException(\sprintf("Unable to write in the %s directory (%s)\n", 'Productexport', $cacheDir)); } $export = Shopware()->Modules()->Export(); diff --git a/engine/Shopware/Plugins/Default/Core/CronRating/Bootstrap.php b/engine/Shopware/Plugins/Default/Core/CronRating/Bootstrap.php index be8cb8a2fe4..23f5f6fbce2 100644 --- a/engine/Shopware/Plugins/Default/Core/CronRating/Bootstrap.php +++ b/engine/Shopware/Plugins/Default/Core/CronRating/Bootstrap.php @@ -1,4 +1,5 @@ getSecure() ? 'https' : 'http', $shop->getHost(), @@ -380,7 +381,7 @@ public function renderEsiTag(Enlight_Controller_Request_RequestHttp $request, ar $params['nocache'] = 1; } - $url = sprintf('%s/?%s', $request->getBaseUrl(), http_build_query($params, '', '&')); + $url = \sprintf('%s/?%s', $request->getBaseUrl(), http_build_query($params, '', '&')); return ''; } diff --git a/engine/Shopware/Plugins/Default/Core/HttpCache/CacheControl.php b/engine/Shopware/Plugins/Default/Core/HttpCache/CacheControl.php index 5f1c6221e44..4f5692da351 100644 --- a/engine/Shopware/Plugins/Default/Core/HttpCache/CacheControl.php +++ b/engine/Shopware/Plugins/Default/Core/HttpCache/CacheControl.php @@ -1,4 +1,5 @@ sub(new DateInterval('P' . (int) $interval . 'D')); diff --git a/engine/Shopware/Plugins/Default/Core/MarketingAggregate/Components/SimilarShown.php b/engine/Shopware/Plugins/Default/Core/MarketingAggregate/Components/SimilarShown.php index 8dcaaed4100..90f3b17c8c8 100644 --- a/engine/Shopware/Plugins/Default/Core/MarketingAggregate/Components/SimilarShown.php +++ b/engine/Shopware/Plugins/Default/Core/MarketingAggregate/Components/SimilarShown.php @@ -1,4 +1,5 @@ Container()->get('similarshown'); } diff --git a/engine/Shopware/Plugins/Default/Core/MarketingAggregate/Controllers/TopSeller.php b/engine/Shopware/Plugins/Default/Core/MarketingAggregate/Controllers/TopSeller.php index d4c9c3c4859..90d9a413ce3 100644 --- a/engine/Shopware/Plugins/Default/Core/MarketingAggregate/Controllers/TopSeller.php +++ b/engine/Shopware/Plugins/Default/Core/MarketingAggregate/Controllers/TopSeller.php @@ -1,4 +1,5 @@ Container()->get('topseller'); } diff --git a/engine/Shopware/Plugins/Default/Core/PasswordEncoder/Bootstrap.php b/engine/Shopware/Plugins/Default/Core/PasswordEncoder/Bootstrap.php index 394b74e9395..b72f76bdc92 100644 --- a/engine/Shopware/Plugins/Default/Core/PasswordEncoder/Bootstrap.php +++ b/engine/Shopware/Plugins/Default/Core/PasswordEncoder/Bootstrap.php @@ -1,4 +1,5 @@ Container()->get('seoindex'); } @@ -49,7 +50,7 @@ public function SeoIndex() */ public function RewriteTable() { - trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.7.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + trigger_error(\sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.7.', __CLASS__, __METHOD__), E_USER_DEPRECATED); return Shopware()->Modules()->RewriteTable(); } diff --git a/engine/Shopware/Plugins/Default/Core/RestApi/Bootstrap.php b/engine/Shopware/Plugins/Default/Core/RestApi/Bootstrap.php index 3332da17b2b..669b3cd6438 100644 --- a/engine/Shopware/Plugins/Default/Core/RestApi/Bootstrap.php +++ b/engine/Shopware/Plugins/Default/Core/RestApi/Bootstrap.php @@ -1,4 +1,5 @@ getBasePath(), '/') . '/'; $response->headers->setCookie(new Cookie($cookieKey, $cookieValue, 0, $path, null, $request->isSecure())); - $url = sprintf( + $url = \sprintf( '%s://%s%s', $request->getScheme(), $request->getHttpHost(), @@ -389,7 +390,7 @@ protected function getNewShopUrl(Request $request, Shop $newShop) } // build full redirect url to allow host switches - return sprintf( + return \sprintf( '%s://%s%s%s', $request->getScheme(), $host, @@ -475,7 +476,7 @@ private function removePartOfUrl(string $requestUri, string $url): string private function validateShop(Shop $shop): void { if (!$shop->getCustomerGroup() instanceof CustomerGroup) { - throw new RuntimeException(sprintf("Shop '%s (id: %s)' has no customer group.", $shop->getName(), $shop->getId())); + throw new RuntimeException(\sprintf("Shop '%s (id: %s)' has no customer group.", $shop->getName(), $shop->getId())); } $shop->getCurrency(); @@ -483,11 +484,11 @@ private function validateShop(Shop $shop): void $mainShop = $shop->getMain() ?? $shop; if (!$mainShop->getTemplate()) { - throw new RuntimeException(sprintf("Shop '%s (id: %s)' has no template.", $shop->getName(), $shop->getId())); + throw new RuntimeException(\sprintf("Shop '%s (id: %s)' has no template.", $shop->getName(), $shop->getId())); } if (!$mainShop->getDocumentTemplate()) { - throw new RuntimeException(sprintf("Shop '%s (id: %s)' has no document template.", $shop->getName(), $shop->getId())); + throw new RuntimeException(\sprintf("Shop '%s (id: %s)' has no document template.", $shop->getName(), $shop->getId())); } } diff --git a/engine/Shopware/Plugins/Default/Core/System/Bootstrap.php b/engine/Shopware/Plugins/Default/Core/System/Bootstrap.php index e6c8d631270..9ff4e6562b0 100644 --- a/engine/Shopware/Plugins/Default/Core/System/Bootstrap.php +++ b/engine/Shopware/Plugins/Default/Core/System/Bootstrap.php @@ -1,4 +1,5 @@ get(ContextServiceInterface::class)->getShopContext(); - $cacheKey = sprintf( + $cacheKey = \sprintf( 'Shopware_AdvancedMenu_Tree_%s_%s_%s', $context->getShop()->getId(), $category, diff --git a/engine/Shopware/Plugins/Default/Frontend/CronRefresh/Bootstrap.php b/engine/Shopware/Plugins/Default/Frontend/CronRefresh/Bootstrap.php index 0882406a3d0..4bf61e1f787 100644 --- a/engine/Shopware/Plugins/Default/Frontend/CronRefresh/Bootstrap.php +++ b/engine/Shopware/Plugins/Default/Frontend/CronRefresh/Bootstrap.php @@ -1,4 +1,5 @@ container->has($name)) { throw new Enlight_Exception( - sprintf('Method "%s::%s" not found failure', \get_class($this), $name), + \sprintf('Method "%s::%s" not found failure', \get_class($this), $name), Enlight_Exception::METHOD_NOT_FOUND ); } diff --git a/recovery/common/autoload.php b/recovery/common/autoload.php index 6cfd0df60cf..940c187fba9 100644 --- a/recovery/common/autoload.php +++ b/recovery/common/autoload.php @@ -1,4 +1,5 @@ pimple->offsetGet('config'); if (!$this->hasParameter($name)) { - throw new InvalidArgumentException(sprintf('Parameter "%s" is not defined.', $name)); + throw new InvalidArgumentException(\sprintf('Parameter "%s" is not defined.', $name)); } return $config[$name]; diff --git a/recovery/common/src/DependencyInjection/ContainerInterface.php b/recovery/common/src/DependencyInjection/ContainerInterface.php index 4d832c310db..2c50ccd7d91 100644 --- a/recovery/common/src/DependencyInjection/ContainerInterface.php +++ b/recovery/common/src/DependencyInjection/ContainerInterface.php @@ -1,4 +1,5 @@ IOHelper->writeln('=== Shop Information ==='); $shop->locale = $this->askForShopShopLocale(Locale::getValidLocales(), $shop->locale); - $shop->host = $this->IOHelper->ask(sprintf('Shop host (%s): ', $shop->host), $shop->host); - $shop->basePath = $this->IOHelper->ask(sprintf('Shop base path (%s): ', $shop->basePath), $shop->basePath); - $shop->name = $this->IOHelper->ask(sprintf('Shop name (%s): ', $shop->name), $shop->name); - $shop->email = $this->IOHelper->ask(sprintf('Shop email (%s): ', $shop->email), $shop->email); + $shop->host = $this->IOHelper->ask(\sprintf('Shop host (%s): ', $shop->host), $shop->host); + $shop->basePath = $this->IOHelper->ask(\sprintf('Shop base path (%s): ', $shop->basePath), $shop->basePath); + $shop->name = $this->IOHelper->ask(\sprintf('Shop name (%s): ', $shop->name), $shop->name); + $shop->email = $this->IOHelper->ask(\sprintf('Shop email (%s): ', $shop->email), $shop->email); $question = new ChoiceQuestion( - sprintf('Shop currency (%s): ', $shop->currency), + \sprintf('Shop currency (%s): ', $shop->currency), Currency::getValidCurrencies(), $shop->currency ); @@ -404,7 +405,7 @@ protected function getConnectionInfoFromInteractiveShell( $pdo = $databaseFactory->createPDOConnection($databaseConnectionInformation); } catch (PDOException $e) { $IOHelper->writeln(''); - $IOHelper->writeln(sprintf('Got database error: %s', $e->getMessage())); + $IOHelper->writeln(\sprintf('Got database error: %s', $e->getMessage())); $IOHelper->writeln(''); $databaseConnectionInformation = $databaseInteractor->askDatabaseConnectionInformation( @@ -779,7 +780,7 @@ private function printStartMessage() $this->IOHelper->cls(); $this->IOHelper->printBanner(); - $this->IOHelper->writeln(sprintf('Welcome to the Shopware %s installer', $version)); + $this->IOHelper->writeln(\sprintf('Welcome to the Shopware %s installer', $version)); $this->IOHelper->writeln(''); $this->IOHelper->ask(new Question('Press return to start installation.', \PHP_EOL)); $this->IOHelper->cls(); diff --git a/recovery/install/src/Console/Application.php b/recovery/install/src/Console/Application.php index 9704b3d9cd3..b8f0f08edf8 100644 --- a/recovery/install/src/Console/Application.php +++ b/recovery/install/src/Console/Application.php @@ -1,4 +1,5 @@ setValidator( function ($answer) { if (trim($answer) === '') { @@ -151,7 +152,7 @@ protected function askForDatabaseUsername( if (empty($defaultUsername)) { $question = new Question('Please enter database user: '); } else { - $question = new Question(sprintf('Please enter database user (%s): ', $defaultUsername), $defaultUsername); + $question = new Question(\sprintf('Please enter database user (%s): ', $defaultUsername), $defaultUsername); } $question->setValidator( @@ -179,7 +180,7 @@ protected function askForDatabasePassword( if (empty($defaultPassword)) { $question = new Question('Please enter database password: '); } else { - $question = new Question(sprintf('Please enter database password: (%s): ', $defaultPassword), $defaultPassword); + $question = new Question(\sprintf('Please enter database password: (%s): ', $defaultPassword), $defaultPassword); } $databaseUser = $this->askQuestion($question); @@ -195,7 +196,7 @@ protected function askForDatabasePassword( private function askForDatabasePort( $defaultPort ) { - $question = new Question(sprintf('Please enter database port (%s): ', $defaultPort), $defaultPort); + $question = new Question(\sprintf('Please enter database port (%s): ', $defaultPort), $defaultPort); $question->setValidator( function ($answer) { if (trim($answer) === '') { diff --git a/recovery/install/src/MenuHelper.php b/recovery/install/src/MenuHelper.php index 0e9ce8ecd6a..fdedb782b22 100644 --- a/recovery/install/src/MenuHelper.php +++ b/recovery/install/src/MenuHelper.php @@ -1,4 +1,5 @@ sourceFile = $sourceFile; @@ -496,7 +497,7 @@ private function handleMaxCompatibleVersion(array $check) $maxCompatibleVersion = str_replace('.99', '', $check['maxCompatibleVersion']); $key = 'requirements_php_max_compatible_version'; - $check['notice'] = sprintf($this->translations->translate($key), $maxCompatibleVersion); + $check['notice'] = \sprintf($this->translations->translate($key), $maxCompatibleVersion); } return $check; diff --git a/recovery/install/src/RequirementsPath.php b/recovery/install/src/RequirementsPath.php index d57dea3159c..3cf0c8161ff 100644 --- a/recovery/install/src/RequirementsPath.php +++ b/recovery/install/src/RequirementsPath.php @@ -1,4 +1,5 @@ connection->exec( - sprintf( + \sprintf( '%s DATABASE `%s` CHARACTER SET `%s` COLLATE `%s`', $dbExists ? 'ALTER' : 'CREATE', $name, @@ -150,7 +151,7 @@ public function checkPrivilegeOnSchema($schema, $permissions) } if (!\is_string($permissions) && !\is_array($permissions)) { - $msg = sprintf('String or array expected, got: %s', \gettype($permissions)); + $msg = \sprintf('String or array expected, got: %s', \gettype($permissions)); throw new InvalidArgumentException($msg); } @@ -234,7 +235,7 @@ public function isSuperUser() public function checkUserPrivileges($privileges) { if (!\is_string($privileges) && !\is_array($privileges)) { - $msg = sprintf('String or array expected, got: %s', \gettype($privileges)); + $msg = \sprintf('String or array expected, got: %s', \gettype($privileges)); throw new InvalidArgumentException($msg); } diff --git a/recovery/install/src/Service/Exceptions/LicenseHostException.php b/recovery/install/src/Service/Exceptions/LicenseHostException.php index bc165076708..97e19c40db7 100644 --- a/recovery/install/src/Service/Exceptions/LicenseHostException.php +++ b/recovery/install/src/Service/Exceptions/LicenseHostException.php @@ -1,4 +1,5 @@ cls(); $ioService->printBanner(); $ioService->writeln('Welcome to the Shopware updater '); - $ioService->writeln(sprintf('Shopware Version %s', $version)); + $ioService->writeln(\sprintf('Shopware Version %s', $version)); $ioService->writeln(''); $ioService->ask('Press return to start the update.'); $ioService->cls(); @@ -110,7 +111,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $ioService->writeln(''); $ioService->writeln('The update has been finished succesfuly.'); $ioService->writeln('Your shop is currently in maintenance mode.'); - $ioService->writeln(sprintf('Please delete %s to finish the update.', UPDATE_ASSET_PATH)); + $ioService->writeln(\sprintf('Please delete %s to finish the update.', UPDATE_ASSET_PATH)); $ioService->writeln(''); return 0; diff --git a/recovery/update/src/Console/Application.php b/recovery/update/src/Console/Application.php index 754de325b08..39d19315680 100644 --- a/recovery/update/src/Console/Application.php +++ b/recovery/update/src/Console/Application.php @@ -1,4 +1,5 @@ authenticatedApiRequest('PUT', sprintf('/api/articles/%s', $productIdAperitif), [], $data); + $this->authenticatedApiRequest('PUT', \sprintf('/api/articles/%s', $productIdAperitif), [], $data); $response = $this->client->getResponse(); static::assertEquals(200, $response->getStatusCode()); $result = $response->getContent(); diff --git a/tests/Functional/Api/CustomerGroupTest.php b/tests/Functional/Api/CustomerGroupTest.php index 8fad9eddbd9..463584ed53c 100644 --- a/tests/Functional/Api/CustomerGroupTest.php +++ b/tests/Functional/Api/CustomerGroupTest.php @@ -1,4 +1,5 @@ authenticatedApiRequest('DELETE', sprintf('/api/customers/%d?useNumberAsId=1', $existingCustomerNumber)); + $this->authenticatedApiRequest('DELETE', \sprintf('/api/customers/%d?useNumberAsId=1', $existingCustomerNumber)); $response = $this->client->getResponse(); static::assertInstanceOf(Enlight_Controller_Response_ResponseTestCase::class, $response); @@ -407,7 +407,7 @@ public function testGetCustomerWithNumberAsIdWithDuplicateNumberThrowsException( static::assertFalse($response['success']); static::assertSame( - sprintf( + \sprintf( "Identifier 'number' with value '%s' for entity 'Shopware\Models\Customer\Customer' is not unique.", $existingCustomerNumber ), diff --git a/tests/Functional/Api/OrderTest.php b/tests/Functional/Api/OrderTest.php index f2b99a5f586..6b71c9c66af 100644 --- a/tests/Functional/Api/OrderTest.php +++ b/tests/Functional/Api/OrderTest.php @@ -1,4 +1,5 @@ add(new class() { + $cookieCollection->add(new class { }); return $cookieCollection; @@ -147,7 +147,7 @@ public static function addValidCookie(): CookieCollection public static function addInvalidCookieGroup(): CookieGroupCollection { $cookieGroupCollection = new CookieGroupCollection(); - $cookieGroupCollection->add(new class() { + $cookieGroupCollection->add(new class { }); return $cookieGroupCollection; diff --git a/tests/Functional/Bundle/CustomerSearchBundleDBAL/ConditionHandler/AccountModeConditionHandlerTest.php b/tests/Functional/Bundle/CustomerSearchBundleDBAL/ConditionHandler/AccountModeConditionHandlerTest.php index 249c25fbc3b..92376eeb923 100644 --- a/tests/Functional/Bundle/CustomerSearchBundleDBAL/ConditionHandler/AccountModeConditionHandlerTest.php +++ b/tests/Functional/Bundle/CustomerSearchBundleDBAL/ConditionHandler/AccountModeConditionHandlerTest.php @@ -1,4 +1,5 @@ $customerNumber, - 'email' => sprintf('%s@example.com', $customerNumber), + 'email' => \sprintf('%s@example.com', $customerNumber), 'active' => true, 'addresses' => array_map(static function ($id) { return ['country_id' => $id]; diff --git a/tests/Functional/Bundle/CustomerSearchBundleDBAL/HandlerRegistryTest.php b/tests/Functional/Bundle/CustomerSearchBundleDBAL/HandlerRegistryTest.php index a3e9207e4ca..7bbbb34a102 100644 --- a/tests/Functional/Bundle/CustomerSearchBundleDBAL/HandlerRegistryTest.php +++ b/tests/Functional/Bundle/CustomerSearchBundleDBAL/HandlerRegistryTest.php @@ -1,4 +1,5 @@ createDummyProduct(); - $testProduct->setName(sprintf('%s Update', $testProduct->getName())); + $testProduct->setName(\sprintf('%s Update', $testProduct->getName())); $this->modelManager->persist($testProduct); $this->modelManager->flush(); diff --git a/tests/Functional/Bundle/EmotionBundle/ComponentHandler/EventComponentHandlerTest.php b/tests/Functional/Bundle/EmotionBundle/ComponentHandler/EventComponentHandlerTest.php index a566e046f4d..02e0caec351 100644 --- a/tests/Functional/Bundle/EmotionBundle/ComponentHandler/EventComponentHandlerTest.php +++ b/tests/Functional/Bundle/EmotionBundle/ComponentHandler/EventComponentHandlerTest.php @@ -1,4 +1,5 @@ builder = new LogEntryBuilder($this->entityManager); $this->repository = $this->entityManager->getRepository(Log::class); - $oneDay = new DateInterval(sprintf('P%dD', 1)); + $oneDay = new DateInterval(\sprintf('P%dD', 1)); $this->pastDate = new DateTime(self::PAST_DATE); $this->pastDatePlusOneDay = (new DateTime(self::PAST_DATE))->add($oneDay); $this->currentDate = new DateTime('now'); @@ -137,8 +137,8 @@ public function testUniqueConstraintIsCaseSensitive(): void $secondMail->setBodyText($firstMail->getBodyText()->getRawContent()); // Try to create log entries with addresses the MySQL UNIQUE-constraint would treat as equal. - $secondMail->addTo(sprintf('%s ', $firstMail->getRecipients()[0])); - $secondMail->addTo(sprintf(' %s ', $firstMail->getRecipients()[0])); + $secondMail->addTo(\sprintf('%s ', $firstMail->getRecipients()[0])); + $secondMail->addTo(\sprintf(' %s ', $firstMail->getRecipients()[0])); $secondMail->addTo(ucfirst($firstMail->getRecipients()[0])); $first = $this->builder->build($firstMail); diff --git a/tests/Functional/Bundle/MailBundle/MailBundleTestTrait.php b/tests/Functional/Bundle/MailBundle/MailBundleTestTrait.php index d59a204ce05..b6e92d38323 100644 --- a/tests/Functional/Bundle/MailBundle/MailBundleTestTrait.php +++ b/tests/Functional/Bundle/MailBundle/MailBundleTestTrait.php @@ -39,7 +39,7 @@ public function createSimpleMail(): Enlight_Components_Mail $contentText = 'Lorem ipsum dolor sit amet.'; for ($i = 0; $i < 3; ++$i) { - $recipients[] = sprintf('test-%d@example.com', $i); + $recipients[] = \sprintf('test-%d@example.com', $i); } $mail->setSubject($subject); diff --git a/tests/Functional/Bundle/MediaBundle/FilesystemTest.php b/tests/Functional/Bundle/MediaBundle/FilesystemTest.php index 82cbf25e27a..e09abee8410 100644 --- a/tests/Functional/Bundle/MediaBundle/FilesystemTest.php +++ b/tests/Functional/Bundle/MediaBundle/FilesystemTest.php @@ -1,4 +1,5 @@ getNumber()); }); } diff --git a/tests/Functional/Bundle/SearchBundle/BatchProductSearchTest.php b/tests/Functional/Bundle/SearchBundle/BatchProductSearchTest.php index e7f75aa901f..49594a5f7e1 100644 --- a/tests/Functional/Bundle/SearchBundle/BatchProductSearchTest.php +++ b/tests/Functional/Bundle/SearchBundle/BatchProductSearchTest.php @@ -139,7 +139,7 @@ public function testWithLessProductsThanRequested(): void private function assertProductNumbersExists(array $result, array $numbers): void { array_walk($numbers, function ($number) use ($result) { - static::assertArrayHasKey($number, $result, sprintf('Expected "%s" to be in [%s]', $number, implode(', ', array_keys($result)))); + static::assertArrayHasKey($number, $result, \sprintf('Expected "%s" to be in [%s]', $number, implode(', ', array_keys($result)))); static::assertNotNull($result[$number]); static::assertSame($number, $result[$number]->getNumber()); }); diff --git a/tests/Functional/Bundle/SearchBundle/Condition/VariantConditionWithCurrencyFactor.php b/tests/Functional/Bundle/SearchBundle/Condition/VariantConditionWithCurrencyFactor.php index 03cc66c0131..12d1e93340c 100644 --- a/tests/Functional/Bundle/SearchBundle/Condition/VariantConditionWithCurrencyFactor.php +++ b/tests/Functional/Bundle/SearchBundle/Condition/VariantConditionWithCurrencyFactor.php @@ -528,10 +528,10 @@ private function assertPriceCount( $expectedCheapestPriceNumbers = array_keys($prices['cheapestPrice']); foreach ($numbers as $number) { - static::assertContains($number, $expectedCheapestPriceNumbers, sprintf('Cheapest price of product with number: `%s` found but not expected', $number)); + static::assertContains($number, $expectedCheapestPriceNumbers, \sprintf('Cheapest price of product with number: `%s` found but not expected', $number)); } foreach ($expectedCheapestPriceNumbers as $number) { - static::assertContains($number, $numbers, sprintf('Expected cheapest price of product with number: `%s` not found', $number)); + static::assertContains($number, $numbers, \sprintf('Expected cheapest price of product with number: `%s` not found', $number)); } static::assertCount(\count($expectedCheapestPriceNumbers), $products); @@ -540,10 +540,10 @@ private function assertPriceCount( $expectedPseudoPriceNumbers = array_keys($prices['pseudoPrice']); foreach ($numbers as $number) { - static::assertContains($number, $expectedPseudoPriceNumbers, sprintf('Pseudo price of product with number: `%s` found but not expected', $number)); + static::assertContains($number, $expectedPseudoPriceNumbers, \sprintf('Pseudo price of product with number: `%s` found but not expected', $number)); } foreach ($expectedPseudoPriceNumbers as $number) { - static::assertContains($number, $numbers, sprintf('Expected pseudo price of product with number: `%s` not found', $number)); + static::assertContains($number, $numbers, \sprintf('Expected pseudo price of product with number: `%s` not found', $number)); } static::assertCount(\count($expectedPseudoPriceNumbers), $products); diff --git a/tests/Functional/Bundle/SearchBundleDBAL/SearchIndexerTest.php b/tests/Functional/Bundle/SearchBundleDBAL/SearchIndexerTest.php index 9a5a152bdbf..1bb3ca0d36d 100644 --- a/tests/Functional/Bundle/SearchBundleDBAL/SearchIndexerTest.php +++ b/tests/Functional/Bundle/SearchBundleDBAL/SearchIndexerTest.php @@ -1,4 +1,5 @@ buildQuery(self::SEARCH_TERM); if (!($query instanceof QueryBuilder)) { - static::fail(sprintf('Instance of %s expected.', QueryBuilder::class)); + static::fail(\sprintf('Instance of %s expected.', QueryBuilder::class)); } $stmt = $query->execute(); @@ -59,7 +59,7 @@ public function testRankingQueryDoesNotConsiderInactiveProducts(): void $product = $productRepository->find($bestMatch['product_id']); if (!($product instanceof Article)) { - static::fail(sprintf('Instance of %s expected.', Article::class)); + static::fail(\sprintf('Instance of %s expected.', Article::class)); } $product->setActive(false); diff --git a/tests/Functional/Bundle/SitemapBundle/SitemapLockTest.php b/tests/Functional/Bundle/SitemapBundle/SitemapLockTest.php index 55f548d72ed..1f48c30c06a 100644 --- a/tests/Functional/Bundle/SitemapBundle/SitemapLockTest.php +++ b/tests/Functional/Bundle/SitemapBundle/SitemapLockTest.php @@ -1,4 +1,5 @@ getProducts()); foreach ($numbers as $number) { - static::assertContains($number, $expectedNumbers, sprintf('Product with number: `%s` found but not expected', $number)); + static::assertContains($number, $expectedNumbers, \sprintf('Product with number: `%s` found but not expected', $number)); } foreach ($expectedNumbers as $number) { - static::assertContains($number, $numbers, sprintf('Expected product number: `%s` not found', $number)); + static::assertContains($number, $numbers, \sprintf('Expected product number: `%s` not found', $number)); } static::assertCount(\count($expectedNumbers), $result->getProducts()); @@ -241,7 +241,7 @@ protected function assertSearchResultSorting( static::assertEquals( $expectedProduct, $product->getNumber(), - sprintf( + \sprintf( 'Expected %s at search result position %s, but got product %s', $expectedProduct, $index, diff --git a/tests/Functional/Bundle/StoreFrontBundle/VoteTest.php b/tests/Functional/Bundle/StoreFrontBundle/VoteTest.php index b47c716141c..2b6bac6e1c1 100644 --- a/tests/Functional/Bundle/StoreFrontBundle/VoteTest.php +++ b/tests/Functional/Bundle/StoreFrontBundle/VoteTest.php @@ -223,14 +223,14 @@ private function assertShopVotes(string $number, array $points = [], array $expe if (\array_key_exists('count', $data)) { $votes = $service->get($product, $context); static::assertIsArray($votes); - static::assertCount($data['count'], $votes, sprintf('Vote count %s for shop %s of product %s not match', $data['count'], $shopId, $product->getNumber())); + static::assertCount($data['count'], $votes, \sprintf('Vote count %s for shop %s of product %s not match', $data['count'], $shopId, $product->getNumber())); } // validates provided average value of provided shop if (\array_key_exists('average', $data)) { $average = $service->getAverage($product, $context); static::assertInstanceOf(VoteAverage::class, $average); - static::assertEquals($data['average'], $average->getAverage(), sprintf('Vote average %s for shop %s of product %s not match', $data['average'], $shopId, $product->getNumber())); + static::assertEquals($data['average'], $average->getAverage(), \sprintf('Vote average %s for shop %s of product %s not match', $data['average'], $shopId, $product->getNumber())); } if (\array_key_exists('points', $data)) { @@ -243,8 +243,8 @@ private function assertShopVotes(string $number, array $points = [], array $expe } foreach ($data['points'] as $point => $count) { - static::assertArrayHasKey($point, $actual, sprintf('Point count for points %s not exist', $point)); - static::assertEquals($count, $actual[$point], sprintf('Expected %s times votes with points %s', $count, $point)); + static::assertArrayHasKey($point, $actual, \sprintf('Point count for points %s not exist', $point)); + static::assertEquals($count, $actual[$point], \sprintf('Expected %s times votes with points %s', $count, $point)); } } } diff --git a/tests/Functional/Components/Api/ArticleTest.php b/tests/Functional/Components/Api/ArticleTest.php index 686c503f2c8..b29e3089d5d 100644 --- a/tests/Functional/Components/Api/ArticleTest.php +++ b/tests/Functional/Components/Api/ArticleTest.php @@ -2880,7 +2880,7 @@ static function (ProductAttribute $createdAttribute) { static::assertNull( $productRepository->find($createdProductId), - sprintf( + \sprintf( 'Deletion of the product (id = %s) itself failed.', $createdProductId ) @@ -2892,7 +2892,7 @@ static function (ProductAttribute $createdAttribute) { $detailRepository->findBy([ 'id' => $createdDetailIds, ]), - sprintf( + \sprintf( 'Deletion of the product\'s (id = %s) details (%s) failed.', $createdProductId, implode(', ', $createdDetailIds) @@ -2901,7 +2901,7 @@ static function (ProductAttribute $createdAttribute) { static::assertCount( 0, $attributeRepository->findBy(['id' => $createdAttributeIds]), - sprintf( + \sprintf( "Deletion of the product's (id = %s) details' (%s) attributes (%s) failed.", $createdProductId, implode(', ', $createdDetailIds), diff --git a/tests/Functional/Components/Api/CustomerStreamTest.php b/tests/Functional/Components/Api/CustomerStreamTest.php index 237ca2a4ce0..b13eb02e608 100644 --- a/tests/Functional/Components/Api/CustomerStreamTest.php +++ b/tests/Functional/Components/Api/CustomerStreamTest.php @@ -1,4 +1,5 @@ getPrice()), - sprintf($messageTemplate, 'Price', $result->getPrice()) + \sprintf($messageTemplate, 'Price', $result->getPrice()) ); static::assertFalse( is_nan($result->getNetPrice()), - sprintf($messageTemplate, 'NetPrice', $result->getNetPrice()) + \sprintf($messageTemplate, 'NetPrice', $result->getNetPrice()) ); static::assertFalse( is_nan($result->getTax()), - sprintf($messageTemplate, 'Tax', $result->getTax()) + \sprintf($messageTemplate, 'Tax', $result->getTax()) ); } diff --git a/tests/Functional/Components/CheckoutTestCase.php b/tests/Functional/Components/CheckoutTestCase.php index b93cab1b6ab..b4e286d8ae9 100644 --- a/tests/Functional/Components/CheckoutTestCase.php +++ b/tests/Functional/Components/CheckoutTestCase.php @@ -156,7 +156,7 @@ protected function hasBasketItem(array $sBasket, string $itemName, float $itemPr } if (!$cartItemFound) { - static::fail(sprintf('Cart item by name "%s" not found', $itemName)); + static::fail(\sprintf('Cart item by name "%s" not found', $itemName)); } } diff --git a/tests/Functional/Components/DependencyInjection/ContainerTest.php b/tests/Functional/Components/DependencyInjection/ContainerTest.php index b508e503b32..aef5fe93959 100644 --- a/tests/Functional/Components/DependencyInjection/ContainerTest.php +++ b/tests/Functional/Components/DependencyInjection/ContainerTest.php @@ -1,4 +1,5 @@ get('events')->addListener(sprintf('Enlight_Bootstrap_InitResource_%s', PrivateTestService::class), function () use (&$privateCalled) { + $testContainer->get('events')->addListener(\sprintf('Enlight_Bootstrap_InitResource_%s', PrivateTestService::class), function () use (&$privateCalled) { $privateCalled = true; }); $publicCalled = false; - $testContainer->get('events')->addListener(sprintf('Enlight_Bootstrap_InitResource_%s', PublicTestService::class), function () use (&$publicCalled) { + $testContainer->get('events')->addListener(\sprintf('Enlight_Bootstrap_InitResource_%s', PublicTestService::class), function () use (&$publicCalled) { $publicCalled = true; }); diff --git a/tests/Functional/Components/DependencyInjection/OriginalService.php b/tests/Functional/Components/DependencyInjection/OriginalService.php index fe9685f5bc5..ca6de3cd1e2 100644 --- a/tests/Functional/Components/DependencyInjection/OriginalService.php +++ b/tests/Functional/Components/DependencyInjection/OriginalService.php @@ -1,4 +1,5 @@ Db()->fetchOne(sprintf('show columns FROM %s WHERE `Field` = ?', $table), [$column])); + static::assertTrue((bool) Shopware()->Db()->fetchOne(\sprintf('show columns FROM %s WHERE `Field` = ?', $table), [$column])); } } diff --git a/tests/Functional/Components/Plugin/TestCase.php b/tests/Functional/Components/Plugin/TestCase.php index 489b4151e58..6cffa3644a6 100644 --- a/tests/Functional/Components/Plugin/TestCase.php +++ b/tests/Functional/Components/Plugin/TestCase.php @@ -1,4 +1,5 @@ $set) { - static::fail(sprintf('Password does not contain following set: %s', $kind)); + static::fail(\sprintf('Password does not contain following set: %s', $kind)); } } diff --git a/tests/Functional/Components/ReflectionHelperTest.php b/tests/Functional/Components/ReflectionHelperTest.php index 96585b5b6e5..1d84d63cd13 100644 --- a/tests/Functional/Components/ReflectionHelperTest.php +++ b/tests/Functional/Components/ReflectionHelperTest.php @@ -1,4 +1,5 @@ getContainer()->get('events')->addListener('Shopware_Analytics_ShopStatisticTurnover', function (Enlight_Event_EventArgs $args) { $queryBuilder = $args->getReturn(); - $queryBuilder->addSelect(sprintf('COUNT(orders.id) as %s', self::TEST_SELECT_KEY)); + $queryBuilder->addSelect(\sprintf('COUNT(orders.id) as %s', self::TEST_SELECT_KEY)); }); $request = new Enlight_Controller_Request_RequestTestCase(); diff --git a/tests/Functional/Controllers/Backend/ApplicationTest.php b/tests/Functional/Controllers/Backend/ApplicationTest.php index aa7e51bb3ef..ad15d2d3236 100644 --- a/tests/Functional/Controllers/Backend/ApplicationTest.php +++ b/tests/Functional/Controllers/Backend/ApplicationTest.php @@ -1,4 +1,5 @@ getParameter('kernel.environment'); // test filtering - $file = sprintf('core_%s', $environment); + $file = \sprintf('core_%s', $environment); $this->Request()->setParams([ 'limit' => 1, 'query' => $file, diff --git a/tests/Functional/Controllers/Backend/MailTest.php b/tests/Functional/Controllers/Backend/MailTest.php index 97e851769f4..789e9e25626 100644 --- a/tests/Functional/Controllers/Backend/MailTest.php +++ b/tests/Functional/Controllers/Backend/MailTest.php @@ -1,4 +1,5 @@ null, 'expression' => null, ]); - $query_params = urlencode(sprintf('[%s]', $filter)); + $query_params = urlencode(\sprintf('[%s]', $filter)); $this->dispatch('backend/supplier/getSuppliers?filter=' . $query_params); static::assertTrue($this->View()->getAssign('success')); diff --git a/tests/Functional/Controllers/Backend/UserManagerTest.php b/tests/Functional/Controllers/Backend/UserManagerTest.php index bdfb4f2ca02..a92d1a1f534 100644 --- a/tests/Functional/Controllers/Backend/UserManagerTest.php +++ b/tests/Functional/Controllers/Backend/UserManagerTest.php @@ -178,7 +178,7 @@ public function testUserEdit(): string $user = $this->getUserByUsername($username); - $randomName = sprintf('RandomName_%s', md5((string) rand(0, time()))); + $randomName = \sprintf('RandomName_%s', md5((string) rand(0, time()))); static::assertGreaterThan(0, $user['id']); @@ -212,7 +212,7 @@ public function testUserDelete(): void static::assertTrue( $this->View()->getAssign('success'), - sprintf( + \sprintf( 'User %s with id %s not found', $user['id'], $user['username'] diff --git a/tests/Functional/Controllers/Backend/_assets/getProductVariantsParams.php b/tests/Functional/Controllers/Backend/_assets/getProductVariantsParams.php index 1ad646bc6fe..cd64f3e8442 100644 --- a/tests/Functional/Controllers/Backend/_assets/getProductVariantsParams.php +++ b/tests/Functional/Controllers/Backend/_assets/getProductVariantsParams.php @@ -1,4 +1,5 @@ dispatch(sprintf(self::CATEGORY_LINK, 14)); + $this->dispatch(\sprintf(self::CATEGORY_LINK, 14)); static::assertSame(Response::HTTP_OK, $this->Response()->getHttpResponseCode()); } public function testDispatchExistingCategoryWithPageNotAvailable(): void { $this->expectException(Enlight_Controller_Exception::class); - $this->dispatch(sprintf(self::CATEGORY_LINK . '&sPage=2', 14)); + $this->dispatch(\sprintf(self::CATEGORY_LINK . '&sPage=2', 14)); static::assertSame(Response::HTTP_OK, $this->Response()->getHttpResponseCode()); } @@ -72,7 +72,7 @@ public function testDispatchExistingCategoryWithPageNotAvailable(): void public function testDispatchNonExistingCategory(): void { $this->expectException('Enlight_Exception'); - $this->dispatch(sprintf(self::CATEGORY_LINK, 4711)); + $this->dispatch(\sprintf(self::CATEGORY_LINK, 4711)); static::assertSame(Response::HTTP_NOT_FOUND, $this->Response()->getHttpResponseCode()); static::assertTrue($this->Response()->isRedirect()); } @@ -83,7 +83,7 @@ public function testDispatchNonExistingCategory(): void public function testDispatchEmptyCategoryId(): void { $this->expectException('Enlight_Exception'); - $this->dispatch(sprintf(self::CATEGORY_LINK, '')); + $this->dispatch(\sprintf(self::CATEGORY_LINK, '')); static::assertSame(Response::HTTP_NOT_FOUND, $this->Response()->getHttpResponseCode()); static::assertTrue($this->Response()->isRedirect()); } @@ -94,7 +94,7 @@ public function testDispatchEmptyCategoryId(): void public function testDispatchSubshopCategoryId(): void { $this->expectException('Enlight_Exception'); - $this->dispatch(sprintf(self::CATEGORY_LINK, 43)); + $this->dispatch(\sprintf(self::CATEGORY_LINK, 43)); static::assertSame(Response::HTTP_NOT_FOUND, $this->Response()->getHttpResponseCode()); static::assertTrue($this->Response()->isRedirect()); } @@ -105,7 +105,7 @@ public function testDispatchSubshopCategoryId(): void public function testDispatchBlogCategory(): void { $this->expectException('Enlight_Exception'); - $this->dispatch(sprintf(self::CATEGORY_LINK, 17)); + $this->dispatch(\sprintf(self::CATEGORY_LINK, 17)); static::assertSame(Response::HTTP_NOT_FOUND, $this->Response()->getHttpResponseCode()); static::assertTrue($this->Response()->isRedirect()); } @@ -119,7 +119,7 @@ public function testExternalLink(): void $this->modelManager->persist($category); $this->modelManager->flush($category); - $this->dispatch(sprintf(self::CATEGORY_LINK, $category->getId())); + $this->dispatch(\sprintf(self::CATEGORY_LINK, $category->getId())); static::assertSame(Response::HTTP_MOVED_PERMANENTLY, $this->Response()->getHttpResponseCode()); static::assertTrue($this->Response()->isRedirect()); @@ -150,7 +150,7 @@ public function testCategoryRedirectToProductDetailPageDirectly(): void $this->modelManager->flush($product); $this->modelManager->clear(); - $this->dispatch(sprintf(self::CATEGORY_LINK, $category->getId())); + $this->dispatch(\sprintf(self::CATEGORY_LINK, $category->getId())); static::assertSame(Response::HTTP_MOVED_PERMANENTLY, $this->Response()->getHttpResponseCode()); static::assertTrue($this->Response()->isRedirect()); @@ -174,7 +174,7 @@ public function testHomeRedirect(): void static::assertInstanceOf(Category::class, $mainCategory); $mainCategoryId = $mainCategory->getId(); - $this->dispatch(sprintf(self::CATEGORY_LINK, $mainCategoryId)); + $this->dispatch(\sprintf(self::CATEGORY_LINK, $mainCategoryId)); static::assertSame(Response::HTTP_MOVED_PERMANENTLY, $this->Response()->getHttpResponseCode()); } @@ -221,7 +221,7 @@ public function testCategoryWithProductStream(): void $connection->executeStatement($createCategoryWithStreamSQL, ['streamId' => $streamId]); $categoryId = (int) $connection->lastInsertId(); - $this->dispatch(sprintf(self::CATEGORY_LINK, $categoryId)); + $this->dispatch(\sprintf(self::CATEGORY_LINK, $categoryId)); static::assertSame(Response::HTTP_OK, $this->Response()->getHttpResponseCode()); $responseBody = $this->Response()->getBody(); diff --git a/tests/Functional/Controllers/Frontend/RegisterWithCaptchaTest.php b/tests/Functional/Controllers/Frontend/RegisterWithCaptchaTest.php index 338fe56ed68..b824d5719a2 100644 --- a/tests/Functional/Controllers/Frontend/RegisterWithCaptchaTest.php +++ b/tests/Functional/Controllers/Frontend/RegisterWithCaptchaTest.php @@ -159,7 +159,7 @@ public function testInvalidDefault(): void private function saveRegisterCaptchaConfig(string $value): void { - $formattedValue = sprintf('s:%d:"%s";', \strlen($value), $value); + $formattedValue = \sprintf('s:%d:"%s";', \strlen($value), $value); $this->getContainer()->get(Connection::class)->executeQuery( 'UPDATE s_core_config_elements SET value = ? WHERE name = ?', [$formattedValue, 'registerCaptcha'] diff --git a/tests/Functional/Controllers/Frontend/ResetPasswordWithCaptchaTest.php b/tests/Functional/Controllers/Frontend/ResetPasswordWithCaptchaTest.php index 879dcb390ae..ca7bb2a4ac4 100644 --- a/tests/Functional/Controllers/Frontend/ResetPasswordWithCaptchaTest.php +++ b/tests/Functional/Controllers/Frontend/ResetPasswordWithCaptchaTest.php @@ -153,7 +153,7 @@ public function testInvalidHoneypot(): void private function savePasswordResetCaptchaConfig(string $value): void { - $formattedValue = sprintf('s:%d:"%s";', \strlen($value), $value); + $formattedValue = \sprintf('s:%d:"%s";', \strlen($value), $value); $this->getContainer()->get(Connection::class)->executeQuery( 'UPDATE s_core_config_elements SET value = ? WHERE name = ?', [$formattedValue, 'passwordResetCaptcha'] diff --git a/tests/Functional/Controllers/Frontend/SearchTest.php b/tests/Functional/Controllers/Frontend/SearchTest.php index 7f758a40078..786a5a77284 100644 --- a/tests/Functional/Controllers/Frontend/SearchTest.php +++ b/tests/Functional/Controllers/Frontend/SearchTest.php @@ -100,13 +100,13 @@ public function testAjaxSearch(): void */ public function testSearchEscapes(string $term, string $filtered): void { - $this->dispatch(sprintf('search?sSearch=%s', $term)); + $this->dispatch(\sprintf('search?sSearch=%s', $term)); $body = $this->Response()->getBody(); static::assertIsString($body); - static::assertStringContainsString($filtered, $body, sprintf('Expected filtered term "%s" not found on search page', $filtered)); - static::assertStringNotContainsString($term, $body, sprintf('Malicious term "%s" found on search page', $term)); + static::assertStringContainsString($filtered, $body, \sprintf('Expected filtered term "%s" not found on search page', $filtered)); + static::assertStringNotContainsString($term, $body, \sprintf('Malicious term "%s" found on search page', $term)); } /** diff --git a/tests/Functional/Controllers/Frontend/fixtures/captchaRequest.php b/tests/Functional/Controllers/Frontend/fixtures/captchaRequest.php index 5c7f0902dc3..1b6f44c4a97 100644 --- a/tests/Functional/Controllers/Frontend/fixtures/captchaRequest.php +++ b/tests/Functional/Controllers/Frontend/fixtures/captchaRequest.php @@ -1,4 +1,5 @@ cacheDir)) { if (@mkdir($this->cacheDir, 0777, true) === false) { - throw new RuntimeException(sprintf("Unable to create directory '%s'\n", $this->cacheDir)); + throw new RuntimeException(\sprintf("Unable to create directory '%s'\n", $this->cacheDir)); } } elseif (!is_writable($this->cacheDir)) { - throw new RuntimeException(sprintf("Unable to write in directory '%s'\n", $this->cacheDir)); + throw new RuntimeException(\sprintf("Unable to write in directory '%s'\n", $this->cacheDir)); } $this->connection = $this->getContainer()->get('dbal_connection'); diff --git a/tests/Functional/Core/RewriteTest.php b/tests/Functional/Core/RewriteTest.php index 478bbf2d656..84c1cbc56c1 100644 --- a/tests/Functional/Core/RewriteTest.php +++ b/tests/Functional/Core/RewriteTest.php @@ -1,4 +1,5 @@ DocPath(), $localName)); + static::assertFileExists(\sprintf('%s/engine/Library/Zend/Locale/Data/%s.xml', Shopware()->DocPath(), $localName)); } /** diff --git a/tests/Functional/Models/Article/DetailTest.php b/tests/Functional/Models/Article/DetailTest.php index 8797641de04..468cbbbb98c 100644 --- a/tests/Functional/Models/Article/DetailTest.php +++ b/tests/Functional/Models/Article/DetailTest.php @@ -152,6 +152,6 @@ private function internalTestChangingOrderNumberRegexIsWorking(string $regex, st $violations = $this->em->validate($detail); - static::assertEquals(0, $violations->count(), sprintf('Number "%s" does not match regex "%s"', $number, $regex)); + static::assertEquals(0, $violations->count(), \sprintf('Number "%s" does not match regex "%s"', $number, $regex)); } } diff --git a/tests/Functional/Models/_assets/keywords.php b/tests/Functional/Models/_assets/keywords.php index 7b7fdb37ef4..785e80728de 100644 --- a/tests/Functional/Models/_assets/keywords.php +++ b/tests/Functional/Models/_assets/keywords.php @@ -1,4 +1,5 @@ 'frontend', 'controller' => 'blog', 'action' => 'index', - 'sCategory' => sprintf('%d', $blog->getCategoryId()), + 'sCategory' => \sprintf('%d', $blog->getCategoryId()), ]); return $request; @@ -190,7 +190,7 @@ private function getBlogRequest(Blog $blog): Enlight_Controller_Request_RequestT 'module' => 'frontend', 'controller' => 'blog', 'action' => 'detail', - 'blogArticle' => sprintf('%d', $blog->getId()), + 'blogArticle' => \sprintf('%d', $blog->getId()), ]); return $request; @@ -235,7 +235,7 @@ private function getCategoryRequest(Category $category): Enlight_Controller_Requ 'module' => 'frontend', 'controller' => 'listing', 'action' => 'index', - 'sCategory' => sprintf('%d', $category->getId()), + 'sCategory' => \sprintf('%d', $category->getId()), ]); return $request; @@ -291,7 +291,7 @@ private function getProductRequest(Product $product): Enlight_Controller_Request 'module' => 'frontend', 'controller' => 'detail', 'action' => 'index', - 'sArticle' => sprintf('%d', $product->getId()), + 'sArticle' => \sprintf('%d', $product->getId()), 'number' => $product->getMainDetail()->getNumber(), ]); diff --git a/tests/Functional/Plugins/Core/MarketingAggregate/AbstractMarketing.php b/tests/Functional/Plugins/Core/MarketingAggregate/AbstractMarketing.php index b64aa212006..70b520f97a0 100644 --- a/tests/Functional/Plugins/Core/MarketingAggregate/AbstractMarketing.php +++ b/tests/Functional/Plugins/Core/MarketingAggregate/AbstractMarketing.php @@ -1,4 +1,5 @@ getContainer()->get(Connection::class)->executeQuery( 'UPDATE s_core_config_elements SET value = ? WHERE name = ?', [$formattedValue, 'notificationCaptchaConfig'] diff --git a/tests/Functional/Recovery/Update/UpdateHtaccessTest.php b/tests/Functional/Recovery/Update/UpdateHtaccessTest.php index 4b3f17c37a1..3cb1cf7db8d 100644 --- a/tests/Functional/Recovery/Update/UpdateHtaccessTest.php +++ b/tests/Functional/Recovery/Update/UpdateHtaccessTest.php @@ -308,7 +308,7 @@ public function testCombination(string $currentHtaccess, ?string $newHtaccess, s static::assertSame( $expected, file_get_contents($tmpDir . '/.htaccess'), - sprintf('File hash is: %s', md5($currentHtaccess)) + \sprintf('File hash is: %s', md5($currentHtaccess)) ); } diff --git a/tests/Functional/Regressions/Ticket4788Test.php b/tests/Functional/Regressions/Ticket4788Test.php index 7f7fcad9cac..7413fb9c524 100644 --- a/tests/Functional/Regressions/Ticket4788Test.php +++ b/tests/Functional/Regressions/Ticket4788Test.php @@ -57,11 +57,11 @@ public function setUp(): void // Get a copy of article descriptions $ids = implode(', ', array_keys($this->articlesToTest)); - $sql = sprintf('SELECT `id`, `description_long`, `description` FROM s_articles WHERE `id` IN (%s)', $ids); + $sql = \sprintf('SELECT `id`, `description_long`, `description` FROM s_articles WHERE `id` IN (%s)', $ids); $this->backup = Shopware()->Db()->fetchAssoc($sql); // Update article description, set UTF-8 string - $sql = sprintf('UPDATE s_articles SET `description_long`= ?, `description` = ? WHERE `id` IN (%s)', $ids); + $sql = \sprintf('UPDATE s_articles SET `description_long`= ?, `description` = ? WHERE `id` IN (%s)', $ids); Shopware()->Db()->query($sql, [$this->longDescription, $this->shortDescription]); } @@ -76,7 +76,7 @@ protected function tearDown(): void $sql = ''; $values = []; foreach ($this->backup as $key => $fields) { - $sql .= sprintf('UPDATE s_articles SET `description_long` = ?, `description` = ? WHERE `id` = %s;', $key); + $sql .= \sprintf('UPDATE s_articles SET `description_long` = ?, `description` = ? WHERE `id` = %s;', $key); $values[] = $fields['description_long']; $values[] = $fields['description']; } @@ -115,7 +115,7 @@ public function testArticleLongDescriptionOnDetailPage(): void { // Check foreach ($this->articlesToTest as $articleId => $categoryId) { - $this->dispatch(sprintf('/detail/index/sArticle/%s', $articleId)); + $this->dispatch(\sprintf('/detail/index/sArticle/%s', $articleId)); $body = $this->Response()->getBody(); static::assertIsString($body); static::assertStringContainsString($this->longDescription, $body); diff --git a/tests/Functional/Traits/DatabaseTransactionBehaviour.php b/tests/Functional/Traits/DatabaseTransactionBehaviour.php index f34638e84f3..881e4e59d9d 100644 --- a/tests/Functional/Traits/DatabaseTransactionBehaviour.php +++ b/tests/Functional/Traits/DatabaseTransactionBehaviour.php @@ -1,4 +1,5 @@ Container()->get(Connection::class)->executeStatement($sql); diff --git a/tests/Functional/Traits/MigrationTestTrait.php b/tests/Functional/Traits/MigrationTestTrait.php index 2267477c359..8903740be41 100644 --- a/tests/Functional/Traits/MigrationTestTrait.php +++ b/tests/Functional/Traits/MigrationTestTrait.php @@ -54,7 +54,7 @@ public function createPDOConnection(): PDO $configPath = $rootDirectory . '/config.php'; if (!is_file($configPath)) { - throw new UnexpectedValueException(sprintf('Config file not found: %s', $configPath)); + throw new UnexpectedValueException(\sprintf('Config file not found: %s', $configPath)); } $config = require $configPath; @@ -76,7 +76,7 @@ private function getRootDirectory(): string $rootDirectory = realpath(__DIR__ . '/../../../'); if (!\is_string($rootDirectory)) { - throw new UnexpectedValueException(sprintf('Root directory not found: %s', $rootDirectory)); + throw new UnexpectedValueException(\sprintf('Root directory not found: %s', $rootDirectory)); } return $rootDirectory; diff --git a/tests/Functional/bootstrap.php b/tests/Functional/bootstrap.php index 05c26df66be..ff2a29b2628 100644 --- a/tests/Functional/bootstrap.php +++ b/tests/Functional/bootstrap.php @@ -1,4 +1,5 @@ getDriver()->executeScript( - sprintf($script, $contextNode ? $contextNode->getXpath() : '', $el->getXpath() + \sprintf($script, $contextNode ? $contextNode->getXpath() : '', $el->getXpath() ) ); } diff --git a/tests/Mink/Page/Backend/ContentTypeManager/Elements/SelectorScopedElement.php b/tests/Mink/Page/Backend/ContentTypeManager/Elements/SelectorScopedElement.php index 520bc7c202e..1d8cf855234 100644 --- a/tests/Mink/Page/Backend/ContentTypeManager/Elements/SelectorScopedElement.php +++ b/tests/Mink/Page/Backend/ContentTypeManager/Elements/SelectorScopedElement.php @@ -43,7 +43,7 @@ public function __construct(Session $session, Factory $factory) $parentType = \is_array($parentSelector) ? array_key_first($parentSelector) : 'css'; if ($childType !== $parentType) { - Helper::throwException(sprintf("Combining the parent element's %s selector with the child's %s selector won't work.", $parentType, $childType)); + Helper::throwException(\sprintf("Combining the parent element's %s selector with the child's %s selector won't work.", $parentType, $childType)); } return implode( diff --git a/tests/Mink/Page/Backend/CustomRecipes/CustomRecipes.php b/tests/Mink/Page/Backend/CustomRecipes/CustomRecipes.php index 97c818ecc8c..475dfc1d9b1 100644 --- a/tests/Mink/Page/Backend/CustomRecipes/CustomRecipes.php +++ b/tests/Mink/Page/Backend/CustomRecipes/CustomRecipes.php @@ -63,6 +63,6 @@ protected function verifyPage(): void return; } - throw new ElementNotFoundException(sprintf("Couldn't find '%s' on the current page", CustomRecipesListWindow::class)); + throw new ElementNotFoundException(\sprintf("Couldn't find '%s' on the current page", CustomRecipesListWindow::class)); } } diff --git a/tests/Mink/Page/Frontend/Account/Account.php b/tests/Mink/Page/Frontend/Account/Account.php index 6578bf20471..59f492900f4 100644 --- a/tests/Mink/Page/Frontend/Account/Account.php +++ b/tests/Mink/Page/Frontend/Account/Account.php @@ -281,7 +281,7 @@ public function checkPaymentMethod($paymentMethod) return; } - $message = sprintf( + $message = \sprintf( 'The current payment method is "%s" (should be "%s")', $result['value'], $result['value2'] @@ -342,7 +342,7 @@ public function checkAddress(string $type, string $address): void return; } - $message = sprintf( + $message = \sprintf( 'The addresses are different! ("%s" not was found in "%s")', $result['value2'], $result['value'] @@ -498,7 +498,7 @@ private function checkOrderNumber(AccountOrder $order, string $orderNumber): voi return; } - $message = sprintf( + $message = \sprintf( 'The order number is "%s" (should be "%s")', $result['value'], $result['value2'] @@ -534,7 +534,7 @@ private function checkOrderPositions(AccountOrder $order, array $articles) return; } - $message = sprintf( + $message = \sprintf( 'The %s of a position is different! (is "%s", should be "%s")', $result['key'], $result['value'], @@ -583,7 +583,7 @@ private function checkEsdArticles(string $date, array $articles) } if ($download === end($downloads)) { - $message = sprintf('ESD-Article "%s" not found in account!', $givenEsd); + $message = \sprintf('ESD-Article "%s" not found in account!', $givenEsd); Helper::throwException($message); } } diff --git a/tests/Mink/Page/Frontend/Blog/Blog.php b/tests/Mink/Page/Frontend/Blog/Blog.php index b9d9889eb3a..4d63fd7bdfd 100644 --- a/tests/Mink/Page/Frontend/Blog/Blog.php +++ b/tests/Mink/Page/Frontend/Blog/Blog.php @@ -108,7 +108,7 @@ public function checkComments(BlogComment $blogComments, string $average, array $messages = ['The following comments are wrong:']; foreach ($result as $evaluation) { - $messages[] = sprintf( + $messages[] = \sprintf( '%s - Bewertung: %s (%s is "%s", should be "%s")', $evaluation['properties']['author'], $evaluation['properties']['stars'], @@ -149,7 +149,7 @@ protected function checkRating(BlogComment $blogComments, string $average): void $result = Helper::checkArray($check); if ($result !== true) { - $message = sprintf('There was a different value of the rating! (%s: "%s" instead of "%s")', $result, $check[$result][0], $check[$result][1]); + $message = \sprintf('There was a different value of the rating! (%s: "%s" instead of "%s")', $result, $check[$result][0], $check[$result][1]); Helper::throwException($message); } } diff --git a/tests/Mink/Page/Frontend/Blog/Elements/BlogArticle.php b/tests/Mink/Page/Frontend/Blog/Elements/BlogArticle.php index 412758f165c..d888a206d42 100644 --- a/tests/Mink/Page/Frontend/Blog/Elements/BlogArticle.php +++ b/tests/Mink/Page/Frontend/Blog/Elements/BlogArticle.php @@ -170,7 +170,7 @@ protected function getUniqueTitle(array $titles): string if ($result !== true) { $messages = ['The blog article has different titles!']; foreach ($title as $key => $value) { - $messages[] = sprintf('"%s" (Key: "%s")', $value, $key); + $messages[] = \sprintf('"%s" (Key: "%s")', $value, $key); } Helper::throwException($messages); diff --git a/tests/Mink/Page/Frontend/Checkout/CheckoutCart.php b/tests/Mink/Page/Frontend/Checkout/CheckoutCart.php index 076c369ccc5..195a1aafef8 100644 --- a/tests/Mink/Page/Frontend/Checkout/CheckoutCart.php +++ b/tests/Mink/Page/Frontend/Checkout/CheckoutCart.php @@ -108,7 +108,7 @@ public function checkAggregation(array $aggregation): void $result = Helper::checkArray($check); if ($result !== true) { - $message = sprintf( + $message = \sprintf( 'The value of "%s" is "%s"! (should be "%s")', $result, $check[$result][1], @@ -178,7 +178,7 @@ public function fillCartWithProducts(array $items): void $originalPath = $this->path; foreach ($items as $item) { - $this->path = sprintf('/checkout/addArticle/sAdd/%s/sQuantity/%d', $item['number'], $item['quantity']); + $this->path = \sprintf('/checkout/addArticle/sAdd/%s/sQuantity/%d', $item['number'], $item['quantity']); $this->open(); } @@ -198,7 +198,7 @@ public function checkCartProducts(CartPositionProduct $cartPositions, array $ite if ($result !== true) { $messages = ['The following articles are wrong:']; foreach ($result as $product) { - $messages[] = sprintf( + $messages[] = \sprintf( '%s - %s (%s is "%s", should be "%s")', $product['properties']['number'], $product['properties']['name'], @@ -311,9 +311,9 @@ public function checkPositionTaxes(CartPositionRebate $cartPositionToCheck, arra { $positionText = $cartPositionToCheck->getText(); foreach ($taxValues as $taxValue) { - $taxString = sprintf('%s: %s', $taxValue['taxRate'], $taxValue['value']); + $taxString = \sprintf('%s: %s', $taxValue['taxRate'], $taxValue['value']); if (!str_contains($positionText, $taxString)) { - Helper::throwException(sprintf('Could not find tax "%s" in position "%s"', $taxString, $positionText)); + Helper::throwException(\sprintf('Could not find tax "%s" in position "%s"', $taxString, $positionText)); } } } @@ -331,14 +331,14 @@ private function getLabel(string $key, string $language): string if (str_contains($key, '%')) { $taxRate = (float) $key; - return sprintf($labels['tax'][$language], $taxRate); + return \sprintf($labels['tax'][$language], $taxRate); } if (isset($labels[$key][$language])) { return $labels[$key][$language]; } - $message = sprintf('Label "%s" is not defined for language key "%s"', $key, $language); + $message = \sprintf('Label "%s" is not defined for language key "%s"', $key, $language); Helper::throwException($message, Helper::EXCEPTION_PENDING); } @@ -355,7 +355,7 @@ private function getAggregationPosition(array $labels, string $labelKey, string } } - $message = sprintf('Label "%s" does not exist on the page! ("%s")', $labelKey, $givenLabel); + $message = \sprintf('Label "%s" does not exist on the page! ("%s")', $labelKey, $givenLabel); Helper::throwException($message); } } diff --git a/tests/Mink/Page/Frontend/Checkout/CheckoutConfirm.php b/tests/Mink/Page/Frontend/Checkout/CheckoutConfirm.php index 2f8d6d94dfe..6fe9c44d49b 100644 --- a/tests/Mink/Page/Frontend/Checkout/CheckoutConfirm.php +++ b/tests/Mink/Page/Frontend/Checkout/CheckoutConfirm.php @@ -198,7 +198,7 @@ public function checkPaymentMethod(string $paymentMethod): void return; } - $message = sprintf( + $message = \sprintf( 'The current payment method is "%s" (should be "%s")', $result['value'], $result['value2'] diff --git a/tests/Mink/Page/Frontend/Checkout/Elements/CartPositionProduct.php b/tests/Mink/Page/Frontend/Checkout/Elements/CartPositionProduct.php index 6d402adcbe7..3e140c90d6e 100644 --- a/tests/Mink/Page/Frontend/Checkout/Elements/CartPositionProduct.php +++ b/tests/Mink/Page/Frontend/Checkout/Elements/CartPositionProduct.php @@ -137,7 +137,7 @@ private function getUniqueName(array $names): string if ($result !== true) { $messages = ['The cart item has different names!']; foreach ($name as $key => $value) { - $messages[] = sprintf('"%s" (Key: "%s")', $value, $key); + $messages[] = \sprintf('"%s" (Key: "%s")', $value, $key); } Helper::throwException($messages); diff --git a/tests/Mink/Page/Frontend/Detail/Detail.php b/tests/Mink/Page/Frontend/Detail/Detail.php index e6ad5617566..28d8d2b0e57 100644 --- a/tests/Mink/Page/Frontend/Detail/Detail.php +++ b/tests/Mink/Page/Frontend/Detail/Detail.php @@ -172,7 +172,7 @@ public function checkEvaluations(ArticleEvaluation $articleEvaluations, string $ $messages = ['The following $evaluations are wrong:']; foreach ($result as $evaluation) { - $messages[] = sprintf( + $messages[] = \sprintf( '%s - Bewertung: %s (%s is "%s", should be "%s")', $evaluation['properties']['author'], $evaluation['properties']['stars'], @@ -194,7 +194,7 @@ public function configure(array $configuration): void $configuratorType = ''; foreach ($configuration as $group) { - $field = sprintf('group[%d]', $group['groupId']); + $field = \sprintf('group[%d]', $group['groupId']); $this->selectFieldOption($field, $group['value']); if ($configuratorType === 'select') { @@ -222,7 +222,7 @@ public function canNotSelectConfiguratorOption(string $configuratorOption, strin $group = $this->findField($configuratorGroup); if (empty($group)) { - $message = sprintf('Configurator group "%s" was not found!', $configuratorGroup); + $message = \sprintf('Configurator group "%s" was not found!', $configuratorGroup); Helper::throwException($message); } @@ -230,7 +230,7 @@ public function canNotSelectConfiguratorOption(string $configuratorOption, strin foreach ($options as $option) { if ($option->getText() === $configuratorOption) { - $message = sprintf('Configurator option %s founded but should not', $configuratorOption); + $message = \sprintf('Configurator option %s founded but should not', $configuratorOption); Helper::throwException($message); } } @@ -260,7 +260,7 @@ public function checkSelect(string $select, string $min, string $max, int $gradu $selectBox = $this->findField($select); if (empty($selectBox)) { - $message = sprintf('Select box "%s" was not found!', $select); + $message = \sprintf('Select box "%s" was not found!', $select); Helper::throwException($message); } @@ -273,7 +273,7 @@ public function checkSelect(string $select, string $min, string $max, int $gradu $unit = isset($parts[1]) ? ' ' . $parts[1] : ''; if ($optionText !== $min) { - $errors[] = sprintf('The first option of "%s" is "%s"! (should be "%s")', $select, $optionText, $min); + $errors[] = \sprintf('The first option of "%s" is "%s"! (should be "%s")', $select, $optionText, $min); } while ($option = next($options)) { @@ -281,7 +281,7 @@ public function checkSelect(string $select, string $min, string $max, int $gradu $value += $graduation; if ($optionText !== $value . $unit) { - $errors[] = sprintf( + $errors[] = \sprintf( 'There is the invalid option "%s" in "%s"! ("%s" expected)', $optionText, $select, @@ -291,7 +291,7 @@ public function checkSelect(string $select, string $min, string $max, int $gradu } if ($optionText !== $max) { - $errors[] = sprintf('The last option of "%s" is "%s"! (should be "%s")', $select, $value, $max); + $errors[] = \sprintf('The last option of "%s" is "%s"! (should be "%s")', $select, $value, $max); } if (!empty($errors)) { @@ -343,7 +343,7 @@ protected function checkRating(ArticleEvaluation $articleEvaluations, string $av $result = Helper::checkArray($check); if ($result !== true) { - $message = sprintf('There was a different value of the evaluation! (%s: "%s" instead of %s)', $result, $check[$result][0], $check[$result][1]); + $message = \sprintf('There was a different value of the evaluation! (%s: "%s" instead of %s)', $result, $check[$result][0], $check[$result][1]); Helper::throwException($message); } } diff --git a/tests/Mink/Page/Frontend/Generic/GenericPage.php b/tests/Mink/Page/Frontend/Generic/GenericPage.php index ea7025f4e2c..60b979cb995 100644 --- a/tests/Mink/Page/Frontend/Generic/GenericPage.php +++ b/tests/Mink/Page/Frontend/Generic/GenericPage.php @@ -84,7 +84,7 @@ public function checkLink(string $locator, ?string $path = null, array $query = $expectedUrlParts = parse_url($expectedUrl); if ($linkParts != $expectedUrlParts) { - $message = sprintf( + $message = \sprintf( 'Link "%s" does not match expected value "%s" while looking for ' . $locator, $link, $expectedUrl @@ -109,7 +109,7 @@ public function checkRobots(array $content = []): void $robotsParts = array_map('trim', $robotsParts); if ($robotsParts != $content) { - $message = sprintf( + $message = \sprintf( 'Canonical link "%s" does not match expected value "%s"', implode(', ', $robotsParts), implode(', ', $content) diff --git a/tests/Mink/Page/Frontend/Homepage/Homepage.php b/tests/Mink/Page/Frontend/Homepage/Homepage.php index d6f30534d78..706c3fae7b3 100644 --- a/tests/Mink/Page/Frontend/Homepage/Homepage.php +++ b/tests/Mink/Page/Frontend/Homepage/Homepage.php @@ -189,7 +189,7 @@ public function checkLinkedBanner(Banner $banner, $image, $link = null) return; } - $message = sprintf( + $message = \sprintf( 'The banner %s is "%s" (should be "%s")', $result['key'], $result['value'], @@ -245,7 +245,7 @@ public function checkBlogArticles(BlogArticle $blogArticle, $articles) } $message = [ - sprintf('The slides have a different %s!', $result['key']), + \sprintf('The slides have a different %s!', $result['key']), 'Given: ' . $result['value'], 'Expected: ' . $result['value2'], ]; @@ -293,7 +293,7 @@ public function checkSlider(SliderElement $slider, array $slides) } $message = [ - sprintf('The slides have a different %s!', $result['key']), + \sprintf('The slides have a different %s!', $result['key']), 'Given: ' . print_r($result['value'], true), 'Expected: ' . print_r($result['value2'], true), ]; @@ -324,7 +324,7 @@ public function checkManufacturerSlider(SliderElement $slider, array $slides) } $message = [ - sprintf('The slides have a different %s!', $result['key']), + \sprintf('The slides have a different %s!', $result['key']), 'Given: ' . print_r($result['value'], true), 'Expected: ' . print_r($result['value2'], true), ]; @@ -353,7 +353,7 @@ public function checkCategoryTeaser(CategoryTeaser $teaser, $name, $image, $link return; } - $message = sprintf( + $message = \sprintf( 'The category teaser %s is "%s" (should be "%s")', $result['key'], $result['value'], @@ -377,7 +377,7 @@ public function checkArticle(Article $article, array $data) return; } - $message = sprintf( + $message = \sprintf( 'The article %s is "%s" (should be "%s")', $result['key'], $result['value'], diff --git a/tests/Mink/Page/Frontend/Listing/Elements/Paging.php b/tests/Mink/Page/Frontend/Listing/Elements/Paging.php index 371c8aac88e..72027fb87f0 100644 --- a/tests/Mink/Page/Frontend/Listing/Elements/Paging.php +++ b/tests/Mink/Page/Frontend/Listing/Elements/Paging.php @@ -76,7 +76,7 @@ public function moveDirection($direction, $steps = 1) if ($result !== true) { Helper::throwException( - [sprintf('There is no more "%s" button! (after %d steps)', $direction, $i)] + [\sprintf('There is no more "%s" button! (after %d steps)', $direction, $i)] ); } @@ -91,7 +91,7 @@ public function moveToPage($page) { while (!$this->hasLink($page)) { if ($this->noElement('next', false)) { - $message = sprintf('Page %d was not found!', $page); + $message = \sprintf('Page %d was not found!', $page); Helper::throwException($message); } $this->moveDirection('next'); @@ -119,7 +119,7 @@ public function noElement($locator, $throwException = true) } if ($throwException) { - $message = sprintf('The Paging Link "%s" exists, but should not!', $locator); + $message = \sprintf('The Paging Link "%s" exists, but should not!', $locator); Helper::throwException($message); } diff --git a/tests/Mink/Page/Frontend/Listing/Listing.php b/tests/Mink/Page/Frontend/Listing/Listing.php index 558c6efd0bf..dffe66c38c4 100644 --- a/tests/Mink/Page/Frontend/Listing/Listing.php +++ b/tests/Mink/Page/Frontend/Listing/Listing.php @@ -156,7 +156,7 @@ public function checkView($view) $elements = Helper::findElements($this, ['viewTable', 'viewList'], false); if (key($elements) !== $view) { - $message = sprintf('"%s" is active! (should be "%s")', key($elements), $view); + $message = \sprintf('"%s" is active! (should be "%s")', key($elements), $view); Helper::throwException($message); } } @@ -176,7 +176,7 @@ public function checkListing($name, $negation = false) } if (!$result) { - $message = sprintf( + $message = \sprintf( 'The article "%s" is%s in the listing, but should%s.', $name, $negation ? '' : ' not', @@ -200,7 +200,7 @@ public function checkArticleBox(ArticleBox $articleBox, array $properties) return; } - $message = sprintf( + $message = \sprintf( 'The %s is "%s" (should be "%s")', $result['key'], $result['value'], @@ -257,7 +257,7 @@ protected function setFilters(FilterGroup $filterGroups, array $properties) $success = $filterGroup->setProperty($property['value']); if (!$success) { - $message = sprintf('The value "%s" was not found for filter "%s"!', $property['value'], $property['filter']); + $message = \sprintf('The value "%s" was not found for filter "%s"!', $property['value'], $property['filter']); Helper::throwException($message); } @@ -274,7 +274,7 @@ protected function setFilters(FilterGroup $filterGroups, array $properties) } if (!$found) { - $message = sprintf('The filter "%s" was not found!', $property['filter']); + $message = \sprintf('The filter "%s" was not found!', $property['filter']); Helper::throwException($message); } } diff --git a/tests/Mink/Page/Frontend/Note/Note.php b/tests/Mink/Page/Frontend/Note/Note.php index 85238fa39a9..b8987e32e4d 100644 --- a/tests/Mink/Page/Frontend/Note/Note.php +++ b/tests/Mink/Page/Frontend/Note/Note.php @@ -59,7 +59,7 @@ public function fillNoteWithProducts(array $items) $originalPath = $this->path; foreach ($items as $item) { - $this->path = sprintf('/note/add/ordernumber/%s', $item['number']); + $this->path = \sprintf('/note/add/ordernumber/%s', $item['number']); $this->open(); } diff --git a/tests/Mink/Page/Frontend/Sitemap/Sitemap.php b/tests/Mink/Page/Frontend/Sitemap/Sitemap.php index 5ce09e5089f..63b8d76c266 100644 --- a/tests/Mink/Page/Frontend/Sitemap/Sitemap.php +++ b/tests/Mink/Page/Frontend/Sitemap/Sitemap.php @@ -53,7 +53,7 @@ public function open(array $urlParameters = ['xml' => '']) public function checkGroup($group, string $link, array $sites): void { if (!($group instanceof SitemapGroup)) { - $message = sprintf('Sitemap group "%s" was not found!', $group); + $message = \sprintf('Sitemap group "%s" was not found!', $group); Helper::throwException($message); } @@ -105,14 +105,14 @@ private function checkGroupTitleLink($title, $link, array $data) } if ($result === 'title') { - $message = sprintf('Title of "%s" has a different value! (is "%s")', $check['title'][1], $check['title'][0]); + $message = \sprintf('Title of "%s" has a different value! (is "%s")', $check['title'][1], $check['title'][0]); } elseif (empty($link)) { $message = [ - sprintf('There is a link for the group "%s"!', $title), + \sprintf('There is a link for the group "%s"!', $title), $check['link'][0], ]; } else { - $message = sprintf('The link of "%s" is different! ("%s" not found in "%s")', $title, $check['link'][1], $check['link'][0]); + $message = \sprintf('The link of "%s" is different! ("%s" not found in "%s")', $title, $check['link'][1], $check['link'][0]); } Helper::throwException($message); @@ -140,7 +140,7 @@ private function checkGroupSite($title, $link, array $data) } } - $message = sprintf('The site "%s" with link "%s" was not found!', $title, $link); + $message = \sprintf('The site "%s" with link "%s" was not found!', $title, $link); Helper::throwException($message); } } diff --git a/tests/Mink/Page/Frontend/Sitemap/SitemapIndexXml.php b/tests/Mink/Page/Frontend/Sitemap/SitemapIndexXml.php index 42a2aeafa76..a1ad3e48cf5 100644 --- a/tests/Mink/Page/Frontend/Sitemap/SitemapIndexXml.php +++ b/tests/Mink/Page/Frontend/Sitemap/SitemapIndexXml.php @@ -49,9 +49,9 @@ public function checkXml(array $links) Helper::throwException('Sitemap is missing in /sitemap_index.xml'); } - $expected = sprintf('/web/sitemap/shop-1/%s', $links[0]['name']); + $expected = \sprintf('/web/sitemap/shop-1/%s', $links[0]['name']); if (!str_contains($xml['sitemap']['loc'], $expected)) { - Helper::throwException(sprintf('Sitemap url does not match excepted, excepted: %s, given %s', $expected, $xml['sitemap']['loc'])); + Helper::throwException(\sprintf('Sitemap url does not match excepted, excepted: %s, given %s', $expected, $xml['sitemap']['loc'])); } } } diff --git a/tests/Mink/Page/Helper/Elements/HeaderCart.php b/tests/Mink/Page/Helper/Elements/HeaderCart.php index b023e332d23..df3ed1a7b9e 100644 --- a/tests/Mink/Page/Helper/Elements/HeaderCart.php +++ b/tests/Mink/Page/Helper/Elements/HeaderCart.php @@ -79,7 +79,7 @@ public function checkCart(int $quantity, string $amount): void $result = Helper::checkArray($check); if ($result !== true) { - $message = sprintf( + $message = \sprintf( 'The %s of the header cart is wrong! (%s instead of %s)', $result, $check[$result][0], diff --git a/tests/Mink/Tests/Backend/Backend/bootstrap/BackendContext.php b/tests/Mink/Tests/Backend/Backend/bootstrap/BackendContext.php index f24d72af22a..e3312ac8481 100644 --- a/tests/Mink/Tests/Backend/Backend/bootstrap/BackendContext.php +++ b/tests/Mink/Tests/Backend/Backend/bootstrap/BackendContext.php @@ -107,7 +107,7 @@ public function thereShouldBeAWindowWithTheAlias(string $alias): bool }).length > 0; JS; - return (bool) $this->getDriver()->evaluateScript(sprintf($script, $alias)); + return (bool) $this->getDriver()->evaluateScript(\sprintf($script, $alias)); } /** @@ -115,7 +115,7 @@ public function thereShouldBeAWindowWithTheAlias(string $alias): bool */ protected function checkIfThereIsText(string $text, SubContext $context): bool { - $result = $context->getSession()->getPage()->findAll('xpath', sprintf("//*[contains(., '%s')]", $text)); + $result = $context->getSession()->getPage()->findAll('xpath', \sprintf("//*[contains(., '%s')]", $text)); return !empty($result); } diff --git a/tests/Mink/Tests/Backend/Export/bootstrap/ExportContext.php b/tests/Mink/Tests/Backend/Export/bootstrap/ExportContext.php index 6bd80cee487..75291552973 100644 --- a/tests/Mink/Tests/Backend/Export/bootstrap/ExportContext.php +++ b/tests/Mink/Tests/Backend/Export/bootstrap/ExportContext.php @@ -233,7 +233,7 @@ private function assertKeyExists($key, array $row): void private function assertStringsEqual(string $expected, string $actual): void { if (strcasecmp($expected, $actual) !== 0) { - Helper::throwException(sprintf("Content '%s' expected, found '%s' instead.", $expected, $actual)); + Helper::throwException(\sprintf("Content '%s' expected, found '%s' instead.", $expected, $actual)); } } } diff --git a/tests/Mink/Tests/Frontend/Account/bootstrap/AccountContext.php b/tests/Mink/Tests/Frontend/Account/bootstrap/AccountContext.php index 9e14535bcf2..3a8cd35a33f 100644 --- a/tests/Mink/Tests/Frontend/Account/bootstrap/AccountContext.php +++ b/tests/Mink/Tests/Frontend/Account/bootstrap/AccountContext.php @@ -265,7 +265,7 @@ public function thereShouldBeAnAddress(string $address): void } } - $message = sprintf('Newly created address not found! (%s)', $address); + $message = \sprintf('Newly created address not found! (%s)', $address); Helper::throwException($message); } @@ -307,7 +307,7 @@ public function iClickOnAddress(string $locator, string $address): void return; } - $message = sprintf('Given address not found! (%s)', $address); + $message = \sprintf('Given address not found! (%s)', $address); Helper::throwException($message); } @@ -331,7 +331,7 @@ public function iShouldSeeOnlyWithTitle(string $address, string $addressTitle): } if ($addressCount !== 1) { - $message = sprintf('Wrong number of given addresses titled "%s" found! Expected 1, found %d.', $addressTitle, $addressCount); + $message = \sprintf('Wrong number of given addresses titled "%s" found! Expected 1, found %d.', $addressTitle, $addressCount); Helper::throwException($message); } } @@ -404,7 +404,7 @@ public function iMustNotSeeInBoxWithTitle(string $elementName, string $title): v foreach ($addressManagementAddressBoxes as $box) { if ($box->hasTitle($title) && ($box->hasLink($elementName) || $box->hasButton($elementName))) { - $message = sprintf('Wrong number of boxes with title "%s" and delete button found! Expected 0, found at least 1.', $title); + $message = \sprintf('Wrong number of boxes with title "%s" and delete button found! Expected 0, found at least 1.', $title); Helper::throwException($message); } } diff --git a/tests/Mink/Tests/Frontend/Checkout/bootstrap/CheckoutContext.php b/tests/Mink/Tests/Frontend/Checkout/bootstrap/CheckoutContext.php index 24ec8274d76..1e3c1511654 100644 --- a/tests/Mink/Tests/Frontend/Checkout/bootstrap/CheckoutContext.php +++ b/tests/Mink/Tests/Frontend/Checkout/bootstrap/CheckoutContext.php @@ -208,7 +208,7 @@ public function theArticleIsAssignedToThePriceGroup(string $productNumber, strin $productVariant = $modelManager->getRepository(ProductVariant::class)->findOneBy(['number' => $productNumber]); if (!$productVariant instanceof ProductVariant) { - Helper::throwException(sprintf('Product with number "%s" was not found.', $productNumber)); + Helper::throwException(\sprintf('Product with number "%s" was not found.', $productNumber)); } $product = $productVariant->getArticle(); @@ -490,7 +490,7 @@ public function thereShouldBeAModalAddressbox(string $address): void } } - $message = sprintf('Given address not found! (%s)', $address); + $message = \sprintf('Given address not found! (%s)', $address); Helper::throwException($message); } @@ -513,7 +513,7 @@ public function iClickOnModalAddressbox(string $buttonName, string $address): vo } } - $message = sprintf('Expected address not found! (%s)', $address); + $message = \sprintf('Expected address not found! (%s)', $address); Helper::throwException($message); } @@ -552,7 +552,7 @@ public function iShouldSeeAppearInAddressboxAfterDisappeared(string $address, st } } - $message = sprintf('Expected to find address as %s! (%s)', $title, $address); + $message = \sprintf('Expected to find address as %s! (%s)', $title, $address); Helper::throwException($message); } @@ -598,7 +598,7 @@ public function iSetAsDefaultAfterDisappeared(string $address, string $titleToDi } } - $message = sprintf('Expected address not found! (%s)', $address); + $message = \sprintf('Expected address not found! (%s)', $address); Helper::throwException($message); } @@ -619,7 +619,7 @@ public function theAddressboxMustContain(string $title, string $address): bool } } - $message = sprintf('Expected to find address "%s" as "%s", but didn\'t.', $address, $title); + $message = \sprintf('Expected to find address "%s" as "%s", but didn\'t.', $address, $title); Helper::throwException($message); } @@ -814,7 +814,7 @@ public function removeCustomPaymentSurcharge(): void */ public function iCheckoutUsingGet(string $path = '/checkout/finish'): void { - $this->getSession()->executeScript(sprintf('window.location.href = \'%s\'', $path)); + $this->getSession()->executeScript(\sprintf('window.location.href = \'%s\'', $path)); } /** @@ -836,7 +836,7 @@ public function positionContainsFollowingTaxes(string $cartPositionName, TableNo } if (!$cartPositionToCheck instanceof CartPositionRebate) { - Helper::throwException(sprintf('No discount or surcharge element found with name: "%s"', $cartPositionName)); + Helper::throwException(\sprintf('No discount or surcharge element found with name: "%s"', $cartPositionName)); } $page->checkPositionTaxes($cartPositionToCheck, $taxValues); diff --git a/tests/Mink/Tests/Frontend/Homepage/bootstrap/SecurityContext.php b/tests/Mink/Tests/Frontend/Homepage/bootstrap/SecurityContext.php index 187d338bd86..9c19ad13487 100644 --- a/tests/Mink/Tests/Frontend/Homepage/bootstrap/SecurityContext.php +++ b/tests/Mink/Tests/Frontend/Homepage/bootstrap/SecurityContext.php @@ -82,6 +82,6 @@ public function theHttpResponseCodeShouldBe($expectedCode) return; } - Helper::throwException(sprintf('Expected http response code %d, got %d instead.', $expectedCode, $code)); + Helper::throwException(\sprintf('Expected http response code %d, got %d instead.', $expectedCode, $code)); } } diff --git a/tests/Mink/Tests/Frontend/Homepage/bootstrap/ShopwareContext.php b/tests/Mink/Tests/Frontend/Homepage/bootstrap/ShopwareContext.php index dc3da476f0f..19203b1745f 100644 --- a/tests/Mink/Tests/Frontend/Homepage/bootstrap/ShopwareContext.php +++ b/tests/Mink/Tests/Frontend/Homepage/bootstrap/ShopwareContext.php @@ -185,7 +185,7 @@ public function iConfirmTheLinkInTheEmail(int $limit = 1): void $mask = '%saccount/resetPassword/hash/%s'; $link = $this->getPage(Homepage::class)->getShopUrl(); - $confirmationLink = sprintf($mask, $link, $optin['hash']); + $confirmationLink = \sprintf($mask, $link, $optin['hash']); $session->visit($confirmationLink); return; @@ -219,7 +219,7 @@ public function iConfirmTheLinkInTheEmail(int $limit = 1): void } foreach ($hashes as $optin) { - $confirmationLink = sprintf($mask, $link, $optin['hash']); + $confirmationLink = \sprintf($mask, $link, $optin['hash']); $session->visit($confirmationLink); } } @@ -412,7 +412,7 @@ public function iClick(string $selector): void { $element = $this->getSession()->getPage()->findField($selector); if (!$element instanceof NodeElement) { - Helper::throwException(sprintf('Could not find element with selector "%s"', $selector)); + Helper::throwException(\sprintf('Could not find element with selector "%s"', $selector)); } $element->click(); } @@ -422,10 +422,10 @@ public function iClick(string $selector): void */ public function clickLinkInAccount(string $link): void { - $element = $this->getSession()->getPage()->findAll('xpath', sprintf('//*[contains(concat(" ",normalize-space(@class)," ")," account--menu ")]//li//a[contains(text(),\'%s\')]', $link)); + $element = $this->getSession()->getPage()->findAll('xpath', \sprintf('//*[contains(concat(" ",normalize-space(@class)," ")," account--menu ")]//li//a[contains(text(),\'%s\')]', $link)); if (!isset($element[1])) { - Helper::throwException(sprintf('Cannot find element with name "%s"', $link)); + Helper::throwException(\sprintf('Cannot find element with name "%s"', $link)); } $element[1]->click(); diff --git a/tests/Mink/Tests/General/Helpers/FeatureContext.php b/tests/Mink/Tests/General/Helpers/FeatureContext.php index e09296dbaa2..70df19e1988 100644 --- a/tests/Mink/Tests/General/Helpers/FeatureContext.php +++ b/tests/Mink/Tests/General/Helpers/FeatureContext.php @@ -171,7 +171,7 @@ public function takeScreenshotAfterFailedStep(AfterStepScope $scope): void */ public function saveScreenshot(?string $filename = null, ?string $filepath = null): void { - $generatedFilename = sprintf('%s_%s.%s', $this->getMinkParameter('browser_name'), $this->getDateTimeWithRandomString(), 'png'); + $generatedFilename = \sprintf('%s_%s.%s', $this->getMinkParameter('browser_name'), $this->getDateTimeWithRandomString(), 'png'); $filename = $filename ?: $generatedFilename; $filepath = $filepath ?: (ini_get('upload_tmp_dir') ?: sys_get_temp_dir()); file_put_contents($filepath . '/' . $filename, $this->getSession()->getScreenshot()); @@ -189,7 +189,7 @@ public function changeConfigValue(string $configName, $value): void ); if (!$configId) { - $message = sprintf('Configuration "%s" doesn\'t exist!', $configName); + $message = \sprintf('Configuration "%s" doesn\'t exist!', $configName); Helper::throwException($message); } @@ -261,7 +261,7 @@ public function registerErrorHandler(): void ]; $filepath = $this->getService(Kernel::class)->getRootDir() . '/build/logs/mink'; - $filename = sprintf('errors_%s.%s', $this->getDateTimeWithRandomString(), 'log'); + $filename = \sprintf('errors_%s.%s', $this->getDateTimeWithRandomString(), 'log'); $filepath .= '/' . $filename; file_put_contents($filepath, $errorNameMap[$errno] . ': ' . $errstr, FILE_APPEND); @@ -314,14 +314,14 @@ private function prepare(): void restore_error_handler(); // get the template id - $sql = sprintf( + $sql = \sprintf( 'SELECT id FROM `s_core_templates` WHERE template = "%s"', self::$suite->getSetting('template') ); $templateId = $this->getService(Connection::class)->fetchOne($sql); if (!$templateId) { - Helper::throwException(sprintf('Unable to find template by name %s', self::$suite->getSetting('template'))); + Helper::throwException(\sprintf('Unable to find template by name %s', self::$suite->getSetting('template'))); } // set the template for shop "Deutsch" and activate SEPA payment method @@ -364,7 +364,7 @@ private function reset(): void private function logRequest(): void { $session = $this->getSession(); - $log = sprintf('Current page: %d %s', $this->getStatusCode(), $session->getCurrentUrl()) . "\n"; + $log = \sprintf('Current page: %d %s', $this->getStatusCode(), $session->getCurrentUrl()) . "\n"; $log .= $this->getResponseHeadersLogMessage($session); $log .= $this->getRequestContentLogMessage($session); $this->saveLog($log); @@ -374,9 +374,9 @@ private function saveLog(string $content): void { $logDir = $this->getService(Kernel::class)->getRootDir() . '/build/logs/mink'; - $path = sprintf('%s/behat-%s.%s', $logDir, $this->getDateTime(), 'log'); + $path = \sprintf('%s/behat-%s.%s', $logDir, $this->getDateTime(), 'log'); if (!file_put_contents($path, $content)) { - Helper::throwException(sprintf('Failed while trying to write log in "%s".', $path)); + Helper::throwException(\sprintf('Failed while trying to write log in "%s".', $path)); } } diff --git a/tests/Mink/Tests/General/Helpers/Helper.php b/tests/Mink/Tests/General/Helpers/Helper.php index 86af5ecd8d9..3980b59d272 100644 --- a/tests/Mink/Tests/General/Helpers/Helper.php +++ b/tests/Mink/Tests/General/Helpers/Helper.php @@ -240,7 +240,7 @@ public static function findElements($parent, array $keys, bool $throwExceptions $messages = ['The following elements of ' . \get_class($parent) . ' were not found:']; foreach ($notFound as $key => $locator) { - $messages[] = sprintf('%s ("%s")', $key, $locator); + $messages[] = \sprintf('%s ("%s")', $key, $locator); } if (\count($messages) > 1) { @@ -279,7 +279,7 @@ public static function findAllOfElements($parent, array $keys, bool $throwExcept $messages = ['The following elements of ' . \get_class($parent) . ' were not found:']; foreach ($notFound as $key => $locator) { - $messages[] = sprintf('%s ("%s")', $key, $locator); + $messages[] = \sprintf('%s ("%s")', $key, $locator); } if (\count($messages) > 1) { @@ -328,10 +328,10 @@ public static function getRequiredSelectors($parent, array $keys, bool $throwExc $message = ['Following element selectors of ' . \get_class($parent) . ' are wrong:']; if (isset($errors['noSelector'])) { - $message[] = sprintf('%s (not defined)', implode(', ', $errors['noSelector'])); + $message[] = \sprintf('%s (not defined)', implode(', ', $errors['noSelector'])); } if (isset($errors['emptySelector'])) { - $message[] = sprintf('%s (empty)', implode(', ', $errors['emptySelector'])); + $message[] = \sprintf('%s (empty)', implode(', ', $errors['emptySelector'])); } self::throwException($message, self::EXCEPTION_PENDING); @@ -350,7 +350,7 @@ public static function getRequiredSelector(HelperSelectorInterface $parent, stri return $selectors[$key]; } - self::throwException(sprintf('Could not find "%s" selector', $key)); + self::throwException(\sprintf('Could not find "%s" selector', $key)); } /** @@ -572,7 +572,7 @@ public static function fillForm(HelperSelectorInterface $parent, string $formKey } if ($key !== 'value') { - $fieldName = sprintf('%s[%s]', $key, $tempFieldName); + $fieldName = \sprintf('%s[%s]', $key, $tempFieldName); } if (str_contains($fieldName, '.')) { @@ -589,7 +589,7 @@ public static function fillForm(HelperSelectorInterface $parent, string $formKey continue; } - $message = sprintf('The form "%s" has no field "%s"!', $formKey, $fieldName); + $message = \sprintf('The form "%s" has no field "%s"!', $formKey, $fieldName); self::throwException($message); } @@ -759,7 +759,7 @@ public static function getUnique(array $array): string if (\count($unique) > 1) { $messages = ['There are more than one unique values in the array!']; foreach ($unique as $key => $value) { - $messages[] = sprintf('"%s" (Key: "%s")', $value, $key); + $messages[] = \sprintf('"%s" (Key: "%s")', $value, $key); } self::throwException($messages); @@ -850,7 +850,7 @@ public static function assertElements(array $needles, MultipleElement $haystack) public static function assertElementCount(MultipleElement $elements, int $count = 0): void { if ($count !== \count($elements)) { - $message = sprintf( + $message = \sprintf( 'There are %d elements of type "%s" on page (should be %d)', \count($elements), \get_class($elements), @@ -863,7 +863,7 @@ public static function assertElementCount(MultipleElement $elements, int $count public static function spin(callable $lambda, int $wait = self::DEFAULT_WAIT_TIME, ?object $callingClass = null): void { if (!self::spinWithNoException($lambda, $wait, $callingClass)) { - self::throwException(sprintf('Spin function timed out after %s seconds', $wait)); + self::throwException(\sprintf('Spin function timed out after %s seconds', $wait)); } } diff --git a/tests/Mink/Tests/General/Helpers/SubContext.php b/tests/Mink/Tests/General/Helpers/SubContext.php index f2b21cd5acb..844619c470c 100644 --- a/tests/Mink/Tests/General/Helpers/SubContext.php +++ b/tests/Mink/Tests/General/Helpers/SubContext.php @@ -123,7 +123,7 @@ protected function getMultipleElement(Page $page, string $elementName, int $inst { $element = $this->getElement($elementName); if (!$element instanceof $elementName) { - Helper::throwException(sprintf('Element expected to be a %s', $elementName)); + Helper::throwException(\sprintf('Element expected to be a %s', $elementName)); } $element->setParent($page); diff --git a/tests/Unit/ArrayCollectionTest.php b/tests/Unit/ArrayCollectionTest.php index 47daf9f6c64..1ea098b0beb 100644 --- a/tests/Unit/ArrayCollectionTest.php +++ b/tests/Unit/ArrayCollectionTest.php @@ -1,4 +1,5 @@ add(new class() { + $cookieCollection->add(new class { }); static::assertFalse($cookieCollection->isValid()); diff --git a/tests/Unit/Bundle/CookieBundle/CookieGroupCollectionTest.php b/tests/Unit/Bundle/CookieBundle/CookieGroupCollectionTest.php index e7773ac66c5..0719a702314 100644 --- a/tests/Unit/Bundle/CookieBundle/CookieGroupCollectionTest.php +++ b/tests/Unit/Bundle/CookieBundle/CookieGroupCollectionTest.php @@ -43,7 +43,7 @@ public function testIsValidReturnsTrue(): void public function testIsValidReturnsFalse(): void { $cookieGroupCollection = new CookieGroupCollection(); - $cookieGroupCollection->add(new class() { + $cookieGroupCollection->add(new class { }); static::assertFalse($cookieGroupCollection->isValid()); diff --git a/tests/Unit/Bundle/ESIndexingBundle/DependencyInjection/Factory/TextMappingFactoryTest.php b/tests/Unit/Bundle/ESIndexingBundle/DependencyInjection/Factory/TextMappingFactoryTest.php index 6375964f5e5..c66234e4f52 100644 --- a/tests/Unit/Bundle/ESIndexingBundle/DependencyInjection/Factory/TextMappingFactoryTest.php +++ b/tests/Unit/Bundle/ESIndexingBundle/DependencyInjection/Factory/TextMappingFactoryTest.php @@ -1,4 +1,5 @@ format(DateTimeInterface::ATOM)); + $data = \sprintf('Locked: %s', (new DateTime('NOW', new DateTimeZone('UTC')))->format(DateTimeInterface::ATOM)); $this->cacheMock->method('save') ->with('sitemap-exporter-running-1', $data, $this->lifeTime) ->willReturn(false); diff --git a/tests/Unit/Bundle/SitemapBundle/SitemapNameGeneratorTest.php b/tests/Unit/Bundle/SitemapBundle/SitemapNameGeneratorTest.php index 0d66faff1b6..81fe42c15e8 100644 --- a/tests/Unit/Bundle/SitemapBundle/SitemapNameGeneratorTest.php +++ b/tests/Unit/Bundle/SitemapBundle/SitemapNameGeneratorTest.php @@ -1,4 +1,5 @@ 'none', ] ), - $this->createStub(ContextServiceInterface::class), + static::createStub(ContextServiceInterface::class), null, $discountTaxConfig, $taxAutoModeConfig @@ -94,7 +94,7 @@ public function positionsTaxSumDataProvider(): Generator yield 'Item with "tax_rate" set' => [ [ - sprintf('%.2f', self::REGULAR_TAX_RATE) => 1.1, + \sprintf('%.2f', self::REGULAR_TAX_RATE) => 1.1, ], self::MAXIMUM_TAX_RATE, [ @@ -127,9 +127,9 @@ public function positionsTaxSumDataProvider(): Generator ]; foreach ([true, false] as $taxAutoModeConfig) { - yield sprintf('Regular item without "tax_rate", taxAutoMode: %d', $taxAutoModeConfig) => [ + yield \sprintf('Regular item without "tax_rate", taxAutoMode: %d', $taxAutoModeConfig) => [ [ - sprintf('%.2f', $taxAutoModeConfig ? self::MAXIMUM_TAX_RATE : self::DISCOUNT_TAX_RATE) => 1.1, + \sprintf('%.2f', $taxAutoModeConfig ? self::MAXIMUM_TAX_RATE : self::DISCOUNT_TAX_RATE) => 1.1, ], self::MAXIMUM_TAX_RATE, [ @@ -139,13 +139,13 @@ public function positionsTaxSumDataProvider(): Generator ], ], $taxAutoModeConfig ? '1' : null, - sprintf('%.2f', self::DISCOUNT_TAX_RATE), + \sprintf('%.2f', self::DISCOUNT_TAX_RATE), ]; } yield 'Multiple items with "tax_rate" set' => [ [ - sprintf('%.2f', self::REGULAR_TAX_RATE) => self::DISCOUNT_TAX_RATE * 4, + \sprintf('%.2f', self::REGULAR_TAX_RATE) => self::DISCOUNT_TAX_RATE * 4, ], self::MAXIMUM_TAX_RATE, [ @@ -181,8 +181,8 @@ public function testShippingCostsTaxSum( ?array $shippingCostsTaxProportional = null ): void { $subject = new TaxAggregator( - $this->createStub(Connection::class), - $this->createStub(ContextServiceInterface::class) + static::createStub(Connection::class), + static::createStub(ContextServiceInterface::class) ); $basket = [ @@ -213,7 +213,7 @@ public function shippingCostsTaxSumDataProvider(): Generator yield 'Proportional tax calculation' => [ [ - sprintf('%.2f', self::SHIPPING_COSTS_TAX_RATE) => 1.0, + \sprintf('%.2f', self::SHIPPING_COSTS_TAX_RATE) => 1.0, ], self::SHIPPING_COSTS_TAX_RATE, [ @@ -229,16 +229,16 @@ public function shippingCostsTaxSumDataProvider(): Generator yield 'Regular tax calculation' => [ [ - sprintf('%.2f', self::SHIPPING_COSTS_TAX_RATE) => self::SHIPPING_COSTS_WITH_TAX - self::SHIPPING_COSTS_NET, + \sprintf('%.2f', self::SHIPPING_COSTS_TAX_RATE) => self::SHIPPING_COSTS_WITH_TAX - self::SHIPPING_COSTS_NET, ], self::SHIPPING_COSTS_TAX_RATE, ]; yield 'Proportional tax calculation with multiple positions and tax rates' => [ [ - sprintf('%.2f', self::SHIPPING_COSTS_TAX_RATE - 1) => 1.1, - sprintf('%.2f', self::SHIPPING_COSTS_TAX_RATE) => 2.2, - sprintf('%.2f', self::SHIPPING_COSTS_TAX_RATE + 1) => 2.2, + \sprintf('%.2f', self::SHIPPING_COSTS_TAX_RATE - 1) => 1.1, + \sprintf('%.2f', self::SHIPPING_COSTS_TAX_RATE) => 2.2, + \sprintf('%.2f', self::SHIPPING_COSTS_TAX_RATE + 1) => 2.2, ], self::SHIPPING_COSTS_TAX_RATE, [ @@ -342,9 +342,9 @@ public function getVoucherTaxRateDataProvider(): Generator { // These datasets test, whether the config/fallback value is returned in case we provide the default or no tax mode foreach (['default', null, ''] as $voucherTaxMode) { - yield sprintf('Default voucher tax mode: "%s"', $voucherTaxMode ?? 'null') => [ + yield \sprintf('Default voucher tax mode: "%s"', $voucherTaxMode ?? 'null') => [ [ - sprintf('%.2f', self::REGULAR_TAX_RATE) => 1.1, + \sprintf('%.2f', self::REGULAR_TAX_RATE) => 1.1, ], [ [ @@ -354,14 +354,14 @@ public function getVoucherTaxRateDataProvider(): Generator ], ], $voucherTaxMode, - sprintf('%.2f', self::REGULAR_TAX_RATE), + \sprintf('%.2f', self::REGULAR_TAX_RATE), ]; } // This dataset tests, whether the maximum tax rate is returned, when using tax mode "auto" yield 'Voucher tax mode: auto' => [ [ - sprintf('%.2f', self::MAXIMUM_TAX_RATE) => 1.1, + \sprintf('%.2f', self::MAXIMUM_TAX_RATE) => 1.1, ], [ [ @@ -389,7 +389,7 @@ public function getVoucherTaxRateDataProvider(): Generator // This dataset tests, whether the method attempts to read the tax rate from context, when using any other tax mode yield 'Voucher tax mode: 19' => [ [ - sprintf('%.2f', self::REGULAR_TAX_RATE) => 1.1, + \sprintf('%.2f', self::REGULAR_TAX_RATE) => 1.1, ], [ [ @@ -398,7 +398,7 @@ public function getVoucherTaxRateDataProvider(): Generator 'tax' => 1.1, ], ], - sprintf('%d', self::REGULAR_TAX_RATE), + \sprintf('%d', self::REGULAR_TAX_RATE), ]; } @@ -411,8 +411,8 @@ public function getVoucherTaxRateDataProvider(): Generator public function testTaxSum(array $expected, array $basket): void { $subject = new TaxAggregator( - $this->createStub(Connection::class), - $this->createStub(ContextServiceInterface::class) + static::createStub(Connection::class), + static::createStub(ContextServiceInterface::class) ); static::assertSame( @@ -433,7 +433,7 @@ public function taxSumDataProvider(): Generator yield 'Basket with a few positions' => [ [ - sprintf('%.2f', self::REGULAR_TAX_RATE) => 4.4, + \sprintf('%.2f', self::REGULAR_TAX_RATE) => 4.4, ], [ 'content' => [ @@ -463,7 +463,7 @@ public function taxSumDataProvider(): Generator yield 'Basket with a few positions and shipping costs' => [ [ - sprintf('%.2f', self::REGULAR_TAX_RATE) => 10.4 + (self::SHIPPING_COSTS_WITH_TAX - self::SHIPPING_COSTS_NET), + \sprintf('%.2f', self::REGULAR_TAX_RATE) => 10.4 + (self::SHIPPING_COSTS_WITH_TAX - self::SHIPPING_COSTS_NET), ], [ 'content' => [ diff --git a/tests/Unit/Components/CookieSubscriberTest.php b/tests/Unit/Components/CookieSubscriberTest.php index d1bee859d33..30046a629dc 100644 --- a/tests/Unit/Components/CookieSubscriberTest.php +++ b/tests/Unit/Components/CookieSubscriberTest.php @@ -1,4 +1,5 @@ querybuilder->resetDQLParts(); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage(sprintf('\'%s\' is no valid operator', $filter['expression'])); + $this->expectExceptionMessage(\sprintf('\'%s\' is no valid operator', $filter['expression'])); $this->querybuilder->addFilter([$filter]); } diff --git a/tests/Unit/Components/OrderNumberValidator/RegexOrderNumberValidatorTest.php b/tests/Unit/Components/OrderNumberValidator/RegexOrderNumberValidatorTest.php index 3541c4e39a1..153dbcb31fe 100644 --- a/tests/Unit/Components/OrderNumberValidator/RegexOrderNumberValidatorTest.php +++ b/tests/Unit/Components/OrderNumberValidator/RegexOrderNumberValidatorTest.php @@ -1,4 +1,5 @@ xpath->query( - sprintf( + \sprintf( '//config/elements/element[%s]/store', $elementIndex ) diff --git a/tests/Unit/Components/Plugin/XmlReader/StoreValueParser/StoreValueParserFactoryTest.php b/tests/Unit/Components/Plugin/XmlReader/StoreValueParser/StoreValueParserFactoryTest.php index 0ae6872ad69..cb6d01f71bb 100644 --- a/tests/Unit/Components/Plugin/XmlReader/StoreValueParser/StoreValueParserFactoryTest.php +++ b/tests/Unit/Components/Plugin/XmlReader/StoreValueParser/StoreValueParserFactoryTest.php @@ -1,4 +1,5 @@ xpath->query( - sprintf( + \sprintf( '//config/elements/element[%s]/store', $elementIndex ) diff --git a/tests/Unit/Components/Plugin/XmlReader/XmlConfigReaderTest.php b/tests/Unit/Components/Plugin/XmlReader/XmlConfigReaderTest.php index 110739bbad3..d9ed67a51a1 100644 --- a/tests/Unit/Components/Plugin/XmlReader/XmlConfigReaderTest.php +++ b/tests/Unit/Components/Plugin/XmlReader/XmlConfigReaderTest.php @@ -171,7 +171,7 @@ public function testValidateAttributeScopeThrowsException(): void private function readFile(string $file): array { return $this->configReader->read( - sprintf('%s/examples/config/%s', __DIR__, $file) + \sprintf('%s/examples/config/%s', __DIR__, $file) ); } } diff --git a/tests/Unit/Components/Plugin/XmlReader/XmlCronjobReaderTest.php b/tests/Unit/Components/Plugin/XmlReader/XmlCronjobReaderTest.php index 1a73b0a545b..32f9b317a30 100644 --- a/tests/Unit/Components/Plugin/XmlReader/XmlCronjobReaderTest.php +++ b/tests/Unit/Components/Plugin/XmlReader/XmlCronjobReaderTest.php @@ -89,7 +89,7 @@ public function testReadEmptyFile(): void private function readFile(): array { return $this->cronjobReader->read( - sprintf('%s/examples/cronjob/%s', __DIR__, 'cronjob.xml') + \sprintf('%s/examples/cronjob/%s', __DIR__, 'cronjob.xml') ); } } diff --git a/tests/Unit/Components/Plugin/XmlReader/XmlMenuReaderTest.php b/tests/Unit/Components/Plugin/XmlReader/XmlMenuReaderTest.php index 77d5a583e7e..9b758943cfc 100644 --- a/tests/Unit/Components/Plugin/XmlReader/XmlMenuReaderTest.php +++ b/tests/Unit/Components/Plugin/XmlReader/XmlMenuReaderTest.php @@ -100,7 +100,7 @@ public function testMultipleChildren(): void private function readFile(string $file): array { return $this->menuReader->read( - sprintf('%s/examples/menu/%s', __DIR__, $file) + \sprintf('%s/examples/menu/%s', __DIR__, $file) ); } } diff --git a/tests/Unit/Components/Plugin/XmlReader/XmlPluginReaderTest.php b/tests/Unit/Components/Plugin/XmlReader/XmlPluginReaderTest.php index 3f75fbfeec1..1d0547e13cb 100644 --- a/tests/Unit/Components/Plugin/XmlReader/XmlPluginReaderTest.php +++ b/tests/Unit/Components/Plugin/XmlReader/XmlPluginReaderTest.php @@ -120,7 +120,7 @@ public function testReadFileWithMultipleVersion(): void private function readFile(string $fileName = 'plugin'): array { return $this->pluginReader->read( - sprintf('%s/examples/plugin/%s.xml', __DIR__, $fileName) + \sprintf('%s/examples/plugin/%s.xml', __DIR__, $fileName) ); } } diff --git a/tests/Unit/Components/PluginTest.php b/tests/Unit/Components/PluginTest.php index d3c07f76496..1b4b6163cf4 100644 --- a/tests/Unit/Components/PluginTest.php +++ b/tests/Unit/Components/PluginTest.php @@ -1,4 +1,5 @@ =5.3.0", "react/event-loop": "^1.2", - "react/stream": "^1.2" + "react/stream": "^1.4" }, "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35", - "react/socket": "^1.8", + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/socket": "^1.16", "sebastian/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0" }, "type": "library", "autoload": { "psr-4": { - "React\\ChildProcess\\": "src" + "React\\ChildProcess\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -831,19 +839,15 @@ ], "support": { "issues": "https://github.com/reactphp/child-process/issues", - "source": "https://github.com/reactphp/child-process/tree/v0.6.5" + "source": "https://github.com/reactphp/child-process/tree/v0.6.6" }, "funding": [ { - "url": "https://github.com/WyriHaximus", - "type": "github" - }, - { - "url": "https://github.com/clue", - "type": "github" + "url": "https://opencollective.com/reactphp", + "type": "open_collective" } ], - "time": "2022-09-16T13:41:56+00:00" + "time": "2025-01-01T16:37:48+00:00" }, { "name": "react/dns", @@ -1068,31 +1072,31 @@ }, { "name": "react/socket", - "version": "v1.15.0", + "version": "v1.16.0", "source": { "type": "git", "url": "https://github.com/reactphp/socket.git", - "reference": "216d3aec0b87f04a40ca04f481e6af01bdd1d038" + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/socket/zipball/216d3aec0b87f04a40ca04f481e6af01bdd1d038", - "reference": "216d3aec0b87f04a40ca04f481e6af01bdd1d038", + "url": "https://api.github.com/repos/reactphp/socket/zipball/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", "shasum": "" }, "require": { "evenement/evenement": "^3.0 || ^2.0 || ^1.0", "php": ">=5.3.0", - "react/dns": "^1.11", + "react/dns": "^1.13", "react/event-loop": "^1.2", - "react/promise": "^3 || ^2.6 || ^1.2.1", - "react/stream": "^1.2" + "react/promise": "^3.2 || ^2.6 || ^1.2.1", + "react/stream": "^1.4" }, "require-dev": { "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", - "react/async": "^4 || ^3 || ^2", + "react/async": "^4.3 || ^3.3 || ^2", "react/promise-stream": "^1.4", - "react/promise-timer": "^1.10" + "react/promise-timer": "^1.11" }, "type": "library", "autoload": { @@ -1136,7 +1140,7 @@ ], "support": { "issues": "https://github.com/reactphp/socket/issues", - "source": "https://github.com/reactphp/socket/tree/v1.15.0" + "source": "https://github.com/reactphp/socket/tree/v1.16.0" }, "funding": [ { @@ -1144,7 +1148,7 @@ "type": "open_collective" } ], - "time": "2023-12-15T11:02:10+00:00" + "time": "2024-07-26T10:38:09+00:00" }, { "name": "react/stream", @@ -1292,16 +1296,16 @@ }, { "name": "symfony/console", - "version": "v5.4.40", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "aa73115c0c24220b523625bfcfa655d7d73662dd" + "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/aa73115c0c24220b523625bfcfa655d7d73662dd", - "reference": "aa73115c0c24220b523625bfcfa655d7d73662dd", + "url": "https://api.github.com/repos/symfony/console/zipball/c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed", + "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed", "shasum": "" }, "require": { @@ -1371,7 +1375,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.40" + "source": "https://github.com/symfony/console/tree/v5.4.47" }, "funding": [ { @@ -1387,20 +1391,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-11-06T11:30:55+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.3", + "version": "v2.5.4", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "80d075412b557d41002320b96a096ca65aa2c98d" + "reference": "605389f2a7e5625f273b53960dc46aeaf9c62918" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/80d075412b557d41002320b96a096ca65aa2c98d", - "reference": "80d075412b557d41002320b96a096ca65aa2c98d", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/605389f2a7e5625f273b53960dc46aeaf9c62918", + "reference": "605389f2a7e5625f273b53960dc46aeaf9c62918", "shasum": "" }, "require": { @@ -1408,12 +1412,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -1438,7 +1442,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.3" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.4" }, "funding": [ { @@ -1454,20 +1458,20 @@ "type": "tidelift" } ], - "time": "2023-01-24T14:02:46+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v5.4.40", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "a54e2a8a114065f31020d6a89ede83e34c3b27a4" + "reference": "72982eb416f61003e9bb6e91f8b3213600dcf9e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a54e2a8a114065f31020d6a89ede83e34c3b27a4", - "reference": "a54e2a8a114065f31020d6a89ede83e34c3b27a4", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/72982eb416f61003e9bb6e91f8b3213600dcf9e9", + "reference": "72982eb416f61003e9bb6e91f8b3213600dcf9e9", "shasum": "" }, "require": { @@ -1523,7 +1527,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.40" + "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.45" }, "funding": [ { @@ -1539,20 +1543,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v2.5.3", + "version": "v2.5.4", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "540f4c73e87fd0c71ca44a6aa305d024ac68cb73" + "reference": "e0fe3d79b516eb75126ac6fa4cbf19b79b08c99f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/540f4c73e87fd0c71ca44a6aa305d024ac68cb73", - "reference": "540f4c73e87fd0c71ca44a6aa305d024ac68cb73", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/e0fe3d79b516eb75126ac6fa4cbf19b79b08c99f", + "reference": "e0fe3d79b516eb75126ac6fa4cbf19b79b08c99f", "shasum": "" }, "require": { @@ -1564,12 +1568,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -1602,7 +1606,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.3" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.4" }, "funding": [ { @@ -1618,20 +1622,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/filesystem", - "version": "v5.4.40", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "26dd9912df6940810ea00f8f53ad48d6a3424995" + "reference": "57c8294ed37d4a055b77057827c67f9558c95c54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/26dd9912df6940810ea00f8f53ad48d6a3424995", - "reference": "26dd9912df6940810ea00f8f53ad48d6a3424995", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/57c8294ed37d4a055b77057827c67f9558c95c54", + "reference": "57c8294ed37d4a055b77057827c67f9558c95c54", "shasum": "" }, "require": { @@ -1669,7 +1673,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.40" + "source": "https://github.com/symfony/filesystem/tree/v5.4.45" }, "funding": [ { @@ -1685,20 +1689,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-10-22T13:05:35+00:00" }, { "name": "symfony/finder", - "version": "v5.4.40", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "f51cff4687547641c7d8180d74932ab40b2205ce" + "reference": "63741784cd7b9967975eec610b256eed3ede022b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/f51cff4687547641c7d8180d74932ab40b2205ce", - "reference": "f51cff4687547641c7d8180d74932ab40b2205ce", + "url": "https://api.github.com/repos/symfony/finder/zipball/63741784cd7b9967975eec610b256eed3ede022b", + "reference": "63741784cd7b9967975eec610b256eed3ede022b", "shasum": "" }, "require": { @@ -1732,7 +1736,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.40" + "source": "https://github.com/symfony/finder/tree/v5.4.45" }, "funding": [ { @@ -1748,20 +1752,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-09-28T13:32:08+00:00" }, { "name": "symfony/options-resolver", - "version": "v5.4.40", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "bd1afbde6613a8d6b956115e0e14b196191fd0c4" + "reference": "74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/bd1afbde6613a8d6b956115e0e14b196191fd0c4", - "reference": "bd1afbde6613a8d6b956115e0e14b196191fd0c4", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6", + "reference": "74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6", "shasum": "" }, "require": { @@ -1801,7 +1805,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.4.40" + "source": "https://github.com/symfony/options-resolver/tree/v5.4.45" }, "funding": [ { @@ -1817,24 +1821,24 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.30.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a" + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/64647a7c30b2283f5d49b874d84a18fc22054b7a", - "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" @@ -1842,8 +1846,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -1879,7 +1883,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.30.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0" }, "funding": [ { @@ -1895,24 +1899,24 @@ "type": "tidelift" } ], - "time": "2024-05-31T15:07:36+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.30.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb" + "reference": "3833d7255cc303546435cb650316bff708a1c75c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/a95281b0be0d9ab48050ebd988b967875cdb9fdb", - "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", + "reference": "3833d7255cc303546435cb650316bff708a1c75c", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" @@ -1920,8 +1924,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -1960,7 +1964,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.30.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0" }, "funding": [ { @@ -1976,30 +1980,30 @@ "type": "tidelift" } ], - "time": "2024-05-31T15:07:36+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.30.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "77fa7995ac1b21ab60769b7323d600a991a90433" + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433", - "reference": "77fa7995ac1b21ab60769b7323d600a991a90433", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -2040,7 +2044,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" }, "funding": [ { @@ -2056,30 +2060,30 @@ "type": "tidelift" } ], - "time": "2024-05-31T15:07:36+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.30.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af" + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/3fb075789fb91f9ad9af537c4012d523085bd5af", - "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -2116,7 +2120,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.30.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0" }, "funding": [ { @@ -2132,20 +2136,20 @@ "type": "tidelift" } ], - "time": "2024-06-19T12:30:46+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/process", - "version": "v5.4.40", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "deedcb3bb4669cae2148bc920eafd2b16dc7c046" + "reference": "5d1662fb32ebc94f17ddb8d635454a776066733d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/deedcb3bb4669cae2148bc920eafd2b16dc7c046", - "reference": "deedcb3bb4669cae2148bc920eafd2b16dc7c046", + "url": "https://api.github.com/repos/symfony/process/zipball/5d1662fb32ebc94f17ddb8d635454a776066733d", + "reference": "5d1662fb32ebc94f17ddb8d635454a776066733d", "shasum": "" }, "require": { @@ -2178,7 +2182,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.40" + "source": "https://github.com/symfony/process/tree/v5.4.47" }, "funding": [ { @@ -2194,20 +2198,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-11-06T11:36:42+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.5.3", + "version": "v2.5.4", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "a2329596ddc8fd568900e3fc76cba42489ecc7f3" + "reference": "f37b419f7aea2e9abf10abd261832cace12e3300" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/a2329596ddc8fd568900e3fc76cba42489ecc7f3", - "reference": "a2329596ddc8fd568900e3fc76cba42489ecc7f3", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f37b419f7aea2e9abf10abd261832cace12e3300", + "reference": "f37b419f7aea2e9abf10abd261832cace12e3300", "shasum": "" }, "require": { @@ -2223,12 +2227,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -2261,7 +2265,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.3" + "source": "https://github.com/symfony/service-contracts/tree/v2.5.4" }, "funding": [ { @@ -2277,20 +2281,20 @@ "type": "tidelift" } ], - "time": "2023-04-21T15:04:16+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/stopwatch", - "version": "v5.4.40", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "0e9daf3b7c805c747638b2cc48f1649e594f9625" + "reference": "fb2c199cf302eb207f8c23e7ee174c1c31a5c004" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/0e9daf3b7c805c747638b2cc48f1649e594f9625", - "reference": "0e9daf3b7c805c747638b2cc48f1649e594f9625", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/fb2c199cf302eb207f8c23e7ee174c1c31a5c004", + "reference": "fb2c199cf302eb207f8c23e7ee174c1c31a5c004", "shasum": "" }, "require": { @@ -2323,7 +2327,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v5.4.40" + "source": "https://github.com/symfony/stopwatch/tree/v5.4.45" }, "funding": [ { @@ -2339,20 +2343,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/string", - "version": "v5.4.40", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "142877285aa974a6f7685e292ab5ba9aae86b143" + "reference": "136ca7d72f72b599f2631aca474a4f8e26719799" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/142877285aa974a6f7685e292ab5ba9aae86b143", - "reference": "142877285aa974a6f7685e292ab5ba9aae86b143", + "url": "https://api.github.com/repos/symfony/string/zipball/136ca7d72f72b599f2631aca474a4f8e26719799", + "reference": "136ca7d72f72b599f2631aca474a4f8e26719799", "shasum": "" }, "require": { @@ -2409,7 +2413,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.40" + "source": "https://github.com/symfony/string/tree/v5.4.47" }, "funding": [ { @@ -2425,15 +2429,15 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-11-10T20:33:58+00:00" } ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, - "platform": [], + "platform": {}, "platform-dev": { "php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0", "ext-ctype": "*",