Skip to content

Commit 9ba8ac4

Browse files
author
nix
committed
better package description; added codecov badge; updated README
1 parent 76d9de8 commit 9ba8ac4

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

README.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ A PHP library with utility functions, mostly useful when coding in functional st
33

44
![GitHub License](https://img.shields.io/github/license/nixn/php-util)
55
[![Quality Assurance](https://github.com/nixn/php-util/actions/workflows/quality-assurance.yml/badge.svg)](https://github.com/nixn/php-util/actions/workflows/quality-assurance.yml)
6+
[![codecov](https://codecov.io/github/nixn/php-util/graph/badge.svg?token=ID9IL3S3HP)](https://codecov.io/github/nixn/php-util)
67
[![Packagist Version](https://img.shields.io/packagist/v/nixn/php-util)][packagist]
78
[![Packagist Downloads](https://img.shields.io/packagist/dt/nixn/php-util?color=blue)][packagist]
89
![Packagist Dependency Version](https://img.shields.io/packagist/dependency-v/nixn/php-util/php)
9-
[![API docs](https://img.shields.io/badge/API-docs-blue)](https://nixn.github.io/php-util/namespaces/nixn-php.html)
10+
[![API docs](https://img.shields.io/badge/API-docs-blue)][api-docs]
1011

1112
[packagist]: https://packagist.org/packages/nixn/php-util
1213

@@ -16,12 +17,20 @@ Via composer:
1617
composer require nixn/php-util
1718
```
1819

19-
## Components
20+
## Documentation
21+
22+
See the [API docs][api-docs].
23+
24+
The (only) namespace is `nixn\php`. All functions (except in the wrappers [`Pipe`][pipe] and [`With`][with]) are static, so they can be called easily
25+
(e.g. [`Arr::pick($array, 'a', 'b')`](https://nixn.github.io/php-util/classes/nixn-php-Arr.html#method_pick)).
2026

21-
Namespace: `nixn\php`. All functions (except in Pipe) are static, so they can be called easily
22-
(e.g. `Arr::pick($array, 'a', 'b'))`).
27+
[api-docs]: https://nixn.github.io/php-util/namespaces/nixn-php.html
28+
[pipe]: https://nixn.github.io/php-util/classes/nixn-php-Pipe.html
29+
[with]: https://nixn.github.io/php-util/classes/nixn-php-With.html
30+
31+
## Components
2332

24-
### Arr (ay)
33+
### [Arr (ay)](https://nixn.github.io/php-util/classes/nixn-php-Arr.html)
2534

2635
* `pick(array $array, string|int ...$keys): array`<br>
2736
Returns a new array with only the key => value mappings left, whose keys are in $keys.
@@ -81,7 +90,7 @@ else
8190
// prints: Found value two with key 2
8291
```
8392

84-
### Partial
93+
### [Partial](https://nixn.github.io/php-util/classes/nixn-php-Partial.html)
8594

8695
* `partial(callable $callable, mixed ...$args): callable`<br>
8796
Returns a new function, which will call the callable with the provided args and can use placeholders for runtime args.
@@ -113,7 +122,7 @@ Str::trim_suffix($str, 'abc') // => "abcdef"
113122
Str::trim_suffix($str, 'def') // => "abc"
114123
```
115124

116-
### Util
125+
### [Util](https://nixn.github.io/php-util/classes/nixn-php-Util.html)
117126

118127
* `identity(mixed $v): mixed`<br>
119128
Just returns the input value. Useful in functional programming style.
@@ -175,7 +184,7 @@ $new_color = Util::new(Color::class);
175184
$color = $new_color(0, 127, 255); // $color instanceof Color
176185
```
177186

178-
### Pipe
187+
### [Pipe](https://nixn.github.io/php-util/classes/nixn-php-Pipe.html)
179188

180189
A `Pipe` object wraps an intial value and pipes it through any function which modifies it.
181190
The resulting value can be accessed at the end.
@@ -196,7 +205,7 @@ echo (new Pipe('NOW')) // wrap initial value
196205
// prints: 2026
197206
```
198207

199-
### With
208+
### [With](https://nixn.github.io/php-util/classes/nixn-php-With.html)
200209

201210
A `With` object wraps an object and can be used to call any method on it with chaining support (handled by the wrapper).
202211
Note that any value returned by the method calls is discarded!

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "nixn/php-util",
33
"type": "library",
4-
"description": "PHP language utilities, mostly to code more in functional style.",
4+
"description": "PHP language utilities, mostly to code more in functional style, but also other stuff.",
55
"keywords": ["functional", "language", "utilities", "array", "string", "pipe", "with", "partial"],
66
"license": "MIT",
77
"authors": [

0 commit comments

Comments
 (0)