Skip to content

Commit e291800

Browse files
committed
first commit
0 parents  commit e291800

File tree

12 files changed

+2141
-0
lines changed

12 files changed

+2141
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: PHP Linting (Pint)
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches-ignore:
6+
- "dependabot/npm_and_yarn/*"
7+
jobs:
8+
phplint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 2
15+
- name: "laravel-pint"
16+
uses: aglipanci/laravel-pint-action@0.1.0
17+
with:
18+
preset: laravel
19+
20+
- name: Commit changes
21+
uses: stefanzweifel/git-auto-commit-action@v4
22+
with:
23+
commit_message: PHP Linting (Pint)
24+
skip_fetch: true

.github/workflows/tests.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Tests
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches-ignore:
7+
- "dependabot/npm_and_yarn/*"
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
fail-fast: true
18+
matrix:
19+
php: [7.4, 8.0, 8.1, 8.2, 8.3]
20+
21+
name: PHP ${{ matrix.php }}
22+
23+
steps:
24+
- uses: actions/checkout@v2
25+
26+
- name: Validate composer.json and composer.lock
27+
run: composer validate
28+
29+
- name: Install dependencies
30+
run: composer install --prefer-dist --no-progress --no-suggest
31+
32+
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
33+
# Docs: https://getcomposer.org/doc/articles/scripts.md
34+
35+
- name: Run test suite
36+
run: composer test
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: update changelog
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
permissions: {}
8+
9+
jobs:
10+
update:
11+
permissions:
12+
contents: write
13+
uses: cable8mm/.github/.github/workflows/update-changelog.yml@main

.gitignore

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Created by https://www.toptal.com/developers/gitignore/api/composer,macos,windows,visualstudiocode
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=composer,macos,windows,visualstudiocode
3+
4+
### Composer ###
5+
composer.phar
6+
/vendor/
7+
8+
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
9+
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
10+
# composer.lock
11+
12+
### macOS ###
13+
# General
14+
.DS_Store
15+
.AppleDouble
16+
.LSOverride
17+
18+
# Icon must end with two \r
19+
Icon
20+
21+
22+
# Thumbnails
23+
._*
24+
25+
# Files that might appear in the root of a volume
26+
.DocumentRevisions-V100
27+
.fseventsd
28+
.Spotlight-V100
29+
.TemporaryItems
30+
.Trashes
31+
.VolumeIcon.icns
32+
.com.apple.timemachine.donotpresent
33+
34+
# Directories potentially created on remote AFP share
35+
.AppleDB
36+
.AppleDesktop
37+
Network Trash Folder
38+
Temporary Items
39+
.apdisk
40+
41+
### macOS Patch ###
42+
# iCloud generated files
43+
*.icloud
44+
45+
### VisualStudioCode ###
46+
.vscode/*
47+
!.vscode/settings.json
48+
!.vscode/tasks.json
49+
!.vscode/launch.json
50+
!.vscode/extensions.json
51+
!.vscode/*.code-snippets
52+
53+
# Local History for Visual Studio Code
54+
.history/
55+
56+
# Built Visual Studio Code Extensions
57+
*.vsix
58+
59+
### VisualStudioCode Patch ###
60+
# Ignore all local history of files
61+
.history
62+
.ionide
63+
64+
### Windows ###
65+
# Windows thumbnail cache files
66+
Thumbs.db
67+
Thumbs.db:encryptable
68+
ehthumbs.db
69+
ehthumbs_vista.db
70+
71+
# Dump file
72+
*.stackdump
73+
74+
# Folder config file
75+
[Dd]esktop.ini
76+
77+
# Recycle Bin used on file shares
78+
$RECYCLE.BIN/
79+
80+
# Windows Installer files
81+
*.cab
82+
*.msi
83+
*.msix
84+
*.msm
85+
*.msp
86+
87+
# Windows shortcuts
88+
*.lnk
89+
90+
# End of https://www.toptal.com/developers/gitignore/api/composer,macos,windows,visualstudiocode

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Release Notes

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Samgu Lee
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Array Flatten
2+
3+
[![Test](https://github.com/cable8mm/array-flatten/actions/workflows/tests.yml/badge.svg)](https://github.com/cable8mm/array-flatten/actions/workflows/tests.yml)
4+
[![PHP Linting (Pint)](https://github.com/cable8mm/array-flatten/actions/workflows/coding-style-php.yml/badge.svg)](https://github.com/cable8mm/array-flatten/actions/workflows/coding-style-php.yml)
5+
[![Latest Stable Version](http://poser.pugx.org/cable8mm/array-flatten/v)](https://packagist.org/packages/cable8mm/array-flatten)
6+
[![Total Downloads](http://poser.pugx.org/cable8mm/array-flatten/downloads)](https://packagist.org/packages/cable8mm/array-flatten)
7+
[![release date](https://img.shields.io/github/release-date/cable8mm/array-flatten)](https://github.com/cable8mm/array-flatten/releases)
8+
![GitHub License](https://img.shields.io/github/license/cable8mm/array-flatten)
9+
[![PHP Version Require](http://poser.pugx.org/cable8mm/array-flatten/require/php)](https://packagist.org/packages/cable8mm/array-flatten)
10+
11+
> Flatten nested arrays.
12+
13+
## Installation
14+
15+
```sh
16+
composer require cable8mm/array-flatten
17+
```
18+
19+
## Usage
20+
21+
```php
22+
use function Cable8mm\ArrayFlatten\array_flatten;
23+
24+
array_flatten([1, [2, [3, [4, [5], 6], 7], 8], 9]);
25+
//=> [1, 2, 3, 4, 5, 6, 7, 8, 9]
26+
```
27+
28+
## License
29+
30+
The QR Images is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

composer.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"name": "cable8mm/array-flatten",
3+
"description": "Flatten a multi-dimensional array in PHP.",
4+
"type": "library",
5+
"license": "MIT",
6+
"autoload": {
7+
"psr-4": {
8+
"Cable8mm\\ArrayFlattern\\": "src/"
9+
},
10+
"files": [
11+
"src/array_flatten.php"
12+
]
13+
},
14+
"autoload-dev": {
15+
"psr-4": {
16+
"Cable8mm\\ArrayFlattern\\Tests\\": "tests/"
17+
}
18+
},
19+
"authors": [
20+
{
21+
"name": "Sam Lee",
22+
"email": "cable8mm@gmail.com"
23+
}
24+
],
25+
"require": {
26+
"php": "^7.4|^8.0"
27+
},
28+
"require-dev": {
29+
"phpunit/phpunit": "^11.0",
30+
"laravel/pint": "^1.14"
31+
},
32+
"scripts": {
33+
"test": [
34+
"./vendor/bin/phpunit"
35+
],
36+
"lint": [
37+
"./vendor/bin/pint"
38+
]
39+
},
40+
"minimum-stability": "stable",
41+
"prefer-stable": true
42+
}

0 commit comments

Comments
 (0)