-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from mlocati/patch-zf-zend-code
Patch Zend Code for PHP 7.3 compatibility
- Loading branch information
Showing
2 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
From 473be1000f25aadcf09b815d7210707121e79681 Mon Sep 17 00:00:00 2001 | ||
From: Michele Locati <michele@locati.it> | ||
Date: Thu, 29 Nov 2018 14:11:36 +0100 | ||
Subject: [PATCH] Use break instead of continue in switch statements | ||
|
||
--- | ||
src/Generator/FileGenerator.php | 6 +++--- | ||
src/Reflection/MethodReflection.php | 14 +++++++------- | ||
2 files changed, 10 insertions(+), 10 deletions(-) | ||
|
||
diff --git a/src/Generator/FileGenerator.php b/src/Generator/FileGenerator.php | ||
index f9dfba23..8eb8326b 100644 | ||
--- a/src/Generator/FileGenerator.php | ||
+++ b/src/Generator/FileGenerator.php | ||
@@ -132,13 +132,13 @@ class FileGenerator extends AbstractGenerator | ||
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; | ||
diff --git a/src/Reflection/MethodReflection.php b/src/Reflection/MethodReflection.php | ||
index ecd654fc..3f8850b7 100644 | ||
--- a/src/Reflection/MethodReflection.php | ||
+++ b/src/Reflection/MethodReflection.php | ||
@@ -269,22 +269,22 @@ class MethodReflection extends PhpReflectionMethod implements ReflectionInterfac | ||
//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; | ||
} | ||
} | ||
|
||
@@ -293,7 +293,7 @@ class MethodReflection extends PhpReflectionMethod implements ReflectionInterfac | ||
|
||
case "}": | ||
if ($capture === false) { | ||
- continue; | ||
+ break; | ||
} | ||
|
||
//check to see if this is the last brace | ||
@@ -311,12 +311,12 @@ class MethodReflection extends PhpReflectionMethod implements ReflectionInterfac | ||
|
||
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; |