private function loadBlockEndPosition(): ?int
    {
        $endPos = $this->file->findPrevious(
            [T_DOC_COMMENT_CLOSE_TAG],
            $this->stackPos - 1,
            // Search till the next method, property, etc ...
            TokenHelper::findPreviousExcluding(
                $this->file,
                TokenHelper::$ineffectiveTokenCodes + Tokens::$methodPrefixes,
                $this->stackPos - 1
            )
        );

        return ((int) $endPos) > 0 ? $endPos : null;
    }