public static function hasFrame(string $buffer): bool
    {
        $bufferLength = strlen($buffer);
        if ($bufferLength < FCGI::HEADER_LEN) {
            return false;
        }

        $fastInfo = unpack(FCGI::HEADER_FORMAT, $buffer);
        if ($bufferLength < FCGI::HEADER_LEN + $fastInfo['contentLength'] + $fastInfo['paddingLength']) {
            return false;
        }

        return true;
    }
public static function hasFrame(string $buffer): bool
    {
        $bufferLength = strlen($buffer);
        if ($bufferLength < FCGI::HEADER_LEN) {
            return false;
        }

        $fastInfo = unpack(FCGI::HEADER_FORMAT, $buffer);
        if ($bufferLength < FCGI::HEADER_LEN + $fastInfo['contentLength'] + $fastInfo['paddingLength']) {
            return false;
        }

        return true;
    }
public static function hasFrame ( string $ buffer ) : bool { $ bufferLength = strlen ( $ buffer ) ; if ( $ bufferLength < FCGI :: HEADER_LEN ) { return false ; } $ fastInfo = unpack ( FCGI :: HEADER_FORMAT , $ buffer ) ; if ( $ bufferLength < FCGI :: HEADER_LEN + $ fastInfo [ 'contentLength' ] + $ fastInfo [ 'paddingLength' ] ) { return false ; } return true ; }
Checks if the buffer contains a valid frame to parse

@param string $buffer Binary buffer

@return bool
Checks if the buffer contains a valid frame to parse