Skip to content

Commit

Permalink
Fix PHP Warning: "continue" targeting switch is equivalent to "break". (
Browse files Browse the repository at this point in the history
  • Loading branch information
colinmollenhour committed Jun 4, 2020
1 parent 3d4c4e2 commit 6321b98
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/Zend/Feed/Entry/Atom.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function delete()
// Redirect
case 3:
$deleteUri = $response->getHeader('Location');
continue;
break;
// Error
default:
/**
Expand Down
6 changes: 3 additions & 3 deletions lib/Zend/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,7 @@ public function addElements(array $elements)
} else {
switch ($argc) {
case 0:
continue;
break;
case (1 <= $argc):
$type = array_shift($spec);
case (2 <= $argc):
Expand Down Expand Up @@ -1675,7 +1675,7 @@ public function addSubForm(Zend_Form $form, $name, $order = null)
*/
public function addSubForms(array $subForms)
{
foreach ($subForms as $key => $spec) {
foreach ($subForms as $key => $spec) {
$name = (string) $key;
if ($spec instanceof Zend_Form) {
$this->addSubForm($spec, $name);
Expand All @@ -1687,7 +1687,7 @@ public function addSubForms(array $subForms)
$order = null;
switch ($argc) {
case 0:
continue;
break;
case (1 <= $argc):
$subForm = array_shift($spec);

Expand Down
6 changes: 3 additions & 3 deletions lib/Zend/Pdf/FileParser/Font/OpenType.php
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ protected function _parseCmapTable()
if ($language != 0) {
$this->_debugLog('Type 0 cmap tables must be language-independent;'
. ' language: %d; skipping', $language);
continue;
break;
}
break;

Expand All @@ -917,7 +917,7 @@ protected function _parseCmapTable()
case 0xa: // break intentionally omitted
case 0xc:
$this->_debugLog('Format: 0x%x currently unsupported; skipping', $format);
continue;
break;
//$this->skipBytes(2);
//$cmapLength = $this->readUInt(4);
//$language = $this->readUInt(4);
Expand All @@ -929,7 +929,7 @@ protected function _parseCmapTable()

default:
$this->_debugLog('Unknown subtable format: 0x%x; skipping', $format);
continue;
break;
}
$cmapType = $format;
break;
Expand Down
10 changes: 5 additions & 5 deletions lib/Zend/Reflection/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class Zend_Reflection_File implements Reflector
public function __construct($file)
{
$fileName = $file;

$fileRealpath = realpath($fileName);
if ($fileRealpath) {
// realpath() doesn't return false if Suhosin is included
Expand All @@ -95,7 +95,7 @@ public function __construct($file)
$fileRealpath = false;
}
}

if ($fileRealpath === false) {
$fileRealpath = self::findRealpathInIncludePath($file);
}
Expand Down Expand Up @@ -355,7 +355,7 @@ protected function _reflect()
case T_DOLLAR_OPEN_CURLY_BRACES:
case T_CURLY_OPEN:
$embeddedVariableTrapped = true;
continue;
break;

// Name of something
case T_STRING:
Expand All @@ -366,15 +366,15 @@ protected function _reflect()
$this->_classes[] = $value;
$classTrapped = false;
}
continue;
break;

// Required file names are T_CONSTANT_ENCAPSED_STRING
case T_CONSTANT_ENCAPSED_STRING:
if ($requireTrapped) {
$this->_requiredFiles[] = $value ."\n";
$requireTrapped = false;
}
continue;
break;

// Functions
case T_FUNCTION:
Expand Down

0 comments on commit 6321b98

Please sign in to comment.