Type Coverage

Type coverage reports how much of the PHP code has types. The elements that can be typed are:

  • arguments in methods

  • return type

  • properties

  • class constants

Some elements cannot be typed: + arrays + lexical variables + yield values + local variables

<?php

function foo($i = 0) : int {
    return $i + 1;
}

?>

See also https://tomasvotruba.com/blog/how-to-measure-your-type-coverage

Related : Type System, Coverage

Related packages : tomasvotruba/type-coverage