protected function findNextCase(File $phpcsFile, $stackPtr, $end) {
		$tokens = $phpcsFile->getTokens();
		while (($stackPtr = $phpcsFile->findNext([T_CASE, T_DEFAULT, T_SWITCH], $stackPtr, $end)) !== false) {
			// Skip nested SWITCH statements; they are handled on their own.
			if ($tokens[$stackPtr]['code'] === T_SWITCH) {
				$stackPtr = $tokens[$stackPtr]['scope_closer'];
				continue;
			}

			break;
		}

		return $stackPtr;
	}