Skip to content

Commit 818423e

Browse files
committed
Fix CS
1 parent baa04c4 commit 818423e

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

.drone.jsonnet

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ local pipeline(name, phpversion, params) = {
6060
image: "joomlaprojects/docker-images:php7.4",
6161
depends: [ "composer" ],
6262
commands: [
63+
"vendor/bin/phpcs --config-set installed_paths vendor/joomla/coding-standards",
6364
"vendor/bin/phpcs --standard=ruleset.xml"
6465
]
6566
},

.drone.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
},
2121
{
2222
"commands": [
23+
"vendor/bin/phpcs --config-set installed_paths vendor/joomla/coding-standards",
2324
"vendor/bin/phpcs --standard=ruleset.xml"
2425
],
2526
"depends": [
@@ -341,6 +342,6 @@
341342
}
342343
---
343344
kind: signature
344-
hmac: a15eb57addbbc0ef1fa3ad14db89b66dfc19621a71177d3a4337d271824a256b
345+
hmac: d85d2b22c2b89e0b5c0f9d43c4d217971d539c006562972f32eccc33248c209f
345346

346347
...

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"joomla/string": "^2.0"
1515
},
1616
"require-dev": {
17-
"phpunit/phpunit": "^8.5|^9.0"
17+
"phpunit/phpunit": "^8.5|^9.0",
18+
"joomla/coding-standards": "^3.0@dev"
1819
},
1920
"autoload": {
2021
"psr-4": {

src/ArrayHelper.php

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -307,22 +307,29 @@ public static function getColumn(array $array, $valueCol, $keyCol = null)
307307
{
308308
return \array_reduce(
309309
$array,
310-
function($result, $item) use ($keyCol, $valueCol) {
310+
function ($result, $item) use ($keyCol, $valueCol) {
311311
$array = \is_object($item) ? get_object_vars($item) : $item;
312312

313-
if ($valueCol === null) {
313+
if ($valueCol === null)
314+
{
314315
$value = $item;
315-
} else {
316-
if (!array_key_exists($valueCol, $array)) {
316+
}
317+
else
318+
{
319+
if (!array_key_exists($valueCol, $array))
320+
{
317321
return $result;
318322
}
319323

320324
$value = $array[$valueCol];
321325
}
322326

323-
if ($keyCol !== null && \array_key_exists($keyCol, $array) && \is_scalar($array[$keyCol])) {
327+
if ($keyCol !== null && \array_key_exists($keyCol, $array) && \is_scalar($array[$keyCol]))
328+
{
324329
$result[$array[$keyCol]] = $value;
325-
} else {
330+
}
331+
else
332+
{
326333
$result[] = $value;
327334
}
328335

0 commit comments

Comments
 (0)