Skip to content

Commit

Permalink
[TASK] Apply Rector rule set SetList::EARLY_RETURN
Browse files Browse the repository at this point in the history
  • Loading branch information
simonschaufi authored and albig committed Apr 17, 2024
1 parent 930e2a2 commit 459146f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 19 deletions.
3 changes: 1 addition & 2 deletions Classes/Provider/BaseProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,8 @@ protected function getTileUrl($layer)
// if protocoll is missing, we add http:// or https://
if ($layer['tile_https'] == 1) {
return 'https://' . $layer['tile_url'];
} else {
return 'http://' . $layer['tile_url'];
}
return 'http://' . $layer['tile_url'];
}

public function setContentObjectRenderer(ContentObjectRenderer $cObj): void
Expand Down
8 changes: 3 additions & 5 deletions Classes/Provider/Leaflet.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,10 @@ protected function getLayerSwitcher()
}

if (empty($base) && empty($overlay)) {
$layerString = '';
} else {
$layerString = 'var layersControl=new L.Control.Layers({' . implode(',', $base) . '},{' . implode(',', $overlay) . '}' . ($this->config['show_layerswitcher'] == 2 ? ',{collapsed:false}' : '') . ');
' . $this->config['id'] . '.addControl(layersControl);';
return '';
}
return $layerString;
return 'var layersControl=new L.Control.Layers({' . implode(',', $base) . '},{' . implode(',', $overlay) . '}' . ($this->config['show_layerswitcher'] == 2 ? ',{collapsed:false}' : '') . ');
' . $this->config['id'] . '.addControl(layersControl);';
}

/**
Expand Down
10 changes: 4 additions & 6 deletions Classes/Provider/Openlayers.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ protected function getLayer($layer, $i, $backpath = '')
$layer['tile_url'] = strtr($this->getTileUrl($layer), ['{s}' => '{' . $layer['subdomains'] . '}']);

if ($layer['overlay'] == 1) {
$jsLayer = $this->config['id'] . "_" . $i . "_overlayLayer =
return $this->config['id'] . "_" . $i . "_overlayLayer =
new ol.layer.Tile({
visible: " . ($layer['visible'] == true ? 'true' : 'false') . ",
opacity: 0.99,
Expand All @@ -223,8 +223,9 @@ protected function getLayer($layer, $i, $backpath = '')
});
overlaygroup.getLayers().push(" . $this->config['id'] . "_" . $i . "_overlayLayer);
";
} else {
$jsLayer = $this->config['id'] . "_" . $i . "_baselayergroup =
}

return $this->config['id'] . "_" . $i . "_baselayergroup =
new ol.layer.Tile({
type: 'base',
combine: 'true',
Expand All @@ -239,9 +240,6 @@ protected function getLayer($layer, $i, $backpath = '')
});
baselayergroup.getLayers().push(" . $this->config['id'] . "_" . $i . "_baselayergroup);
";
}

return $jsLayer;
}

/**
Expand Down
10 changes: 6 additions & 4 deletions Classes/TceMain.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,13 @@ public function processDatamap_postProcessFieldArray($status, $table, $id, &$fie

// Update fieldArray if address is set
foreach ($tc as $def => $field) {
if ($def == strtolower($def)) {
if ($address[$def]) {
$fieldArray[$field] = $address[$def];
}
if ($def != strtolower($def)) {
continue;
}
if (!$address[$def]) {
continue;
}
$fieldArray[$field] = $address[$def];
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions Classes/Updates/FileLocationUpdater.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,8 @@ protected function falGetRecordsFromTable($countOnly = false)

if ($countOnly === true) {
return $numResults;
} else {
return $allResults;
}
return $allResults;
}


Expand Down

0 comments on commit 459146f

Please sign in to comment.