Skip to content

Commit 4674c57

Browse files
author
Alaa Sarhan
committed
port 4.0.1 to 3
1 parent 974bef4 commit 4674c57

File tree

4 files changed

+51
-1
lines changed

4 files changed

+51
-1
lines changed

.github/workflows/php.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: PHP Composer
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
tags: [ 'v*' ]
7+
pull_request:
8+
branches: [ "master" ]
9+
tags: [ 'v*' ]
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
build:
17+
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v3
22+
23+
- uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: 5.6
26+
27+
- name: Validate composer.json and composer.lock
28+
run: composer validate --strict
29+
30+
- name: Cache Composer packages
31+
id: composer-cache
32+
uses: actions/cache@v3
33+
with:
34+
path: vendor
35+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
36+
restore-keys: |
37+
${{ runner.os }}-php-
38+
39+
- name: Install dependencies
40+
run: composer install --prefer-dist --no-progress
41+
42+
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
43+
# Docs: https://getcomposer.org/doc/articles/scripts.md
44+
45+
- name: Run test suite
46+
run: composer run-script test
47+
- name: Run Code Sniffer
48+
run: composer run-script cs

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"type": "library",
55
"keywords": ["array", "flatten", "arrays"],
66
"homepage": "https://github.com/AlaaSarhan/php-flatten",
7-
"license": "LGPL-3.0",
7+
"license": "LGPL-3.0-or-later",
88
"authors": [
99
{
1010
"name": "Alaa Sarhan",

test/FlattenTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public function arraysProvider()
5858
{
5959
return [
6060
[ [ ], [ ] ],
61+
[ [ [ 'a' => 1 ], [ 'b' => 2] ], [ '0.a' => 1, '1.b' => 2 ] ],
6162
[ [ 0 ], [ '0' => 0 ] ],
6263
[ [ 1, 2 ], [ '0' => 1, '1' => 2 ] ],
6364
[

test/UnflattenTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public function arraysProvider()
5858
return [
5959
[ [ ], [ ] ],
6060
[ [ '0' => 0 ], [ 0 ] ],
61+
[ [ '0.a' => 1, '1.b' => 2 ], [ [ 'a' => 1 ], [ 'b' => 2] ] ],
6162
[ [ '0' => 1, '1' => 2 ], [ 1, 2 ] ],
6263
[
6364
[ '0' => 1, '1' => 2, '2.0' => 3, '2.1' => 4 ],

0 commit comments

Comments
 (0)