Avoid variables with short names like $st. Configured minimum length is 3.
Short variable names may make your code harder to understand. Variable names should
be self-descriptive. This check looks for variable names who are shorter than
a configured minimum.
Loading history...
20
{
21
if (count($st->stmts) == 0) {
22
return false;
23
}
24
25
$result = false;
26
27
if ($st->name == '__construct' || $st->name == '__destruct') {
28
foreach ($st->stmts as $stmt) {
29
if ($stmt instanceof Return_) {
30
if (!$stmt->expr) {
31
continue;
32
}
33
34
$context->notice(
35
'return.construct',
36
sprintf('Method %s cannot return a value.', $st->name),
Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.