From a04a0f248423d646522762281046f28951b3384a Mon Sep 17 00:00:00 2001 From: TheCartpenter Date: Sat, 8 Jun 2024 18:22:19 -0400 Subject: [PATCH] Upgraded cardinity/cardinity-sdk-php vendor to v7.0.8 --- composer.lock | 15 ++++----- .../storage/vendor/composer/installed.json | 17 +++++----- .../storage/vendor/composer/installed.php | 10 +++--- .../validator/Constraints/IbanValidator.php | 12 +++++++ .../validator/Mapping/ClassMetadata.php | 31 ++++++++++++++++++- .../Mapping/Loader/AbstractLoader.php | 12 +++++++ .../Mapping/Loader/XmlFileLoader.php | 8 ++++- .../Mapping/Loader/YamlFileLoader.php | 6 ++++ .../Resources/translations/validators.ja.xlf | 14 ++++----- .../Resources/translations/validators.nl.xlf | 2 +- .../Test/ConstraintValidatorTestCase.php | 10 ++++-- .../vendor/symfony/validator/composer.json | 3 +- 12 files changed, 106 insertions(+), 34 deletions(-) diff --git a/composer.lock b/composer.lock index 8fa06d61e..08ce55ae1 100644 --- a/composer.lock +++ b/composer.lock @@ -1181,16 +1181,16 @@ }, { "name": "symfony/validator", - "version": "v7.0.7", + "version": "v7.0.8", "source": { "type": "git", "url": "https://github.com/symfony/validator.git", - "reference": "ab4e75b9d23ba70e78480aecbe4d8da15adf10eb" + "reference": "23af65dff1f4dfee9aab3a0123a243e40fa3d9cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/ab4e75b9d23ba70e78480aecbe4d8da15adf10eb", - "reference": "ab4e75b9d23ba70e78480aecbe4d8da15adf10eb", + "url": "https://api.github.com/repos/symfony/validator/zipball/23af65dff1f4dfee9aab3a0123a243e40fa3d9cf", + "reference": "23af65dff1f4dfee9aab3a0123a243e40fa3d9cf", "shasum": "" }, "require": { @@ -1235,7 +1235,8 @@ "Symfony\\Component\\Validator\\": "" }, "exclude-from-classmap": [ - "/Tests/" + "/Tests/", + "/Resources/bin/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1255,7 +1256,7 @@ "description": "Provides tools to validate values", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/validator/tree/v7.0.7" + "source": "https://github.com/symfony/validator/tree/v7.0.8" }, "funding": [ { @@ -1271,7 +1272,7 @@ "type": "tidelift" } ], - "time": "2024-04-28T11:44:19+00:00" + "time": "2024-06-02T15:49:03+00:00" }, { "name": "twig/twig", diff --git a/upload/system/storage/vendor/composer/installed.json b/upload/system/storage/vendor/composer/installed.json index df42453fc..a866ad32a 100644 --- a/upload/system/storage/vendor/composer/installed.json +++ b/upload/system/storage/vendor/composer/installed.json @@ -1223,17 +1223,17 @@ }, { "name": "symfony/validator", - "version": "v7.0.7", - "version_normalized": "7.0.7.0", + "version": "v7.0.8", + "version_normalized": "7.0.8.0", "source": { "type": "git", "url": "https://github.com/symfony/validator.git", - "reference": "ab4e75b9d23ba70e78480aecbe4d8da15adf10eb" + "reference": "23af65dff1f4dfee9aab3a0123a243e40fa3d9cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/ab4e75b9d23ba70e78480aecbe4d8da15adf10eb", - "reference": "ab4e75b9d23ba70e78480aecbe4d8da15adf10eb", + "url": "https://api.github.com/repos/symfony/validator/zipball/23af65dff1f4dfee9aab3a0123a243e40fa3d9cf", + "reference": "23af65dff1f4dfee9aab3a0123a243e40fa3d9cf", "shasum": "" }, "require": { @@ -1272,7 +1272,7 @@ "symfony/translation": "^6.4.3|^7.0.3", "symfony/yaml": "^6.4|^7.0" }, - "time": "2024-04-28T11:44:19+00:00", + "time": "2024-06-02T15:49:03+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1280,7 +1280,8 @@ "Symfony\\Component\\Validator\\": "" }, "exclude-from-classmap": [ - "/Tests/" + "/Tests/", + "/Resources/bin/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1300,7 +1301,7 @@ "description": "Provides tools to validate values", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/validator/tree/v7.0.7" + "source": "https://github.com/symfony/validator/tree/v7.0.8" }, "funding": [ { diff --git a/upload/system/storage/vendor/composer/installed.php b/upload/system/storage/vendor/composer/installed.php index 7efd0c7b2..7aaaa3e17 100644 --- a/upload/system/storage/vendor/composer/installed.php +++ b/upload/system/storage/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'opencart/opencart-3', 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => '2411583dc7d448bdacf88526a589027610b4a4f4', + 'reference' => 'd9dc31a7fc7baa976ce086e3a9bab2ae288f1f1b', 'type' => 'project', 'install_path' => __DIR__ . '/../../../../../', 'aliases' => array(), @@ -58,7 +58,7 @@ 'opencart/opencart-3' => array( 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => '2411583dc7d448bdacf88526a589027610b4a4f4', + 'reference' => 'd9dc31a7fc7baa976ce086e3a9bab2ae288f1f1b', 'type' => 'project', 'install_path' => __DIR__ . '/../../../../../', 'aliases' => array(), @@ -182,9 +182,9 @@ 'dev_requirement' => false, ), 'symfony/validator' => array( - 'pretty_version' => 'v7.0.7', - 'version' => '7.0.7.0', - 'reference' => 'ab4e75b9d23ba70e78480aecbe4d8da15adf10eb', + 'pretty_version' => 'v7.0.8', + 'version' => '7.0.8.0', + 'reference' => '23af65dff1f4dfee9aab3a0123a243e40fa3d9cf', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/validator', 'aliases' => array(), diff --git a/upload/system/storage/vendor/symfony/validator/Constraints/IbanValidator.php b/upload/system/storage/vendor/symfony/validator/Constraints/IbanValidator.php index 47ddf17ea..3ed971cb4 100644 --- a/upload/system/storage/vendor/symfony/validator/Constraints/IbanValidator.php +++ b/upload/system/storage/vendor/symfony/validator/Constraints/IbanValidator.php @@ -225,6 +225,18 @@ public function validate(mixed $value, Constraint $constraint): void return; } + // Check digits should always between 2 and 98 + // A ECBS document (https://www.ecbs.org/Download/EBS204_V3.PDF) replicates part of the ISO/IEC 7064:2003 standard as a method for generating check digits in the range 02 to 98. + $checkDigits = (int) substr($canonicalized, 2, 2); + if ($checkDigits < 2 || $checkDigits > 98) { + $this->context->buildViolation($constraint->message) + ->setParameter('{{ value }}', $this->formatValue($value)) + ->setCode(Iban::CHECKSUM_FAILED_ERROR) + ->addViolation(); + + return; + } + // Move the first four characters to the end // e.g. CH93 0076 2011 6238 5295 7 // -> 0076 2011 6238 5295 7 CH93 diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/ClassMetadata.php b/upload/system/storage/vendor/symfony/validator/Mapping/ClassMetadata.php index 58ff287d7..1d11cc2c2 100644 --- a/upload/system/storage/vendor/symfony/validator/Mapping/ClassMetadata.php +++ b/upload/system/storage/vendor/symfony/validator/Mapping/ClassMetadata.php @@ -198,7 +198,7 @@ public function addConstraint(Constraint $constraint): static continue; } - if ($property->hasType() && (('array' === $type = $property->getType()->getName()) || class_exists($type))) { + if ($this->canCascade($property->getType())) { $this->addPropertyConstraint($property->getName(), new Valid()); } } @@ -483,4 +483,33 @@ private function checkConstraint(Constraint $constraint): void } } } + + private function canCascade(?\ReflectionType $type = null): bool + { + if (null === $type) { + return false; + } + + if ($type instanceof \ReflectionIntersectionType) { + foreach ($type->getTypes() as $nestedType) { + if ($this->canCascade($nestedType)) { + return true; + } + } + + return false; + } + + if ($type instanceof \ReflectionUnionType) { + foreach ($type->getTypes() as $nestedType) { + if (!$this->canCascade($nestedType)) { + return false; + } + } + + return true; + } + + return $type instanceof \ReflectionNamedType && (\in_array($type->getName(), ['array', 'null'], true) || class_exists($type->getName())); + } } diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/AbstractLoader.php b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/AbstractLoader.php index 1d6ffb788..bcfdce2bd 100644 --- a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/AbstractLoader.php +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/AbstractLoader.php @@ -85,6 +85,18 @@ protected function newConstraint(string $name, mixed $options = null): Constrain } if ($this->namedArgumentsCache[$className] ??= (bool) (new \ReflectionMethod($className, '__construct'))->getAttributes(HasNamedArguments::class)) { + if (null === $options) { + return new $className(); + } + + if (!\is_array($options)) { + return new $className($options); + } + + if (1 === \count($options) && isset($options['value'])) { + return new $className($options['value']); + } + return new $className(...$options); } diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/XmlFileLoader.php b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/XmlFileLoader.php index 1e070d609..83a14b2e8 100644 --- a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/XmlFileLoader.php +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/XmlFileLoader.php @@ -80,7 +80,9 @@ protected function parseConstraints(\SimpleXMLElement $nodes): array foreach ($nodes as $node) { if (\count($node) > 0) { if (\count($node->value) > 0) { - $options = $this->parseValues($node->value); + $options = [ + 'value' => $this->parseValues($node->value), + ]; } elseif (\count($node->constraint) > 0) { $options = $this->parseConstraints($node->constraint); } elseif (\count($node->option) > 0) { @@ -94,6 +96,10 @@ protected function parseConstraints(\SimpleXMLElement $nodes): array $options = null; } + if (isset($options['groups']) && !\is_array($options['groups'])) { + $options['groups'] = (array) $options['groups']; + } + $constraints[] = $this->newConstraint((string) $node['name'], $options); } diff --git a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/YamlFileLoader.php b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/YamlFileLoader.php index 34eaf4e5b..b117d7932 100644 --- a/upload/system/storage/vendor/symfony/validator/Mapping/Loader/YamlFileLoader.php +++ b/upload/system/storage/vendor/symfony/validator/Mapping/Loader/YamlFileLoader.php @@ -86,6 +86,12 @@ protected function parseNodes(array $nodes): array $options = $this->parseNodes($options); } + if (null !== $options && (!\is_array($options) || array_is_list($options))) { + $options = [ + 'value' => $options, + ]; + } + $values[] = $this->newConstraint(key($childNodes), $options); } else { if (\is_array($childNodes)) { diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ja.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ja.xlf index c977df4a3..9ec98ebbd 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ja.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.ja.xlf @@ -136,7 +136,7 @@ This value is not a valid IP address. - この値は有効なIPアドレスではありません。 + 有効なIPアドレスではありません。 This value is not a valid language. @@ -192,7 +192,7 @@ No temporary folder was configured in php.ini, or the configured folder does not exist. - php.iniに一時フォルダが設定されていないか、設定されたフォルダが存在しません。 + php.iniに一時フォルダが設定されていないか、設定されたフォルダが存在しません。 Cannot write temporary file to disk. @@ -224,7 +224,7 @@ This value is not a valid International Bank Account Number (IBAN). - この値は有効な国際銀行口座番号(IBAN)ではありません。 + 有効な国際銀行勘定番号(IBAN)ではありません。 This value is not a valid ISBN-10. @@ -312,7 +312,7 @@ This value is not a valid Business Identifier Code (BIC). - この値は有効なビジネス識別コード(BIC)ではありません。 + 有効なSWIFTコードではありません。 Error @@ -320,7 +320,7 @@ This value is not a valid UUID. - この値は有効なUUIDではありません。 + 有効なUUIDではありません。 This value should be a multiple of {{ compared_value }}. @@ -436,11 +436,11 @@ This value is not a valid MAC address. - この値は有効なMACアドレスではありません。 + 有効なMACアドレスではありません。 This URL is missing a top-level domain. - このURLはトップレベルドメインがありません。 + このURLはトップレベルドメインがありません。 diff --git a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.nl.xlf b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.nl.xlf index 7596799d0..aa4a3e215 100644 --- a/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.nl.xlf +++ b/upload/system/storage/vendor/symfony/validator/Resources/translations/validators.nl.xlf @@ -440,7 +440,7 @@ This URL is missing a top-level domain. - Deze URL mist een top-level domein. + Deze URL mist een top-level domein. diff --git a/upload/system/storage/vendor/symfony/validator/Test/ConstraintValidatorTestCase.php b/upload/system/storage/vendor/symfony/validator/Test/ConstraintValidatorTestCase.php index 56a3dafb9..803df588d 100644 --- a/upload/system/storage/vendor/symfony/validator/Test/ConstraintValidatorTestCase.php +++ b/upload/system/storage/vendor/symfony/validator/Test/ConstraintValidatorTestCase.php @@ -82,8 +82,10 @@ protected function setUp(): void $this->validator = $this->createValidator(); $this->validator->initialize($this->context); - $this->defaultLocale = \Locale::getDefault(); - \Locale::setDefault('en'); + if (class_exists(\Locale::class)) { + $this->defaultLocale = \Locale::getDefault(); + \Locale::setDefault('en'); + } $this->expectedViolations = []; $this->call = 0; @@ -95,7 +97,9 @@ protected function tearDown(): void { $this->restoreDefaultTimezone(); - \Locale::setDefault($this->defaultLocale); + if (class_exists(\Locale::class)) { + \Locale::setDefault($this->defaultLocale); + } } protected function setDefaultTimezone(?string $defaultTimezone) diff --git a/upload/system/storage/vendor/symfony/validator/composer.json b/upload/system/storage/vendor/symfony/validator/composer.json index 4f55dd2d1..1076a7485 100644 --- a/upload/system/storage/vendor/symfony/validator/composer.json +++ b/upload/system/storage/vendor/symfony/validator/composer.json @@ -54,7 +54,8 @@ "autoload": { "psr-4": { "Symfony\\Component\\Validator\\": "" }, "exclude-from-classmap": [ - "/Tests/" + "/Tests/", + "/Resources/bin/" ] }, "minimum-stability": "dev"