Skip to content

Commit

Permalink
Fix a PHP 8 warnings about usage of some curly braces syntaxes in str…
Browse files Browse the repository at this point in the history
…ings

Refs #3809
  • Loading branch information
laurentj committed Jul 30, 2023
1 parent b6d9a0b commit 2005e80
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions lizmap/modules/lizmap/classes/lizmapLog.listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ private function sendEmail($key, $data)
// Build subject and body
$subject = '['.$services->appName.'] '.jLocale::get('admin~admin.logs.email.subject');

$body = jLocale::get("admin~admin.logs.email.${key}.body");
$body = jLocale::get("admin~admin.logs.email.{$key}.body");

foreach ($data as $k => $v) {
if (empty($v)) {
Expand All @@ -138,7 +138,7 @@ private function sendEmail($key, $data)
}
}
} else {
$body .= "\r\n"." * ${k} = ${v}";
$body .= "\r\n"." * {$k} = {$v}";
}
}

Expand Down
8 changes: 4 additions & 4 deletions lizmap/modules/lizmap/classes/qgisProject.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,10 +377,10 @@ public function getXmlLayer($layerId)
if ($layer && array_key_exists('embedded', $layer) && $layer['embedded'] == 1) {
$qgsProj = new qgisProject(realpath(dirname($this->path).DIRECTORY_SEPARATOR.$layer['projectPath']));

return $qgsProj->getXml()->xpath("//maplayer[id='${layerId}']");
return $qgsProj->getXml()->xpath("//maplayer[id='{$layerId}']");
}

return $this->getXml()->xpath("//maplayer[id='${layerId}']");
return $this->getXml()->xpath("//maplayer[id='{$layerId}']");
}

/**
Expand All @@ -396,7 +396,7 @@ public function getXmlLayer($layerId)
*/
public function getXmlLayerByKeyword($key)
{
return $this->getXml()->xpath("//maplayer/keywordList[value='${key}']/parent::*");
return $this->getXml()->xpath("//maplayer/keywordList[value='{$key}']/parent::*");
}

/**
Expand All @@ -412,7 +412,7 @@ public function getXmlLayerByKeyword($key)
*/
public function getXmlRelation($relationId)
{
return $this->getXml()->xpath("//relation[@id='${relationId}']");
return $this->getXml()->xpath("//relation[@id='{$relationId}']");
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lizmap/modules/lizmap/lib/Request/WFSRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public function parameters()
// Update propertyname parameter
$propertyName = $this->param('propertyname', '');
if (!empty($propertyName)) {
$propertyName = trim($propertyName).",${attribute}";
$propertyName = trim($propertyName).",{$attribute}";
$params['propertyname'] = $propertyName;
}

Expand Down
4 changes: 2 additions & 2 deletions lizmap/modules/view/controllers/lizMap.classic.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ function f($x)
// Add CSS
$atlasWidth = $lproj->getOption('atlasMaxWidth');
$cssContent = '';
$cssContent .= "#content.atlas-visible:not(.mobile) #right-dock {width: ${atlasWidth}%; max-width: ${atlasWidth}%;}";
$cssContent .= "#content.atlas-visible:not(.mobile) #map-content {margin-right: ${atlasWidth}%;}";
$cssContent .= "#content.atlas-visible:not(.mobile) #right-dock {width: {$atlasWidth}%; max-width: {$atlasWidth}%;}";
$cssContent .= "#content.atlas-visible:not(.mobile) #map-content {margin-right: {$atlasWidth}%;}";
$css = '<style type="text/css">'.$cssContent.'</style>';
$rep->addHeadContent($css);
}
Expand Down
2 changes: 1 addition & 1 deletion lizmap/modules/view/controllers/media.classic.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ public function getCssFile()
);
$pattern = 'url\((.+)\)';
$replacement = 'url('.$baseUrl.'/\1)';
$content = preg_replace("#${pattern}#", $replacement, $content);
$content = preg_replace("#{$pattern}#", $replacement, $content);
$content = str_replace('"', '', $content);
$rep->content = $content;

Expand Down

0 comments on commit 2005e80

Please sign in to comment.