Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Replace "continue" by "break" in "switch" statements
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Aug 3, 2018
1 parent af13903 commit 4bf6368
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/Generator/FileGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,17 @@ public static function fromArray(array $values)
switch (strtolower(str_replace(['.', '-', '_'], '', $name))) {
case 'filename':
$fileGenerator->setFilename($value);
continue;
break;
case 'class':
$fileGenerator->setClass(
$value instanceof ClassGenerator
? $value
: ClassGenerator::fromArray($value)
);
continue;
break;
case 'requiredfiles':
$fileGenerator->setRequiredFiles($value);
continue;
break;
default:
if (property_exists($fileGenerator, $name)) {
$fileGenerator->{$name} = $value;
Expand Down
14 changes: 7 additions & 7 deletions src/Reflection/MethodReflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,22 +287,22 @@ protected function extractMethodContents($bodyOnly = false)
//closure test
if ($firstBrace && $tokenType == 'T_FUNCTION') {
$body .= $tokenValue;
continue;
break;
}
$capture = false;
continue;
break;
}
break;

case '{':
if ($capture === false) {
continue;
break;
}

if ($firstBrace === false) {
$firstBrace = true;
if ($bodyOnly === true) {
continue;
break;
}
}

Expand All @@ -311,7 +311,7 @@ protected function extractMethodContents($bodyOnly = false)

case '}':
if ($capture === false) {
continue;
break;
}

//check to see if this is the last brace
Expand All @@ -329,12 +329,12 @@ protected function extractMethodContents($bodyOnly = false)

default:
if ($capture === false) {
continue;
break;
}

// if returning body only wait for first brace before capturing
if ($bodyOnly === true && $firstBrace !== true) {
continue;
break;
}

$body .= $tokenValue;
Expand Down

0 comments on commit 4bf6368

Please sign in to comment.