Skip to content

Commit bf49d31

Browse files
committed
MINORFIX: conflicts
1 parent 6521f1f commit bf49d31

14 files changed

+49
-60
lines changed

CONTRIBUTING.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,11 @@ If you want to fix the issues automatically, you can run the following command:
6464
```bash
6565
composer cs-fix
6666
```
67+
68+
### PHPStan for PHP
69+
70+
If you want to see all your issues on the PHP code through PHPStan, you can run the following command:
71+
72+
```bash
73+
composer phpstan
74+
```

LINTERS.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

mapBuilder/classes/listBaseLayer.class.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ class listBaseLayer implements jIFormsDatasource
44
{
55
protected $formId = 0;
66

7-
protected $data = [];
7+
protected $data = array();
88

99
public function __construct($id)
1010
{
1111
$this->formId = $id;
1212

13-
$this->data = [
13+
$this->data = array(
1414
'osmMapnik' => 'OSM Mapnik',
1515
'osmStadiaMapsToner' => 'OSM StadiaMaps Toner',
1616
'bingStreets' => 'Bing Streets',
@@ -20,7 +20,7 @@ public function __construct($id)
2020
'ignSatellite' => 'IGN Satellite',
2121
'ignCadastral' => 'IGN Cadastral',
2222
'emptyBaselayer' => jLocale::get('view~dictionnary.baselayer.empty.title'),
23-
];
23+
);
2424
}
2525

2626
public function getData($form)

mapBuilder/classes/listRepositories.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ class listRepositories implements jIFormsDatasource
44
{
55
protected $formId = 0;
66

7-
protected $data = [];
7+
protected $data = array();
88

99
public function __construct($id)
1010
{
1111
$this->formId = $id;
1212

13-
$repositories = [];
13+
$repositories = array();
1414

1515
foreach (lizmap::getRepositoryList() as $repositoryName) {
1616
$repository = lizmap::getRepository($repositoryName);

mapBuilder/classes/mapBuilderView.listener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function onmainviewGetMaps($event)
3939
$extentArraySource = explode(',', $readConfigPath['extent']);
4040

4141
// Is extent valid ?
42-
if (4 == count($extentArraySource) && $extentArraySource === array_filter($extentArraySource, 'is_numeric')) {
42+
if (count($extentArraySource) == 4 && $extentArraySource === array_filter($extentArraySource, 'is_numeric')) {
4343
// Cast as float
4444
$extentArraySource = array_map('floatval', $extentArraySource);
4545

@@ -57,7 +57,7 @@ public function onmainviewGetMaps($event)
5757
$destMinPt = $proj4->transform($sourceProj, $destProj, $sourceMinPt);
5858
$destMaxPt = $proj4->transform($sourceProj, $destProj, $sourceMaxPt);
5959

60-
$extent = implode(', ', [$destMinPt->x, $destMinPt->y, $destMaxPt->x, $destMaxPt->y]);
60+
$extent = implode(', ', array($destMinPt->x, $destMinPt->y, $destMaxPt->x, $destMaxPt->y));
6161
} catch (Exception $e) {
6262
// Max extent in EPSG:3857
6363
$extent = '-20026376.39,-20048966.10,20026376.39,20048966.10';

mapBuilder/controllers/default.classic.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ public function index()
5555
$rep->addJSLink(jApp::urlBasePath().'mapBuilder/js/bootstrap.min.js');
5656

5757
// Pass some configuration options to the web page through javascript var
58-
$lizUrls = [
58+
$lizUrls = array(
5959
'basepath' => jApp::urlBasePath(),
6060
'config' => jUrl::get('lizmap~service:getProjectConfig'),
6161
'wms' => jUrl::get('lizmap~service:index'),
6262
'media' => jUrl::get('view~media:getMedia'),
6363
'mapcontext_add' => jUrl::get('mapBuilder~mapcontext:add'),
6464
'mapcontext_delete' => jUrl::get('mapBuilder~mapcontext:delete'),
6565
'mapcontext_get' => jUrl::get('mapBuilder~mapcontext:get'),
66-
];
66+
);
6767

6868
// Load lizUrls before mapbuilder. Webpack public path needs it
6969
$rep->addJSCode('var lizUrls = '.json_encode($lizUrls).';', true);
@@ -74,9 +74,9 @@ public function index()
7474
$readConfigPath = parse_ini_file($configFile, true);
7575

7676
// Build repository + project tree for FancyTree
77-
$nestedTree = [];
77+
$nestedTree = array();
7878

79-
$repositoryList = [];
79+
$repositoryList = array();
8080

8181
// Get selected repository from ini file if set
8282
if (array_key_exists('repository', $readConfigPath) && !is_null(lizmap::getRepository($readConfigPath['repository']))) {
@@ -90,7 +90,7 @@ public function index()
9090
if (jAcl2::check('lizmap.repositories.view', $repository->getKey())) {
9191
$projects = $repository->getProjects();
9292

93-
$projectArray = [];
93+
$projectArray = array();
9494
foreach ($projects as $project) {
9595
$projectArray[] = array(
9696
'title' => $project->getData('title'), // deprecated, use getTitle() for lizmap >=3.5
@@ -161,12 +161,12 @@ public function index()
161161
$lang = jLocale::getCurrentLang().'_'.jLocale::getCurrentCountry();
162162
}
163163

164-
$data = [];
164+
$data = array();
165165
$path = jApp::getModulePath('mapBuilder').'locales/en_US/dictionary.UTF-8.properties';
166166
if (file_exists($path)) {
167167
$lines = file($path);
168168
foreach ($lines as $lineNumber => $lineContent) {
169-
if (!empty($lineContent) and '\n' != $lineContent) {
169+
if (!empty($lineContent) and $lineContent != '\n') {
170170
$exp = explode('=', trim($lineContent));
171171
if (!empty($exp[0])) {
172172
$data[$exp[0]] = jLocale::get('mapBuilder~dictionary.'.$exp[0], null, $lang);
@@ -182,7 +182,7 @@ public function index()
182182
$rep->body->assign('allowUserAccountRequests', $services->allowUserAccountRequests);
183183

184184
// Add Google Analytics ID
185-
if ('' != $services->googleAnalyticsID && 1 == preg_match('/^UA-\\d+-\\d+$/', $services->googleAnalyticsID)) {
185+
if ($services->googleAnalyticsID != '' && preg_match('/^UA-\d+-\d+$/', $services->googleAnalyticsID) == 1) {
186186
$rep->body->assign('googleAnalyticsID', $services->googleAnalyticsID);
187187
}
188188

mapBuilder/controllers/mapcontext.classic.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function add()
1919
$rep = $this->getResponse('htmlfragment');
2020

2121
// Make sure that it is a POST request.
22-
if (0 != strcasecmp($_SERVER['REQUEST_METHOD'], 'POST')) {
22+
if (strcasecmp($_SERVER['REQUEST_METHOD'], 'POST') != 0) {
2323
throw new Exception('Request method must be POST!');
2424
}
2525

@@ -68,7 +68,7 @@ public function delete()
6868
$rep = $this->getResponse('htmlfragment');
6969

7070
// Make sure that it is a POST request.
71-
if (0 != strcasecmp($_SERVER['REQUEST_METHOD'], 'POST')) {
71+
if (strcasecmp($_SERVER['REQUEST_METHOD'], 'POST') != 0) {
7272
throw new Exception('Request method must be POST!');
7373
}
7474

@@ -86,7 +86,7 @@ public function delete()
8686
$conditions->addCondition('id', '=', $id);
8787
$mcCount = $daomc->countBy($conditions);
8888

89-
if (1 != $mcCount) {
89+
if ($mcCount != 1) {
9090
jMessage::add('You can\'t delete this map context or it doesn\'t exist', 'error');
9191
} else {
9292
try {
@@ -124,12 +124,13 @@ public function get()
124124
$conditions->endGroup();
125125
$mcCount = $daomc->countBy($conditions);
126126

127-
if (1 != $mcCount) {
127+
if ($mcCount != 1) {
128128
jMessage::add('You don\'t have access to this map context or it doesn\'t exist', 'error');
129+
129130
return '';
130131
}
131132
$mcList = $daomc->findBy($conditions);
132-
$mcParams = [];
133+
$mcParams = array();
133134
foreach ($mcList as $mc) {
134135
$mcParams = json_decode(htmlspecialchars_decode($mc->mapcontext, ENT_QUOTES));
135136
}
@@ -138,4 +139,5 @@ public function get()
138139

139140
return $rep;
140141

142+
}
141143
}

mapBuilder/install/configure.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class mapBuilderModuleConfigurator extends Configurator
1818
{
1919
public function getDefaultParameters()
2020
{
21-
return [];
21+
return array();
2222
}
2323

2424
public function configure(ConfigurationHelpers $helpers)

mapBuilder/install/upgrade_acl.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77
* @see http://3liz.com
88
*
99
* @license Mozilla Public License : http://www.mozilla.org/MPL/
10-
11-
*/class mapBuilderModuleUpgrader_acl extends jInstallerModule
10+
*/ class mapBuilderModuleUpgrader_acl extends jInstallerModule
1211
{
13-
public $targetVersions = [
12+
public $targetVersions = array(
1413
'1.0.0-rc.13',
15-
];
14+
);
1615
public $date = '2019-02-28';
1716

1817
public function install()

mapBuilder/install/upgrade_createtable.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77
* @see http://3liz.com
88
*
99
* @license Mozilla Public License : http://www.mozilla.org/MPL/
10-
11-
*/class mapBuilderModuleUpgrader_createtable extends jInstallerModule
10+
*/ class mapBuilderModuleUpgrader_createtable extends jInstallerModule
1211
{
13-
public $targetVersions = [
12+
public $targetVersions = array(
1413
'1.0.0-rc.10',
15-
];
14+
);
1615
public $date = '2019-01-25';
1716

1817
public function install()

mapBuilder/install/upgrade_toggleattributetable.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77
* @see http://3liz.com
88
*
99
* @license Mozilla Public License : http://www.mozilla.org/MPL/
10-
11-
*/class mapBuilderModuleUpgrader_toggleattributetable extends jInstallerModule
10+
*/ class mapBuilderModuleUpgrader_toggleattributetable extends jInstallerModule
1211
{
13-
public $targetVersions = [
12+
public $targetVersions = array(
1413
'1.0.0-rc.13',
15-
];
14+
);
1615
public $date = '2019-02-28';
1716

1817
public function install()

mapBuilderAdmin/controllers/config.classic.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ public function index()
4444

4545
// Set form data values
4646
foreach ($form->getControls() as $ctrl) {
47-
if ('submit' != $ctrl->type) {
47+
if ($ctrl->type != 'submit') {
4848
$val = $this->ini->getValue($ctrl->ref);
49-
if ('baseLayer' == $ctrl->ref) {
49+
if ($ctrl->ref == 'baseLayer') {
5050
$val = explode(',', $val);
5151
}
5252
$form->setData($ctrl->ref, $val);
@@ -72,9 +72,9 @@ public function modify()
7272

7373
// Set form data values
7474
foreach ($form->getControls() as $ctrl) {
75-
if ('submit' != $ctrl->type) {
75+
if ($ctrl->type != 'submit') {
7676
$val = $this->ini->getValue($ctrl->ref);
77-
if ('baseLayer' == $ctrl->ref) {
77+
if ($ctrl->ref == 'baseLayer') {
7878
$val = explode(',', $val);
7979
}
8080
$form->setData($ctrl->ref, $val);
@@ -158,9 +158,9 @@ public function save()
158158

159159
// Save the data
160160
foreach ($form->getControls() as $ctrl) {
161-
if ('submit' != $ctrl->type) {
161+
if ($ctrl->type != 'submit') {
162162
$val = $form->getData($ctrl->ref);
163-
if ('baseLayer' == $ctrl->ref) {
163+
if ($ctrl->ref == 'baseLayer') {
164164
$val = implode(',', $val);
165165
}
166166
$this->ini->setValue($ctrl->ref, $val);

mapBuilderAdmin/install/configure.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class mapBuilderAdminModuleConfigurator extends Configurator
2020
{
2121
public function getDefaultParameters()
2222
{
23-
return [];
23+
return array();
2424
}
2525

2626
public function declareUrls(EntryPointUrlModifier $registerOnEntryPoint)

mapBuilderAdmin/install/install_1_6.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ class mapBuilderAdminModuleInstaller extends jInstallerModule
1616
{
1717
public function install()
1818
{
19-
if ('admin' == $this->entryPoint->getEpId()) {
19+
if ($this->entryPoint->getEpId() == 'admin') {
2020
$localConfigIni = $this->entryPoint->localConfigIni->getMaster();
2121

2222
$adminControllers = $localConfigIni->getValue('admin', 'simple_urlengine_entrypoints');
2323
$mbCtrl = 'mapBuilderAdmin~*@classic';
24-
if (false === strpos($adminControllers, $mbCtrl)) {
24+
if (strpos($adminControllers, $mbCtrl) === false) {
2525
// let's register mapBuilderAdmin controllers
2626
$adminControllers .= ', '.$mbCtrl;
2727
$localConfigIni->setValue('admin', $adminControllers, 'simple_urlengine_entrypoints');

0 commit comments

Comments
 (0)