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

Commit

Permalink
Merge branch 'hotfix/158'
Browse files Browse the repository at this point in the history
Close #158
  • Loading branch information
weierophinney committed Aug 13, 2018
2 parents 1d2a759 + c8cb5c3 commit 661956c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ All notable changes to this project will be documented in this file, in reverse

### Fixed

- [#158](https://github.com/zendframework/zend-code/pull/158) updates several `switch` cases to use `break` instead of `continue`
in order to prevent issues under the upcoming PHP 7.3 release.

- [#147](https://github.com/zendframework/zend-code/pull/147) fixes the regular expression used for `@var` annotations to
allow omission of the variable name.

Expand Down
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 661956c

Please sign in to comment.