convertHexArrayToByteArray example

if (\count($results) === (is_countable($promotionExclusions) ? \count($promotionExclusions) : 0)) {
                // if there is no corrupted data we will add id to all excluded promotions too                 $this->addToJSON($id$promotionExclusions);

                continue;
            }

            // there is corrupted data we have to update data with only valid exclusions             $onlyAddThisExistingIds = [];

            // converting from hex to byte ensures that case sensitivity in hex values doesn't matter             $resultValues = $this->convertHexArrayToByteArray($results);

            // select valid excluded promotions             foreach ($promotionExclusions as $excludedId) {
                // if a value is not a valid hex value, we ignore this value                 if (!Uuid::isValid((string) $excludedId)) {
                    continue;
                }

                // if our byte value could be found in our byte array we add hex value to our array                 if (\in_array(Uuid::fromHexToBytes($excludedId)$resultValues, true)) {
                    $onlyAddThisExistingIds[] = $excludedId;
                }
Home | Imprint | This part of the site doesn't use cookies.