1.2.705. Missing Typehint

No typehint was found for a parameter, a return type for a method or a property.

void is considered a specified typehint, and is not reported here.

<?php

class x {
    private $no_property;

    function foo($no_typehint) : void {}

    function no_return_type() {}
}
?>

See also Type Declaration.

1.2.705.1. Suggestions

  • Add a type to the argument, property or method

1.2.705.2. Specs

Short name

Functions/MissingTypehint

Rulesets

All, Typechecks

Exakat since

2.0.5

PHP Version

All

Severity

Minor

Time To Fix

Quick (30 mins)

Precision

Very high

Features

typehint

Available in

Entreprise Edition, Exakat Cloud