Skip to content

Commit

Permalink
Upgraded cardinity/cardinity-sdk-php vendor to v7.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCartpenter committed Jun 8, 2024
1 parent d9dc31a commit a04a0f2
Show file tree
Hide file tree
Showing 12 changed files with 106 additions and 34 deletions.
15 changes: 8 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 9 additions & 8 deletions upload/system/storage/vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -1272,15 +1272,16 @@
"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": {
"psr-4": {
"Symfony\\Component\\Validator\\": ""
},
"exclude-from-classmap": [
"/Tests/"
"/Tests/",
"/Resources/bin/"
]
},
"notification-url": "https://packagist.org/downloads/",
Expand All @@ -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": [
{
Expand Down
10 changes: 5 additions & 5 deletions upload/system/storage/vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
Expand Down Expand Up @@ -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()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
</trans-unit>
<trans-unit id="37" resname="This is not a valid IP address.">
<source>This value is not a valid IP address.</source>
<target state="needs-review-translation">この値は有効なIPアドレスではありません。</target>
<target>有効なIPアドレスではありません。</target>
</trans-unit>
<trans-unit id="38">
<source>This value is not a valid language.</source>
Expand Down Expand Up @@ -192,7 +192,7 @@
</trans-unit>
<trans-unit id="51" resname="No temporary folder was configured in php.ini.">
<source>No temporary folder was configured in php.ini, or the configured folder does not exist.</source>
<target state="needs-review-translation">php.iniに一時フォルダが設定されていないか、設定されたフォルダが存在しません。</target>
<target>php.iniに一時フォルダが設定されていないか、設定されたフォルダが存在しません。</target>
</trans-unit>
<trans-unit id="52">
<source>Cannot write temporary file to disk.</source>
Expand Down Expand Up @@ -224,7 +224,7 @@
</trans-unit>
<trans-unit id="59" resname="This is not a valid International Bank Account Number (IBAN).">
<source>This value is not a valid International Bank Account Number (IBAN).</source>
<target state="needs-review-translation">この値は有効な国際銀行口座番号(IBAN)ではありません。</target>
<target>有効な国際銀行勘定番号(IBAN)ではありません。</target>
</trans-unit>
<trans-unit id="60">
<source>This value is not a valid ISBN-10.</source>
Expand Down Expand Up @@ -312,15 +312,15 @@
</trans-unit>
<trans-unit id="81" resname="This is not a valid Business Identifier Code (BIC).">
<source>This value is not a valid Business Identifier Code (BIC).</source>
<target state="needs-review-translation">この値は有効なビジネス識別コード(BIC)ではありません。</target>
<target>有効なSWIFTコードではありません。</target>
</trans-unit>
<trans-unit id="82">
<source>Error</source>
<target>エラー</target>
</trans-unit>
<trans-unit id="83" resname="This is not a valid UUID.">
<source>This value is not a valid UUID.</source>
<target state="needs-review-translation">この値は有効なUUIDではありません。</target>
<target>有効なUUIDではありません。</target>
</trans-unit>
<trans-unit id="84">
<source>This value should be a multiple of {{ compared_value }}.</source>
Expand Down Expand Up @@ -436,11 +436,11 @@
</trans-unit>
<trans-unit id="112">
<source>This value is not a valid MAC address.</source>
<target state="needs-review-translation">この値は有効なMACアドレスではありません。</target>
<target>有効なMACアドレスではありません。</target>
</trans-unit>
<trans-unit id="113">
<source>This URL is missing a top-level domain.</source>
<target state="needs-review-translation">このURLはトップレベルドメインがありません。</target>
<target>このURLはトップレベルドメインがありません。</target>
</trans-unit>
</body>
</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@
</trans-unit>
<trans-unit id="113">
<source>This URL is missing a top-level domain.</source>
<target state="needs-review-translation">Deze URL mist een top-level domein.</target>
<target>Deze URL mist een top-level domein.</target>
</trans-unit>
</body>
</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion upload/system/storage/vendor/symfony/validator/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
"autoload": {
"psr-4": { "Symfony\\Component\\Validator\\": "" },
"exclude-from-classmap": [
"/Tests/"
"/Tests/",
"/Resources/bin/"
]
},
"minimum-stability": "dev"
Expand Down

0 comments on commit a04a0f2

Please sign in to comment.