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

Commit 661956c

Browse files
committed
Merge branch 'hotfix/158'
Close #158
2 parents 1d2a759 + c8cb5c3 commit 661956c

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ All notable changes to this project will be documented in this file, in reverse
2222

2323
### Fixed
2424

25+
- [#158](https://github.com/zendframework/zend-code/pull/158) updates several `switch` cases to use `break` instead of `continue`
26+
in order to prevent issues under the upcoming PHP 7.3 release.
27+
2528
- [#147](https://github.com/zendframework/zend-code/pull/147) fixes the regular expression used for `@var` annotations to
2629
allow omission of the variable name.
2730

src/Generator/FileGenerator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,17 +155,17 @@ public static function fromArray(array $values)
155155
switch (strtolower(str_replace(['.', '-', '_'], '', $name))) {
156156
case 'filename':
157157
$fileGenerator->setFilename($value);
158-
continue;
158+
break;
159159
case 'class':
160160
$fileGenerator->setClass(
161161
$value instanceof ClassGenerator
162162
? $value
163163
: ClassGenerator::fromArray($value)
164164
);
165-
continue;
165+
break;
166166
case 'requiredfiles':
167167
$fileGenerator->setRequiredFiles($value);
168-
continue;
168+
break;
169169
default:
170170
if (property_exists($fileGenerator, $name)) {
171171
$fileGenerator->{$name} = $value;

src/Reflection/MethodReflection.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -287,22 +287,22 @@ protected function extractMethodContents($bodyOnly = false)
287287
//closure test
288288
if ($firstBrace && $tokenType == 'T_FUNCTION') {
289289
$body .= $tokenValue;
290-
continue;
290+
break;
291291
}
292292
$capture = false;
293-
continue;
293+
break;
294294
}
295295
break;
296296

297297
case '{':
298298
if ($capture === false) {
299-
continue;
299+
break;
300300
}
301301

302302
if ($firstBrace === false) {
303303
$firstBrace = true;
304304
if ($bodyOnly === true) {
305-
continue;
305+
break;
306306
}
307307
}
308308

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

312312
case '}':
313313
if ($capture === false) {
314-
continue;
314+
break;
315315
}
316316

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

330330
default:
331331
if ($capture === false) {
332-
continue;
332+
break;
333333
}
334334

335335
// if returning body only wait for first brace before capturing
336336
if ($bodyOnly === true && $firstBrace !== true) {
337-
continue;
337+
break;
338338
}
339339

340340
$body .= $tokenValue;

0 commit comments

Comments
 (0)