Skip to content

Commit 402e1a0

Browse files
committed
Implement PSR-12 starndard
1 parent 2a19c2b commit 402e1a0

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

phpcs.xml.dist

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
<description>Dot coding standard</description>
44

55
<!-- Output -->
6-
<arg value="p" />
7-
<arg name="colors" />
6+
<arg value="p"/>
7+
<arg name="colors"/>
88

99
<!-- Rules -->
10-
<rule ref="PSR2" />
10+
<rule ref="PSR12"/>
11+
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
1112

1213
<!-- File extensions -->
13-
<arg name="extensions" value="php" />
14+
<arg name="extensions" value="php"/>
1415

1516
<!-- Include paths -->
1617
<file>src</file>

src/Dot.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<?php
2+
23
/**
34
* Dot - PHP dot notation access to arrays
45
*
56
* @author Riku Särkinen <[email protected]>
67
* @link https://github.com/adbario/php-dot-notation
78
* @license https://github.com/adbario/php-dot-notation/blob/2.x/LICENSE.md (MIT License)
89
*/
10+
911
namespace Adbar;
1012

1113
use Countable;
@@ -173,9 +175,9 @@ public function flatten($delimiter = '.', $items = null, $prepend = '')
173175

174176
foreach ($items as $key => $value) {
175177
if (is_array($value) && !empty($value)) {
176-
$flatten[] = $this->flatten($delimiter, $value, $prepend.$key.$delimiter);
178+
$flatten[] = $this->flatten($delimiter, $value, $prepend . $key . $delimiter);
177179
} else {
178-
$flatten[] = [$prepend.$key => $value];
180+
$flatten[] = [$prepend . $key => $value];
179181
}
180182
}
181183

src/helpers.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* Dot - PHP dot notation access to arrays
45
*

tests/DotTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<?php
2+
23
/**
34
* Dot - PHP dot notation access to arrays
45
*
56
* @author Riku Särkinen <[email protected]>
67
* @link https://github.com/adbario/php-dot-notation
78
* @license https://github.com/adbario/php-dot-notation/blob/2.x/LICENSE.md (MIT License)
89
*/
10+
911
namespace Adbar\Tests;
1012

1113
use Adbar\Dot;

0 commit comments

Comments
 (0)