Variable not Initialized


#1

I don’t know how exactly search for that, but I wounder if there’s a package that highlight those vars not initialized. For example:

function update()
{
    $user = new User();
    $cliente->setCreatedBy($user->getId()); // $cliente not exists in this context
    $cliente->save();
}

#2

You might want to take a look at the linter package and see if some add-ons for it support the kinds of checks you’re looking for.


#3

Right, thank you.