Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5', '8.6']
php-versions: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5', '8.6']

runs-on: ${{ matrix.operating-system }}

Expand All @@ -29,3 +29,6 @@ jobs:

- name: Run tests
run: ./vendor/bin/phpunit

- name: Verify documentation
run: ./vendor/bin/mddoc --dry-run
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A collection of global `array_*` functions appending to the native PHP set.

## Requirements

- **php**: >=7.2.0
- **php**: >=7.4.0

## Installing

Expand All @@ -24,15 +24,15 @@ composer require 'quorum/array-functions'
### Function: \array_flatten

```php
function array_flatten(array $array [, $allow_duplicates = false])
function array_flatten(array $array, $allow_duplicates = false)
```

##### Parameters:
##### Parameters

- ***array*** `$array` - The Array to be Flattened
- ***bool*** `$allow_duplicates` - Should the array allow duplicates

##### Returns:
##### Return Value

- ***array*** - The resulting array or NULL on failure

Expand All @@ -41,15 +41,15 @@ Given an array, find all the values recursively.
### Function: \array_blend

```php
function array_blend(array $arrays [, array $keys = null])
function array_blend(array $arrays, array $keys = null)
```

##### Parameters:
##### Parameters

- ***array*** `$arrays` - An array of arrays.
- ***array*** | ***null*** `$keys` - The merged array.

##### Returns:
##### Return Value

- ***array*** - The resulting blended array

Expand All @@ -61,12 +61,12 @@ Given an array of arrays, merges the array's children together.
function array_key_array(array $arrays, $key)
```

##### Parameters:
##### Parameters

- ***array*** `$arrays` - An array of similarly keyed arrays
- ***int*** | ***string*** `$key` - The desired key

##### Returns:
##### Return Value

- ***array*** - The flattened array

Expand All @@ -78,12 +78,12 @@ Given an array of similarly keyed arrays, returns an array of only the values of
function array_keys_array(array $arrays, $keys)
```

##### Parameters:
##### Parameters

- ***array*** `$arrays` - An array of similarly keyed arrays
- ***array*** | ***int*** | ***string*** `$keys` - The key or array of keys to return

##### Returns:
##### Return Value

- ***array*** - The array of arrays with just the selected keys

Expand All @@ -92,17 +92,17 @@ Given an array of similarly keyed arrays, returns an array of only the selected
### Function: \array_key_refill

```php
function array_key_refill(array $array, array $keys [, $fill = array()])
function array_key_refill(array $array, array $keys, $fill = array())
```

##### Parameters:
##### Parameters

- ***array*** `$array` - A Keyed array
- ***array*** `$keys` - The keys that must exist
- ***mixed*** `$fill` - The desired value to fill with

##### Returns:
##### Return Value

- ***array***

Given a keyed array, fills any missing values.
Given a keyed array, fills any missing values.
20 changes: 15 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
{
"name" : "quorum/array-functions",
"description": "useful array functions",
"description": "Additional global PHP array functions for flattening, merging, selecting, and refilling arrays.",
"keywords" : [
"array",
"array functions",
"array utilities"
],
"license" : "MIT",
"authors" : [
{
"name" : "Jesse Donat",
"name" : "Jesse G. Donat",
"role" : "Developer",
"email" : "donatj@gmail.com",
"homepage": "https://donatstudios.com"
},
{
"name" : "Ray Minge",
"email" : "ray@rayminge.com",
"role" : "Developer",
"homepage": "http://oranj.io"
"homepage": "https://oranj.io"
},
{
"name" : "Jon Henderson",
Expand All @@ -21,12 +27,16 @@
}
],
"require": {
"php" : ">=7.2.0"
"php" : ">=7.4.0"
},
"require-dev": {
"phpunit/phpunit": "~8|~9|~11"
"donatj/mddoc": "^0.14.1",
"phpunit/phpunit": "~9|~11"
},
"autoload" : {
"files": ["src/array.php"]
},
"config" : {
"sort-packages": true
}
}
Loading