Aggiornato Composer
This commit is contained in:
14
vendor/facade/flare-client-php/src/Flare.php
vendored
14
vendor/facade/flare-client-php/src/Flare.php
vendored
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user