Skip to content

Commit 121b901

Browse files
author
nix
committed
added phpdoc basic configuration
and added some class-level docs
1 parent d0d4cb0 commit 121b901

File tree

9 files changed

+305
-8
lines changed

9 files changed

+305
-8
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22
/tests-output/
33
/phpunit.xml
44
/phpstan.neon
5+
/phpdoc.xml
6+
/.phpdoc/
7+
/api-docs/

composer.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"php": ">=8.2"
1616
},
1717
"require-dev": {
18+
"phpdocumentor/shim": "^3.8",
1819
"phpstan/phpstan": "^2.1",
1920
"phpunit/phpunit": "~11.5"
2021
},
@@ -29,7 +30,10 @@
2930
}
3031
},
3132
"config": {
32-
"sort-packages": true
33+
"sort-packages": true,
34+
"allow-plugins": {
35+
"phpdocumentor/shim": true
36+
}
3337
},
3438
"extra": {
3539
"branch-alias": {
@@ -43,6 +47,7 @@
4347
"phpunit"
4448
],
4549
"stan": "phpstan",
46-
"stan-tests": "phpstan analyse -c phpstan-tests.neon"
50+
"stan-tests": "phpstan analyse -c phpstan-tests.neon",
51+
"api-docs": "phpdoc"
4752
}
4853
}

composer.lock

Lines changed: 251 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpdoc.dist.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<phpdocumentor
3+
configVersion="3"
4+
xmlns="https://www.phpdoc.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/phpDocumentor/phpDocumentor/master/data/xsd/phpdoc.xsd">
6+
<paths>
7+
<output>api-docs</output>
8+
</paths>
9+
<version number="latest">
10+
<api>
11+
<source dsn=".">
12+
<path>src</path>
13+
</source>
14+
<default-package-name>nixn\php</default-package-name>
15+
<visibility>public</visibility>
16+
<ignore-tags>
17+
<ignore-tag>phpstan-ignore</ignore-tag>
18+
</ignore-tags>
19+
</api>
20+
</version>
21+
</phpdocumentor>

src/Arr.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
<?php
22
namespace nixn\php;
33

4-
/** @since 1.0 */
4+
/**
5+
* Utilities for arrays or iterables.
6+
*
7+
* @since 1.0
8+
*/
59
final class Arr
610
{
711
/** @codeCoverageIgnore */

src/Partial.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
<?php
22
namespace nixn\php;
33

4-
/** @since 1.0 */
4+
/**
5+
* Partial functions.
6+
*
7+
* @since 1.0
8+
*/
59
enum Partial
610
{
711
case PLACEHOLDER;
@@ -22,7 +26,7 @@ enum Partial
2226
*/
2327
public static function partial(callable $callable, mixed ...$args): callable
2428
{
25-
return function(mixed ... $placeholder_args) use ($callable, $args): mixed {
29+
return static function(mixed ... $placeholder_args) use ($callable, $args): mixed {
2630
$final_args = [];
2731
foreach ($args as $key => $arg)
2832
{

src/Str.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
<?php
22
namespace nixn\php;
33

4-
/** @since 1.0 */
4+
/**
5+
* Utilities for strings.
6+
*
7+
* @since 1.0
8+
*/
59
final class Str
610
{
711
/** @codeCoverageIgnore */

src/Util.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
<?php
22
namespace nixn\php;
33

4-
/** @since 1.0 */
4+
/**
5+
* Miscellaneous utilities.
6+
*
7+
* @since 1.0
8+
*/
59
final class Util
610
{
711
/** @codeCoverageIgnore */

0 commit comments

Comments
 (0)