Aggiornato Composer

This commit is contained in:
Paolo A
2024-05-17 12:24:19 +00:00
parent 4ac62108b5
commit ec201d75b2
2238 changed files with 38684 additions and 59785 deletions

View File

@@ -59,6 +59,9 @@ class Flare
/** @var callable|null */
protected $filterExceptionsCallable;
/** @var callable|null */
protected $filterReportsCallable;
public static function register(string $apiKey, string $apiSecret = null, ContextDetectorInterface $contextDetector = null, Container $container = null)
{
$client = new Client($apiKey, $apiSecret);
@@ -81,6 +84,11 @@ class Flare
$this->filterExceptionsCallable = $filterExceptionsCallable;
}
public function filterReportsUsing(callable $filterReportsCallable)
{
$this->filterReportsCallable = $filterReportsCallable;
}
/**
* @return null|string
*/
@@ -242,6 +250,12 @@ class Flare
private function sendReportToApi(Report $report)
{
if ($this->filterReportsCallable) {
if (! call_user_func($this->filterReportsCallable, $report)) {
return;
}
}
try {
$this->api->report($report);
} catch (Exception $exception) {

View File

@@ -322,7 +322,6 @@ class Report
{
// Generate 16 bytes (128 bits) of random data or use the data passed into the function.
$data = $data ?? random_bytes(16);
assert(strlen($data) == 16);
// Set version to 0100
$data[6] = chr(ord($data[6]) & 0x0f | 0x40);