Enhancement
Static code analysis to catch semantic errors
Issue description
Currently "semantic" errors can only be caught during runtime. This creates two points of friction:
- During development of new functions changes are very frequent and since system are often already productive at that point users are inhibited in their productivity.
- When adjusting an existing store or a module to fit the needs of a new project, changes are often numereous and errors are introduced due to model changes.
Developer comments
A "semantic" error is any premature termination (exception or fatal error) of a PHP runtime while store specific code is currently executed.
Shorter: A "semantic" error is any PHP runtime error caused by store code.
Use cases
This should be caught upon saving:
[%function compute_to_cc(?string $alt_email = null): array {
if ($alt_email === null) {
return [
$this->get_email_address(),
$this->get_all_email_address_cc()->to_array()
];
}
return [$to, []];
}%]
%$to% should be %$alt_email%.
This should be caught upon saving:
[%$data[txt("delivery_date")] = format_date($load->comute_delivery_date());%]
%comute% should be %compute%.
[% if ($this->has_receipt() === fale) { ;%]
%fale% should be %false%.
|
|
We are sorry
This page cannot be displayed in your browser. Use Firefox, Opera, Safari, or Chrome instead.