Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/core#117 Replace useage of deprecated function each with foreach … #211

Merged
merged 1 commit into from
May 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Mail/mime.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ function __construct($params = array())

// Update build parameters
if (!empty($params) && is_array($params)) {
while (list($key, $value) = each($params)) {
foreach ($params as $key => $value) {
$this->_build_params[$key] = $value;
}
}
Expand Down Expand Up @@ -842,7 +842,7 @@ function saveMessageBody($filename, $params = null)
function &get($params = null, $filename = null, $skip_head = false)
{
if (isset($params)) {
while (list($key, $value) = each($params)) {
foreach ($params as $key => $value) {
$this->_build_params[$key] = $value;
}
}
Expand Down Expand Up @@ -1283,7 +1283,7 @@ function encodeRecipients($recipients)
function _encodeHeaders($input, $params = array())
{
$build_params = $this->_build_params;
while (list($key, $value) = each($params)) {
foreach ($params as $key => $value) {
$build_params[$key] = $value;
}

Expand Down
6 changes: 3 additions & 3 deletions Mail/mimeDecode.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ function _decode($headers, $body, $default_ctype = 'text/plain')
}

reset($headers);
while (list($key, $value) = each($headers)) {
foreach($headers as $key => $value) {
$headers[$key]['name'] = strtolower($headers[$key]['name']);
switch ($headers[$key]['name']) {

Expand All @@ -273,7 +273,7 @@ function _decode($headers, $body, $default_ctype = 'text/plain')
}

if (isset($content_type['other'])) {
while (list($p_name, $p_value) = each($content_type['other'])) {
foreach ($content_type['other'] as $p_name => $p_value) {
$return->ctype_parameters[$p_name] = $p_value;
}
}
Expand All @@ -283,7 +283,7 @@ function _decode($headers, $body, $default_ctype = 'text/plain')
$content_disposition = $this->_parseHeaderValue($headers[$key]['value']);
$return->disposition = $content_disposition['value'];
if (isset($content_disposition['other'])) {
while (list($p_name, $p_value) = each($content_disposition['other'])) {
foreach ($content_type['other'] as $p_name => $p_value) {
$return->d_parameters[$p_name] = $p_value;
}
}
Expand Down
2 changes: 1 addition & 1 deletion Mail/mimePart.php
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ function _quotedPrintableEncode($input , $line_max = 76)
$escape = '=';
$output = '';

while (list($idx, $line) = each($lines)) {
foreach ($lines as $idx => $line) {
$newline = '';
$i = 0;

Expand Down