-
Notifications
You must be signed in to change notification settings - Fork 0
/
Factory.php
40 lines (33 loc) · 1.03 KB
/
Factory.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
36
37
38
39
40
<?php
/**
* Qubus\Error
*
* @link https://github.com/QubusPHP/error
* @copyright 2022
* @author Joshua Parker <[email protected]>
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
declare(strict_types=1);
namespace Qubus\Error;
use Psr\Log\LoggerInterface;
use Qubus\Error\Handlers\DebugErrorHandler;
use Qubus\Error\Handlers\Psr3ErrorHandler;
use Qubus\Error\Handlers\ProductionErrorHandler;
class Factory
{
public static function createDebugErrorHandler(): DebugErrorHandler
{
return new DebugErrorHandler();
}
public static function createPsr3ErrorHandler(LoggerInterface $logger): Psr3ErrorHandler
{
return new Psr3ErrorHandler($logger);
}
public static function createProductionErrorHandler(
bool $displayErrors = false,
bool $notifyPsr3Loggers = false,
bool $notifyNativePhpLog = true
): ProductionErrorHandler {
return new ProductionErrorHandler($displayErrors, $notifyPsr3Loggers, $notifyNativePhpLog);
}
}