1 | <?php |
||
14 | class Reactor |
||
15 | { |
||
16 | /** |
||
17 | * @var Filters |
||
18 | */ |
||
19 | protected $filters; |
||
20 | |||
21 | /** |
||
22 | * @var ReactionInterface[] |
||
23 | */ |
||
24 | protected $reactions; |
||
25 | |||
26 | /** |
||
27 | * @var NormalizerInterface[] |
||
28 | */ |
||
29 | protected $normalizers; |
||
30 | |||
31 | /** |
||
32 | * @param Filters $filters |
||
33 | * @param ReactionInterface[] $reactions |
||
34 | * @param NormalizerInterface[] $normalizers |
||
35 | */ |
||
36 | public function __construct(Filters $filters, array $reactions = [], array $normalizers) |
||
42 | |||
43 | /** |
||
44 | * Build an instance of the Handler by using the most common defaults. |
||
45 | * |
||
46 | * @param LoggerInterface $logger |
||
47 | * @return static |
||
48 | */ |
||
49 | static public function factory(LoggerInterface $logger, $threshold = 0) |
||
63 | |||
64 | /** |
||
65 | * Check a given request against the defined filters. |
||
66 | * |
||
67 | * @param ServerRequestInterface $request |
||
68 | */ |
||
69 | public function digest(ServerRequestInterface $request) |
||
79 | |||
80 | /** |
||
81 | * @param array $parameters |
||
82 | * @return array |
||
83 | */ |
||
84 | public function normalize(array $parameters) |
||
92 | |||
93 | /** |
||
94 | * @param Report $report |
||
95 | */ |
||
96 | public function broadcast(Report $report) |
||
104 | |||
105 | /** |
||
106 | * Get the values that should be checked for security intrusions. |
||
107 | * |
||
108 | * @param ServerRequestInterface $request |
||
109 | * @return array |
||
110 | */ |
||
111 | protected function getVerifiableParameters(ServerRequestInterface $request) |
||
115 | } |