oportunidades 7
tests / ci (push) Waiting to run

This commit is contained in:
2026-10-13 11:40:29 +02:00
parent 20971d523f
commit 287e991486
2902 changed files with 1085456 additions and 25957 deletions
@@ -0,0 +1,25 @@
<?php
namespace App\Services;
/** Normalize object key order only. Ordered coordinates and lists retain their meaning. */
class OpportunityCanonicalValue
{
public static function hash(mixed $value): string
{
return hash('sha256', json_encode(self::normalize($value), JSON_THROW_ON_ERROR));
}
private static function normalize(mixed $value): mixed
{
if (! is_array($value)) {
return $value;
}
$result = array_map(self::normalize(...), $value);
if (! array_is_list($result)) {
ksort($result);
}
return $result;
}
}