Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 238 Bytes

InvalidNullableReturnType.md

File metadata and controls

15 lines (11 loc) · 238 Bytes

InvalidNullableReturnType

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 null;
}