Skip to content

Commit

Permalink
Tests - Upgrade php-cs-fixer (use latest) & fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mdouchin committed Dec 18, 2023
1 parent d2afd8d commit cb69116
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 37 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ php-cs-fixer-apply:
php-cs-fixer fix --config=.php-cs-fixer.dist.php

php-cs-fixer-apply-docker:
docker run --rm -it -w=/app -v ${PWD}:/app oskarstark/php-cs-fixer-ga:3.12.0 --allow-risky=yes --config=.php-cs-fixer.dist.php
docker run --rm -it -w=/app -v ${PWD}:/app oskarstark/php-cs-fixer-ga:latest --allow-risky=yes --config=.php-cs-fixer.dist.php
4 changes: 2 additions & 2 deletions cadastre/classes/cadastre.listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ public function ongetMapAdditions($event)
$css = array();

// Add the cadastre config only if at least one right is granted
$hasEnougRights = (
$hasEnoughRights = (
jAcl2::check('cadastre.use.search.tool')
|| jAcl2::check('cadastre.acces.donnees.proprio')
|| jAcl2::check('cadastre.acces.donnees.proprio.simple')
);

if ($hasCadastreConfig && $hasEnougRights) {
if ($hasCadastreConfig && $hasEnoughRights) {
$js = array(
jUrl::get('jelix~www:getfile', array('targetmodule' => 'cadastre', 'file' => 'cadastre.js')),
);
Expand Down
13 changes: 4 additions & 9 deletions cadastre/classes/cadastreDockable.listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public function onmapDockable($event)
if ($p === null) {
throw new Exception("Spatial search: Unknown repository/project {$event->repository}.'~'.{$event->project}");
}

// Get the PostgreSQL database info of the Parcelle layer
/** @var \qgisVectorLayer $parcelleLayer The QGIS vector layer instance */
$parcelleLayer = $p->getLayer($parcelleId);
Expand Down Expand Up @@ -119,15 +120,9 @@ public function onmapDockable($event)
}
}

public function onmapMiniDockable($event)
{
}
public function onmapMiniDockable($event) {}

public function onmapRightDockable($event)
{
}
public function onmapRightDockable($event) {}

public function onmapBottomDockable($event)
{
}
public function onmapBottomDockable($event) {}
}
4 changes: 1 addition & 3 deletions cadastre/classes/listGeoCommuneDatasource.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ class listGeoCommuneDatasource extends jFormsDynamicDatasource
protected $profile;
protected $dao;

public function __construct($formid)
{
}
public function __construct($formid) {}

public function getData($form)
{
Expand Down
4 changes: 1 addition & 3 deletions cadastre/classes/listGeoSectionDatasource.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ class listGeoSectionDatasource extends jFormsDynamicDatasource

protected $dao;

public function __construct($formid)
{
}
public function __construct($formid) {}

public function getData($form)
{
Expand Down
4 changes: 1 addition & 3 deletions cadastre/classes/listParcelleLieuDatasource.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ class listParcelleLieuDatasource extends jFormsDynamicDatasource
protected $profile;
protected $dao;

public function __construct($formid)
{
}
public function __construct($formid) {}

public function getData($form)
{
Expand Down
4 changes: 1 addition & 3 deletions cadastre/classes/listParcelleLieuNoMajicDatasource.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ class listParcelleLieuNoMajicDatasource extends jFormsDynamicDatasource
protected $profile;
protected $dao;

public function __construct($formid)
{
}
public function __construct($formid) {}

public function getData($form)
{
Expand Down
4 changes: 1 addition & 3 deletions cadastre/classes/listParcellePropDatasource.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ class listParcellePropDatasource extends jFormsDynamicDatasource
protected $profile;
protected $dao;

public function __construct($formid)
{
}
public function __construct($formid) {}

public function getData($form)
{
Expand Down
4 changes: 1 addition & 3 deletions cadastre/classes/listParcelleSpatialDatasource.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ class listParcelleSpatialDatasource extends jFormsDynamicDatasource
protected $profile;
protected $dao;

public function __construct($formid)
{
}
public function __construct($formid) {}

public function getData($form)
{
Expand Down
4 changes: 1 addition & 3 deletions cadastre/classes/listSpatialLayerFieldDatasource.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ class listSpatialLayerFieldDatasource extends jFormsDynamicDatasource
protected $fields;
protected $aliases;

public function __construct($formid)
{
}
public function __construct($formid) {}

public function getData($form)
{
Expand Down
7 changes: 3 additions & 4 deletions cadastre/www/cadastre.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,9 @@ lizMap.events.on({
let selectedIds = '-9999999';
if (layerId) {
const getLayerConfig = lizMap.getLayerConfigById(layerId);
const layerName = getLayerConfig[0];
const selectedFeatureIds = lizMap.config.layers[layerName]?.selectedFeatures;
if (selectedFeatureIds && selectedFeatureIds.length) {
selectedIds = selectedFeatureIds.join();
const layerConfig = getLayerConfig[1];
if ('selectedFeatures' in layerConfig && layerConfig.selectedFeatures && layerConfig.selectedFeatures.length) {
selectedIds = layerConfig.selectedFeatures.join();
}
}
$('#' + formId + '_' + 'spatial_layer_selected_ids').val(selectedIds).change();
Expand Down

0 comments on commit cb69116

Please sign in to comment.