Skip to content

Commit cca4df1

Browse files
author
Greg Bowler
committed
Correct use of continue within switch
1 parent 8ec3024 commit cca4df1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Translator.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ protected function convertSingleSelector(string $css):string {
9090

9191
case 'contains':
9292
if (empty($specifier)) {
93-
continue;
93+
continue 3;
9494
}
9595

9696
$xpath []= "[contains(text(),$specifier)]";
@@ -103,7 +103,7 @@ protected function convertSingleSelector(string $css):string {
103103

104104
case 'nth-child':
105105
if (empty($specifier)) {
106-
continue;
106+
continue 3;
107107
}
108108

109109
$prev = count($xpath) - 1;
@@ -118,7 +118,7 @@ protected function convertSingleSelector(string $css):string {
118118
break;
119119
case 'nth-of-type':
120120
if (empty($specifier)) {
121-
continue;
121+
continue 3;
122122
}
123123

124124
$prev = count($xpath) - 1;
@@ -161,9 +161,9 @@ protected function convertSingleSelector(string $css):string {
161161
$detailValue = $detail[1] ?? null;
162162

163163
if(!$detailType
164-
|| $detailType["type"] !== "attribute_equals") {
164+
|| $detailType["type"] !== "attribute_equals") {
165165
$xpath []= "[@{$currentThreadItem['content']}]";
166-
continue;
166+
continue 2;
167167
}
168168

169169
$valueString = trim(

0 commit comments

Comments
 (0)