Skip to content

Commit 01e72f2

Browse files
Daniel BerthereauDaniel Berthereau
authored andcommitted
Cleaned with php-cs for php 7.4.
1 parent 44434d8 commit 01e72f2

9 files changed

Lines changed: 24 additions & 27 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
.bundle
1111
.DS_Store
1212
.php_cs.cache
13+
.php-cs-fixer.cache
1314
composer.phar
1415
debug.log

Module.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function install(ServiceLocatorInterface $services): void
8383

8484
$filepath = $useMyIsam
8585
? $this->modulePath() . '/data/install/schema-myisam.sql'
86-
: $this->modulePath() . '/data/install/schema.sql';
86+
: $this->modulePath() . '/data/install/schema.sql';
8787
$this->execSqlFromFile($filepath);
8888
}
8989

@@ -831,7 +831,7 @@ public function saveGeometryData(Event $event): void
831831
/**
832832
* @todo Remove the fix of srid in geographic table after save (check dependency?).
833833
*/
834-
public function fixSridInDatabase(Event $event)
834+
public function fixSridInDatabase(Event $event): void
835835
{
836836
$services = $this->getServiceLocator();
837837
/** @var \Doctrine\DBAL\Connection $connection */

config/module.config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@
224224
'label' => 'Geography', // @translate
225225
'adapter' => 'literal',
226226
],
227-
'geography:coordinates' => [
227+
'geography:coordinates' => [
228228
'label' => 'Geographic coordinates', // @translate
229229
'adapter' => 'literal',
230230
],

src/DataType/AbstractDataType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function parseGeometry($value): ?array
112112
return $geometry;
113113
}
114114

115-
public function valueAnnotationPrepareForm(PhpRenderer $view)
115+
public function valueAnnotationPrepareForm(PhpRenderer $view): void
116116
{
117117
$this->prepareForm($view);
118118
}

src/DataType/GeographyCoordinates.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,19 @@ public function form(PhpRenderer $view)
5656
'max' => '180.0',
5757
]);
5858

59-
return '<div class="field-geometry">'
60-
. '<div class="error invalid-value" data-custom-validity="' . $escapeAttr($translate($validity)) . '"></div>'
61-
. $view->formHidden($hiddenValue)
62-
. '<div class="field-geometry-number">'
63-
. $view->formLabel($latitudeElement)
64-
. $view->formNumber($latitudeElement)
65-
. '</div>'
66-
. '<div class="field-geometry-number">'
67-
. $view->formLabel($longitudeElement)
68-
. $view->formNumber($longitudeElement)
69-
. '</div>'
70-
. '</div>'
71-
;
59+
return '<div class="field-geometry">'
60+
. '<div class="error invalid-value" data-custom-validity="' . $escapeAttr($translate($validity)) . '"></div>'
61+
. $view->formHidden($hiddenValue)
62+
. '<div class="field-geometry-number">'
63+
. $view->formLabel($latitudeElement)
64+
. $view->formNumber($latitudeElement)
65+
. '</div>'
66+
. '<div class="field-geometry-number">'
67+
. $view->formLabel($longitudeElement)
68+
. $view->formNumber($longitudeElement)
69+
. '</div>'
70+
. '</div>'
71+
;
7272
}
7373

7474
public function isValid(array $valueObject)

src/DataType/GeometryPosition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public function getGeometryFromValue($value): \CrEOF\Spatial\PHP\Types\Geometry\
146146
if (is_string($value)) {
147147
$matches = [];
148148
$value = preg_match($this->regexPosition, (string) $value, $matches)
149-
? 'POINT (' . $matches['x'] . ' ' . ($matches['y'] ? '-' : ''). $matches['y'] . ')'
149+
? 'POINT (' . $matches['x'] . ' ' . ($matches['y'] ? '-' : '') . $matches['y'] . ')'
150150
: strtoupper((string) $value);
151151
}
152152
try {

src/DataType/QueryGeometryTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ protected function getPropertyId(AbstractEntityAdapter $adapter, $property): int
318318
if (!preg_match('/^[a-z0-9-_]+:[a-z0-9-_]+$/i', $property)) {
319319
return 0;
320320
}
321-
list($prefix, $localName) = explode(':', $property);
321+
[$prefix, $localName] = explode(':', $property);
322322
$dql = <<<'DQL'
323323
SELECT p.id
324324
FROM Omeka\Entity\Property p

src/Generic/AbstractModule.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function getConfig()
5757
return include $this->modulePath() . '/config/module.config.php';
5858
}
5959

60-
public function onBootstrap(MvcEvent $event)
60+
public function onBootstrap(MvcEvent $event): void
6161
{
6262
parent::onBootstrap($event);
6363

@@ -674,9 +674,7 @@ protected function initDataToPopulate(SettingsInterface $settings, string $setti
674674
// setting currently. So fill them via upgrade in that case or fill the
675675
// values.
676676
// TODO Find a way to save empty multi-checkboxes and multi-selects (core fix).
677-
$defaultSettings = array_filter($defaultSettings, function ($v) {
678-
return !is_array($v);
679-
});
677+
$defaultSettings = array_filter($defaultSettings, fn ($v) => !is_array($v));
680678
$missingSettings = array_diff_key($defaultSettings, $currentSettings);
681679

682680
foreach ($missingSettings as $name => $value) {

src/View/Helper/NormalizeGeometryQuery.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,7 @@ public function __invoke($query)
106106
$result['property'] = $property;
107107
}
108108

109-
$geo['around'] = array_filter($geo['around'], function ($v) {
110-
return $v !== null && $v !== '';
111-
});
109+
$geo['around'] = array_filter($geo['around'], fn ($v) => $v !== null && $v !== '');
112110
if ($geo['around']) {
113111
$around = $this->normalizeAround($geo['around'] + $defaults['around']);
114112
if ($around) {
@@ -258,7 +256,7 @@ protected function normalizeBox($box)
258256
if (strpos($box, ' ') === false) {
259257
return;
260258
}
261-
list($left, $top, $right, $bottom) = explode(' ', $box, 4);
259+
[$left, $top, $right, $bottom] = explode(' ', $box, 4);
262260
}
263261
if (is_numeric($left)
264262
&& is_numeric($top)

0 commit comments

Comments
 (0)