Skip to content

Commit 4db3a4d

Browse files
committed
core: drop support for php5.4
1 parent 3874da0 commit 4db3a4d

File tree

3 files changed

+1
-64
lines changed

3 files changed

+1
-64
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
language: php
22

33
php:
4-
- 5.4
54
- 5.5
65
- 5.6
76
- 7.0

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
## Installation
1212

13-
Requires PHP5.4 or later.
13+
Requires PHP5.5 or later.
1414

1515
```bash
1616
composer require adhocore/underscore

src/Helper.php

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -35,66 +35,4 @@ public static function asArray($data)
3535

3636
return (array) $data;
3737
}
38-
39-
public static function arrayColumn($array, $columnKey, $indexKey = null)
40-
{
41-
$result = [];
42-
43-
if (!\is_array($array)) {
44-
\trigger_error('array_column() expects parameter 1 to be array', E_USER_WARNING);
45-
46-
return;
47-
}
48-
49-
if (null !== $columnKey) {
50-
if (\is_object($columnKey) && !\method_exists($columnKey, '__toString')) {
51-
\trigger_error('array_column() expects parameter 2 to be number/string/null', E_USER_WARNING);
52-
53-
return;
54-
}
55-
56-
$columnKey = \is_float($columnKey) ? (int) $columnKey : (string) $columnKey;
57-
}
58-
59-
if (null !== $indexKey) {
60-
if (\is_object($indexKey) && !\method_exists($indexKey, '__toString')) {
61-
\trigger_error('array_column() expects parameter 3 to be number/string/null', E_USER_WARNING);
62-
63-
return;
64-
}
65-
66-
$indexKey = \is_float($indexKey) ? (int) $indexKey : (string) $indexKey;
67-
}
68-
69-
foreach ($array as $value) {
70-
$objectVars = \is_object($value) ? \get_object_vars($value) : [];
71-
72-
$key = null;
73-
if (null !== $indexKey) {
74-
if (\is_array($value) && \array_key_exists($indexKey, $value)) {
75-
$key = $value[$indexKey];
76-
} elseif (\array_key_exists($indexKey, $objectVars) || isset($value->{$indexKey})) {
77-
$key = $value->{$indexKey};
78-
}
79-
}
80-
81-
if (null !== $columnKey) {
82-
if (\is_array($value) && \array_key_exists($columnKey, $value)) {
83-
$value = $value[$columnKey];
84-
} elseif (\array_key_exists($columnKey, $objectVars) || isset($value->{$columnKey})) {
85-
$value = $value->{$columnKey};
86-
} else {
87-
continue;
88-
}
89-
}
90-
91-
if (null === $key) {
92-
$result[] = $value;
93-
} else {
94-
$result[$key] = $value;
95-
}
96-
}
97-
98-
return $result;
99-
}
10038
}

0 commit comments

Comments
 (0)