Total Complexity | 7 |
Total Lines | 62 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | class PaylaterLogModuleFrontController extends ModuleFrontController |
||
|
|||
14 | { |
||
15 | /** |
||
16 | * @var string $message |
||
17 | */ |
||
18 | protected $message; |
||
19 | |||
20 | /** |
||
21 | * @var bool $error |
||
22 | */ |
||
23 | protected $error = false; |
||
24 | |||
25 | /** |
||
26 | * Controller index method: |
||
27 | */ |
||
28 | public function postProcess() |
||
29 | { |
||
30 | if (!$this->authorize()) { |
||
31 | return; |
||
32 | }; |
||
33 | |||
34 | |||
35 | $sql = 'SELECT * FROM '._DB_PREFIX_.'pmt_logs ORDER BY id desc LIMIT 200'; |
||
36 | if ($results = Db::getInstance()->ExecuteS($sql)) { |
||
37 | foreach ($results as $row) { |
||
38 | $this->message[] = json_decode($row['log']); |
||
39 | } |
||
40 | } |
||
41 | |||
42 | $this->jsonResponse(); |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * Send a jsonResponse |
||
47 | */ |
||
48 | public function jsonResponse() |
||
49 | { |
||
50 | $result = json_encode($this->message); |
||
51 | |||
52 | header('HTTP/1.1 200 Ok', true, 200); |
||
53 | header('Content-Type: application/json', true); |
||
54 | header('Content-Length: ' . Tools::strlen($result)); |
||
55 | |||
56 | echo $result; |
||
57 | exit(); |
||
58 | } |
||
59 | |||
60 | /** |
||
61 | * @return bool|null |
||
62 | */ |
||
63 | public function authorize() |
||
75 | } |
||
76 | } |
||
77 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths