Permalink
Browse files

More PHP 7.2 fixes in dwoo

  • Loading branch information...
LarsMichelsen committed Apr 24, 2018
1 parent 5fc3f1f commit 01b32451f82b5175a6f098304f89e26a29805f05
@@ -1193,7 +1193,7 @@ public function readVarInto($varstr, $data, $safeRead = false)
}
unset($varstr);
while (list($k, $sep) = each($m[1])) {
foreach ($m[1] as $k => $sep) {
if ($sep === '.' || $sep === '[' || $sep === '') {
if ((is_array($data) || $data instanceof ArrayAccess) && ($safeRead === false || isset($data[$m[2][$k]]))) {
$data = $data[$m[2][$k]];
@@ -1365,7 +1365,7 @@ public function readVar($varstr)
$cur = $this->scope;
}
while (list($k, $sep) = each($m[1])) {
foreach ($m[1] as $k => $sep) {
if ($sep === '.' || $sep === '[' || $sep === '') {
if ((is_array($cur) || $cur instanceof ArrayAccess) && isset($cur[$m[2][$k]])) {
$cur = $cur[$m[2][$k]];
@@ -1410,7 +1410,7 @@ public function assignInScope($value, $scope)
$cur =& $this->scope;
$last = array(array_pop($m[1]), array_pop($m[2]));
while (list($k, $sep) = each($m[1])) {
foreach ($m[1] as $k => $sep) {
if ($sep === '.' || $sep === '[' || $sep === '') {
if (is_array($cur) === false) {
$cur = array();
@@ -37,8 +37,8 @@ public static function replaceKeywords(array $params, Dwoo_Compiler $compiler)
{
$p = array();
reset($params);
while (list($k,$v) = each($params)) {
reset($params);
foreach ($params as $k => $v) {
$v = (string) $v;
if(substr($v, 0, 1) === '"' || substr($v, 0, 1) === '\'') {
$vmod = strtolower(substr($v, 1, -1));
@@ -67,7 +67,7 @@ public function process()
// gets paragraphs
$pgs = explode("\n", str_replace(array("\r\n", "\r"), "\n", $this->buffer));
while (list($i,) = each($pgs)) {
foreach ($pgs as $i => $val) {
if (empty($pgs[$i])) {
continue;
}
@@ -24,8 +24,8 @@ function Dwoo_Plugin_capitalize(Dwoo $dwoo, $value, $numwords=false)
return mb_convert_case((string) $value,MB_CASE_TITLE, $dwoo->getCharset());
} else {
$bits = explode(' ', (string) $value);
$out = '';
while (list(,$v) = each($bits)) {
$out = '';
foreach ($bits as $v) {
if (preg_match('#^[^0-9]+$#', $v)) {
$out .= ' '.mb_convert_case($v, MB_CASE_TITLE, $dwoo->getCharset());
} else {

0 comments on commit 01b3245

Please sign in to comment.