Passed
Pull Request — master (#407)
by Ilya
04:29
created

getGlueSecurityAuditLogHandlerPlugins()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * This file is part of the Spryker Commerce OS.
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace Pyz\Glue\Log;
9
10
use Spryker\Glue\Log\LogDependencyProvider as SprykerLogDependencyProvider;
11
use Spryker\Glue\Log\Plugin\Handler\ExceptionStreamHandlerPlugin;
12
use Spryker\Glue\Log\Plugin\Handler\StreamHandlerPlugin;
13
use Spryker\Glue\Log\Plugin\Log\AuditLogMetaDataProcessorPlugin;
14
use Spryker\Glue\Log\Plugin\Log\AuditLogRequestProcessorPlugin;
15
use Spryker\Glue\Log\Plugin\Log\AuditLogTagFilterBufferedStreamHandlerPlugin;
16
use Spryker\Glue\Log\Plugin\Processor\EnvironmentProcessorPlugin;
17
use Spryker\Glue\Log\Plugin\Processor\GuzzleBodyProcessorPlugin;
18
use Spryker\Glue\Log\Plugin\Processor\PsrLogMessageProcessorPlugin;
19
use Spryker\Glue\Log\Plugin\Processor\RequestProcessorPlugin;
20
use Spryker\Glue\Log\Plugin\Processor\ResponseProcessorPlugin;
21
use Spryker\Glue\Log\Plugin\Processor\ServerProcessorPlugin;
22
23
class LogDependencyProvider extends SprykerLogDependencyProvider
24
{
25
    /**
26
     * @return array<\Monolog\Handler\HandlerInterface>
27
     */
28
    protected function getLogHandlers(): array
29
    {
30
        return [
31
            new StreamHandlerPlugin(),
32
            new ExceptionStreamHandlerPlugin(),
33
        ];
34
    }
35
36
    /**
37
     * @return list<\Spryker\Shared\Log\Dependency\Plugin\LogHandlerPluginInterface>
38
     */
39
    protected function getGlueSecurityAuditLogHandlerPlugins(): array
40
    {
41
        return [
0 ignored issues
show
Bug Best Practice introduced by
The expression return array(new Spryker...dStreamHandlerPlugin()) returns the type array<integer,Spryker\Gl...redStreamHandlerPlugin> which is incompatible with the documented return type Pyz\Glue\Log\list.
Loading history...
42
            new AuditLogTagFilterBufferedStreamHandlerPlugin(),
43
        ];
44
    }
45
46
    /**
47
     * @return list<\Spryker\Shared\Log\Dependency\Plugin\LogHandlerPluginInterface>
48
     */
49
    protected function getGlueBackendSecurityAuditLogHandlerPlugins(): array
50
    {
51
        return [
0 ignored issues
show
Bug Best Practice introduced by
The expression return array(new Spryker...dStreamHandlerPlugin()) returns the type array<integer,Spryker\Gl...redStreamHandlerPlugin> which is incompatible with the documented return type Pyz\Glue\Log\list.
Loading history...
52
            new AuditLogTagFilterBufferedStreamHandlerPlugin(),
53
        ];
54
    }
55
56
    /**
57
     * @return array<\Spryker\Shared\Log\Dependency\Plugin\LogProcessorPluginInterface>
58
     */
59
    protected function getProcessors(): array
60
    {
61
        return [
62
            new PsrLogMessageProcessorPlugin(),
63
            new EnvironmentProcessorPlugin(),
64
            new ServerProcessorPlugin(),
65
            new RequestProcessorPlugin(),
66
            new ResponseProcessorPlugin(),
67
            new GuzzleBodyProcessorPlugin(),
68
        ];
69
    }
70
71
72
    /**
73
     * @return list<\Spryker\Shared\Log\Dependency\Plugin\LogProcessorPluginInterface>
74
     */
75
    protected function getGlueSecurityAuditLogProcessorPlugins(): array
76
    {
77
        return [
78
            new PsrLogMessageProcessorPlugin(),
79
            new EnvironmentProcessorPlugin(),
80
            new ServerProcessorPlugin(),
81
            new AuditLogRequestProcessorPlugin(),
82
            new ResponseProcessorPlugin(),
83
            new AuditLogMetaDataProcessorPlugin(),
84
        ];
85
    }
86
87
    /**
88
     * @return list<\Spryker\Shared\Log\Dependency\Plugin\LogProcessorPluginInterface>
89
     */
90
    protected function getGlueBackendSecurityAuditLogProcessorPlugins(): array
91
    {
92
        return [
93
            new PsrLogMessageProcessorPlugin(),
94
            new EnvironmentProcessorPlugin(),
95
            new ServerProcessorPlugin(),
96
            new AuditLogRequestProcessorPlugin(),
97
            new ResponseProcessorPlugin(),
98
            new AuditLogMetaDataProcessorPlugin(),
99
        ];
100
    }
101
}
102