1 | <?php |
||
14 | abstract class Base |
||
|
|||
15 | { |
||
16 | /** @var \App\Headers Headers instance. */ |
||
17 | public $headers; |
||
18 | |||
19 | /** @var Request Request object. */ |
||
20 | protected $request; |
||
21 | |||
22 | /** @var string Module name. */ |
||
23 | protected $moduleName; |
||
24 | |||
25 | /** |
||
26 | * Construct. |
||
27 | * |
||
28 | * @param \App\Request $request |
||
29 | */ |
||
30 | public function __construct(Request $request) |
||
40 | |||
41 | /** |
||
42 | * Login required. |
||
43 | * |
||
44 | * @return bool |
||
45 | */ |
||
46 | public function loginRequired(): bool |
||
50 | |||
51 | /** |
||
52 | * Main action. |
||
53 | * |
||
54 | * @return void |
||
55 | */ |
||
56 | abstract public function process(); |
||
57 | |||
58 | /** |
||
59 | * Validates request. Checks type of request. |
||
60 | * |
||
61 | * @return void |
||
62 | */ |
||
63 | abstract public function validateRequest(); |
||
64 | |||
65 | /** |
||
66 | * Action invoke before process. |
||
67 | * |
||
68 | * @return void |
||
69 | */ |
||
70 | abstract public function preProcess(); |
||
71 | |||
72 | /** |
||
73 | * Action invoke after process. |
||
74 | * |
||
75 | * @return void |
||
76 | */ |
||
77 | abstract public function postProcess(); |
||
78 | |||
79 | /** |
||
80 | * Action invoke before process for AJAX. |
||
81 | * |
||
82 | * @return void |
||
83 | */ |
||
84 | abstract public function preProcessAjax(); |
||
85 | |||
86 | /** |
||
87 | * Action invoke after process for AJAX. |
||
88 | * |
||
89 | * @return void |
||
90 | */ |
||
91 | abstract public function postProcessAjax(); |
||
92 | |||
93 | /** |
||
94 | * Send headers. |
||
95 | */ |
||
96 | public function sendHeaders() |
||
100 | |||
101 | /** |
||
102 | * Error handler. |
||
103 | * |
||
104 | * @param string $errno |
||
105 | * @param string $errstr |
||
106 | * @param string $errfile |
||
107 | * @param string $errline |
||
108 | * @param string $errcontext |
||
109 | * |
||
110 | * @return void |
||
111 | */ |
||
112 | public static function exceptionErrorHandler(int $errno, string $errstr, $errfile, $errline, $errcontext) |
||
116 | } |
||
117 |
This check examines a number of code elements and verifies that they conform to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.