1.2.1413. Variable Anf Property Typehint

Adds typehints to (local) variables and properties, by inference from the code.

Currently, the variable must be assigned only one type within its context to be typed. Non-typed variables limit the scope of other rules.

This is an internal tool, to help find definitions of classes. The same strategies may happen to arguments, though there is no syntax relay for variables.

<?php

function foo() {
    $a = 1;

    return $a;
}

?>

1.2.1413.1. Specs

Short name

Complete/VariableTypehint

Rulesets

All, Changed Behavior, First, NoDoc

Exakat since

2.3.2

PHP Version

All

Severity

Minor

Time To Fix

Quick (30 mins)

Precision

Medium

Features

variable, typehint

Available in

Entreprise Edition, Exakat Cloud