Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 239 Bytes

InvalidFalsableReturnType.md

File metadata and controls

15 lines (11 loc) · 239 Bytes

InvalidFalsableReturnType

Emitted when a function can return a nullable value, but its given return type says otherwise

<?php

function foo() : string {
    if (rand(0, 1)) {
        return "foo";
    }

    return false;
}