Skip to content

Commit 09a9b22

Browse files
committed
feat : use null coalescing operator to ensure type
1 parent 86bec30 commit 09a9b22

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lizmap/modules/lizmap/lib/Project/QgisProject.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,19 +1179,19 @@ protected function readXmlProject($qgs_path)
11791179

11801180
// get QGIS project version
11811181
$this->qgisProjectVersion = $this->convertQgisProjectVersion($project->version);
1182-
$this->qgisEditorVersion = $project->version;
1183-
$this->qgisProjectName = $project->projectname;
1184-
$this->lastSaveDateTime = $project->saveDateTime;
1185-
$this->lastSaveUser = $project->saveUser;
1186-
$this->lastSaveUserFull = $project->saveUserFull;
1182+
$this->qgisEditorVersion = $project->version ?? '';
1183+
$this->qgisProjectName = $project->projectname ?? '';
1184+
$this->lastSaveDateTime = $project->saveDateTime ?? '';
1185+
$this->lastSaveUser = $project->saveUser ?? '';
1186+
$this->lastSaveUserFull = $project->saveUserFull ?? '';
11871187

11881188
$this->WMSInformation = $project->getWmsInformationsAsKeyArray();
11891189
$this->canvasColor = $project->properties->Gui->getCanvasColor();
11901190
$this->allProj4 = $project->getProjAsKeyArray();
11911191
$this->themes = $project->getVisibilityPresetsAsKeyArray();
11921192
$this->customProjectVariables = $project->properties->Variables !== null ? $project->properties->Variables->getVariablesAsKeyArray() : array();
1193-
$this->useLayerIDs = $project->properties->WMSUseLayerIDs !== null ? $project->properties->WMSUseLayerIDs : false;
1194-
$this->wfsLayerIds = $project->properties->WFSLayers !== null ? $project->properties->WFSLayers : array();
1193+
$this->useLayerIDs = $project->properties->WMSUseLayerIDs ?? false;
1194+
$this->wfsLayerIds = $project->properties->WFSLayers ?? array();
11951195
$this->layers = $project->getLayersAsKeyArray();
11961196
$this->relations = $project->getRelationsAsKeyArray();
11971197
$this->relationsFields = $project->getRelationFieldsAsKeyArray();

0 commit comments

Comments
 (0)