Server :
Apache
System :
Linux server1.cbinetwhm.bi 4.18.0-553.123.1.el8_10.x86_64 #1 SMP Tue May 5 04:00:43 EDT 2026 x86_64
User :
fenacobu (1017)
PHP Version :
8.2.33
Disable Functions :
NONE
Current Directory :
/home/fenacobu/www/libraries/vendor/willdurand/negotiation/src/Negotiation/
Directory Status:
Writeable | Document Root:
Writeable
Upload File
Viewing: /home/fenacobu/www/libraries/vendor/willdurand/negotiation/src/Negotiation/AcceptMatch.php
<?php
namespace Negotiation;
final class AcceptMatch
{
/**
* @var float
*/
public $quality;
/**
* @var int
*/
public $score;
/**
* @var int
*/
public $index;
public function __construct($quality, $score, $index)
{
$this->quality = $quality;
$this->score = $score;
$this->index = $index;
}
/**
* @param AcceptMatch $a
* @param AcceptMatch $b
*
* @return int
*/
public static function compare(AcceptMatch $a, AcceptMatch $b)
{
if ($a->quality !== $b->quality) {
return $a->quality > $b->quality ? -1 : 1;
}
if ($a->index !== $b->index) {
return $a->index > $b->index ? 1 : -1;
}
return 0;
}
/**
* @param array $carry reduced array
* @param AcceptMatch $match match to be reduced
*
* @return AcceptMatch[]
*/
public static function reduce(array $carry, AcceptMatch $match)
{
if (!isset($carry[$match->index]) || $carry[$match->index]->score < $match->score) {
$carry[$match->index] = $match;
}
return $carry;
}
}
Cyb3r Drag0nz Team • Google Edition