-
Notifications
You must be signed in to change notification settings - Fork 169
/
IntegrationFilterFactory.php
35 lines (29 loc) · 1.07 KB
/
IntegrationFilterFactory.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
namespace Sentry\SentryBundle\DependencyInjection;
use Sentry\Integration\ErrorListenerIntegration;
use Sentry\Integration\ExceptionListenerIntegration;
use Sentry\Integration\IntegrationInterface;
class IntegrationFilterFactory
{
/**
* @param IntegrationInterface[] $integrationsFromConfiguration
*/
public static function create(array $integrationsFromConfiguration): callable
{
return function (array $integrations) use ($integrationsFromConfiguration) {
$allIntegrations = array_merge($integrations, $integrationsFromConfiguration);
return array_filter(
$allIntegrations,
static function (IntegrationInterface $integration): bool {
if ($integration instanceof ErrorListenerIntegration) {
return false;
}
if ($integration instanceof ExceptionListenerIntegration) {
return false;
}
return true;
}
);
};
}
}