Skip to content

Commit 3b98585

Browse files
committed
refactor: pr comments
1 parent 17a00a1 commit 3b98585

2 files changed

Lines changed: 46 additions & 36 deletions

File tree

.php-cs-fixer.php

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,40 @@
33
declare(strict_types=1);
44

55
$finder = PhpCsFixer\Finder::create()
6-
->notPath('vendor')
7-
->notPath('node_modules')
8-
->in(__DIR__)
9-
->in('./resources/views')
10-
->in('./config')
11-
->name('*.php')
12-
->notName('*.blade.php')
13-
->ignoreDotFiles(true)
14-
->ignoreVCS(true);
6+
->notPath('vendor')
7+
->notPath('node_modules')
8+
->in(__DIR__)
9+
->in('./resources/views')
10+
->in('./config')
11+
->name('*.php')
12+
->notName('*.blade.php')
13+
->ignoreDotFiles(true)
14+
->ignoreVCS(true);
1515

1616
return (new PhpCsFixer\Config)
17-
->setRules([
18-
'@PSR2' => true,
19-
'array_syntax' => [
20-
'syntax' => 'short',
21-
],
22-
'ordered_imports' => [
23-
'sort_algorithm' => 'alpha',
24-
],
25-
'no_unused_imports' => true,
26-
'binary_operator_spaces' => [
27-
'default' => 'single_space',
28-
'operators' => [
29-
'=>' => 'single_space',
30-
'|' => 'no_space',
31-
],
32-
],
33-
'full_opening_tag' => true,
34-
'yoda_style' => [
35-
'always_move_variable' => true,
36-
'equal' => true,
37-
'identical' => true,
38-
'less_and_greater' => true,
39-
],
40-
])
41-
->setFinder($finder);
17+
->setRules([
18+
'@PSR2' => true,
19+
'array_syntax' => [
20+
'syntax' => 'short',
21+
],
22+
'ordered_imports' => [
23+
'sort_algorithm' => 'alpha',
24+
],
25+
'no_unused_imports' => true,
26+
'array_indentation' => true,
27+
'binary_operator_spaces' => [
28+
'default' => 'single_space',
29+
'operators' => [
30+
'=>' => 'single_space',
31+
'|' => 'no_space',
32+
],
33+
],
34+
'full_opening_tag' => true,
35+
'yoda_style' => [
36+
'always_move_variable' => true,
37+
'equal' => true,
38+
'identical' => true,
39+
'less_and_greater' => true,
40+
],
41+
])
42+
->setFinder($finder);

src/PrefillGravityForms/Services/PersonalDataService.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,20 @@ private function key(string $key): string
5252
return 'naam.voornamen';
5353
}
5454

55-
if ('enableu' === strtolower($this->supplier) && 'verblijfplaats.woonplaats' === $key || 'vrijbrp' == strtolower($this->supplier) && 'verblijfplaats.woonplaats' === $key) {
55+
$prefillSuppliersWithKeyExceptions = [
56+
'enableu',
57+
'vrijbrp'
58+
];
59+
60+
if (! in_array(strtolower($this->supplier), $prefillSuppliersWithKeyExceptions)) {
61+
return $key;
62+
}
63+
64+
if ('verblijfplaats.woonplaats' === $key) {
5665
return 'verblijfplaats.woonplaatsnaam';
5766
}
5867

59-
if ('enableu' === strtolower($this->supplier) && 'verblijfplaats.straat' === $key || 'vrijbrp' == strtolower($this->supplier) && 'verblijfplaats.straat' === $key) {
68+
if ('verblijfplaats.straat' === $key) {
6069
return 'verblijfplaats.straatnaam';
6170
}
6271

0 commit comments

Comments
 (0)