Refactor using:

    if ( !isset... ) {
        throw
    }