Skip to content
This repository was archived by the owner on Jun 2, 2022. It is now read-only.

Commit c26d2f2

Browse files
committed
feat: rewrite everything for next major version
BREAKING CHANGE
1 parent 90a3ac2 commit c26d2f2

File tree

353 files changed

+23060
-7956
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

353 files changed

+23060
-7956
lines changed

.apidocrc.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use spaceonfire\ApiDoc\Config\Processor\BuilderProcessor;
6+
use spaceonfire\ApiDoc\Config\Processor\ProcessorInterface;
7+
8+
return static function (): ProcessorInterface {
9+
return (new BuilderProcessor())
10+
->withProjectName('SpaceOnFire ApiDoc')
11+
->withSourceDirectories([__DIR__ . '/src'])
12+
->withOutputDirectory(__DIR__ . '/docs')
13+
->withBaseNamespace('spaceonfire\ApiDoc');
14+
};

.editorconfig

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ indent_style = tab
1111
insert_final_newline = true
1212
trim_trailing_whitespace = true
1313

14-
[**.{js,ts,jsx,tsx,less,css,sass,scss,json,yml}]
14+
[**.{js, ts, jsx, tsx, less, css, sass, scss, json, yml}]
1515
indent_size = 2
1616
indent_style = space
1717

18-
[**.{md,php}]
18+
[**.{md, md.twig, php}]
1919
indent_style = space
2020

2121
[bin/**]

.gitattributes

+10-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,17 @@
22
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
33

44
# Ignore all test and documentation with "export-ignore".
5+
/.github export-ignore
6+
/bin/coverage-badge export-ignore
7+
/docs export-ignore
8+
/tests export-ignore
59
/.editorconfig export-ignore
610
/.gitattributes export-ignore
711
/.gitignore export-ignore
8-
/.github export-ignore
9-
/phpcs.xml.dist export-ignore
12+
/CODE_OF_CONDUCT.md export-ignore
13+
/CONTRIBUTING.md export-ignore
14+
/docker-compose.yml export-ignore
15+
/ecs.php export-ignore
16+
/Makefile export-ignore
17+
/phpstan.neon.dist export-ignore
1018
/phpunit.xml.dist export-ignore
11-
/tests export-ignore
12-
/docs export-ignore

.github/FUNDING.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
liberapay: hustlahusky
2+
custom:
3+
- https://www.paypal.me/hustlahusky

.github/ISSUE_TEMPLATE.md

100644100755
+5-5
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ Not obligatory, but suggest an idea for implementing addition or change.
2020

2121
Include as many relevant details about the environment you experienced the bug in and how to reproduce it.
2222

23-
* Version used (e.g. PHP 5.6, HHVM 3):
24-
* Operating system and version (e.g. Ubuntu 16.04, Windows 7):
25-
* Link to your project:
26-
* ...
27-
* ...
23+
- Version used (e.g. PHP 5.6, HHVM 3):
24+
- Operating system and version (e.g. Ubuntu 16.04, Windows 7):
25+
- Link to your project:
26+
- ...
27+
- ...

.github/workflows/build.yml

+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: Build Pipeline
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
workflow_dispatch:
11+
12+
jobs:
13+
composer:
14+
runs-on: ubuntu-latest
15+
container: spaceonfire/nginx-php-fpm:latest-7.2
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v2
19+
20+
- name: Validate composer.json
21+
run: composer validate
22+
23+
codestyle:
24+
runs-on: ubuntu-latest
25+
container: spaceonfire/nginx-php-fpm:latest-7.2
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v2
29+
30+
- name: Cache Composer packages
31+
id: composer-cache
32+
uses: actions/cache@v2
33+
env:
34+
COMPOSER_CACHE_KEY: 'composer-7.2'
35+
with:
36+
path: vendor
37+
key: ${{ env.COMPOSER_CACHE_KEY }}
38+
restore-keys: ${{ env.COMPOSER_CACHE_KEY }}
39+
40+
- name: Install dependencies
41+
if: steps.composer-cache.outputs.cache-hit != 'true'
42+
run: composer install --prefer-dist --no-progress --no-suggest
43+
44+
- name: Check coding standard
45+
run: vendor/bin/ecs check --no-progress-bar --no-interaction
46+
47+
phpstan:
48+
runs-on: ubuntu-latest
49+
container: spaceonfire/nginx-php-fpm:latest-7.2
50+
steps:
51+
- name: Checkout
52+
uses: actions/checkout@v2
53+
54+
- name: Cache Composer packages
55+
id: composer-cache
56+
uses: actions/cache@v2
57+
env:
58+
COMPOSER_CACHE_KEY: 'composer-7.2'
59+
with:
60+
path: vendor
61+
key: ${{ env.COMPOSER_CACHE_KEY }}
62+
restore-keys: ${{ env.COMPOSER_CACHE_KEY }}
63+
64+
- name: Install dependencies
65+
if: steps.composer-cache.outputs.cache-hit != 'true'
66+
run: composer install --prefer-dist --no-progress --no-suggest
67+
68+
- name: PHPStan
69+
run: vendor/bin/phpstan analyse --no-progress --no-interaction --memory-limit=512M
70+
71+
phpunit:
72+
runs-on: ubuntu-latest
73+
strategy:
74+
matrix:
75+
php-version:
76+
- '7.2'
77+
- '7.3'
78+
- '7.4'
79+
container: spaceonfire/nginx-php-fpm:latest-${{ matrix.php-version }}
80+
steps:
81+
- name: Checkout
82+
uses: actions/checkout@v2
83+
84+
- name: Cache Composer packages
85+
id: composer-cache
86+
uses: actions/cache@v2
87+
env:
88+
COMPOSER_CACHE_KEY: 'composer-${{ matrix.php-version }}'
89+
with:
90+
path: vendor
91+
key: ${{ env.COMPOSER_CACHE_KEY }}
92+
restore-keys: ${{ env.COMPOSER_CACHE_KEY }}
93+
94+
- name: Install dependencies
95+
if: steps.composer-cache.outputs.cache-hit != 'true'
96+
run: composer install --prefer-dist --no-progress --no-suggest
97+
98+
- name: PHPUnit
99+
run: |
100+
apk update
101+
docker-php-ext-enable xdebug
102+
vendor/bin/phpunit --no-interaction
103+
cat build/coverage.txt
104+
105+
- name: PHPUnit Artifacts
106+
uses: actions/upload-artifact@v2
107+
with:
108+
name: phpunit-${{ matrix.php-version }}
109+
path: build/
110+
111+
- name: Generate coverage badge
112+
if: matrix.php-version == '7.2' && github.event_name == 'push' && github.ref == 'refs/heads/master'
113+
run: php bin/coverage-badge ${{ github.repository }}.json ${{ secrets.COVERAGE_GIST_ID }} ${{ secrets.COVERAGE_GIST_TOKEN }}

.gitignore

+16-11
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
# Project folders and files to ignore
2-
build
3-
phpcs.xml
4-
phpunit.xml
5-
vendor
6-
71
# Numerous always-ignore extensions
82
*.diff
93
*.err
@@ -18,11 +12,6 @@ vendor
1812
*.lock
1913
!**/yarn.lock
2014

21-
# Dotenv
22-
.env
23-
.env.*
24-
!.env.example
25-
2615
# OS or Editor folders
2716
.DS_Store
2817
._*
@@ -44,3 +33,19 @@ nbproject
4433
.directory
4534
*.sql
4635
*.tar*
36+
37+
# Dotenv
38+
.env
39+
.env.*
40+
!.env.example
41+
42+
# Project folders and files to ignore
43+
build
44+
vendor
45+
.phpunit.result.cache
46+
phpunit.xml
47+
phpstan.neon
48+
docker-compose.override.yml
49+
box.phar
50+
box.json
51+
php-scoper.phar

CODE_OF_CONDUCT.md

100644100755
+10-13
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,19 @@ orientation.
1414
Examples of behavior that contributes to creating a positive environment
1515
include:
1616

17-
* Using welcoming and inclusive language
18-
* Being respectful of differing viewpoints and experiences
19-
* Gracefully accepting constructive criticism
20-
* Focusing on what is best for the community
21-
* Showing empathy towards other community members
17+
- Using welcoming and inclusive language
18+
- Being respectful of differing viewpoints and experiences
19+
- Gracefully accepting constructive criticism
20+
- Focusing on what is best for the community
21+
- Showing empathy towards other community members
2222

2323
Examples of unacceptable behavior by participants include:
2424

25-
* The use of sexualized language or imagery and unwelcome sexual attention or
26-
advances
27-
* Trolling, insulting/derogatory comments, and personal or political attacks
28-
* Public or private harassment
29-
* Publishing others' private information, such as a physical or electronic
30-
address, without explicit permission
31-
* Other conduct which could reasonably be considered inappropriate in a
32-
professional setting
25+
- The use of sexualized language or imagery and unwelcome sexual attention or advances
26+
- Trolling, insulting/derogatory comments, and personal or political attacks
27+
- Public or private harassment
28+
- Publishing others' private information, such as a physical or electronic address, without explicit permission
29+
- Other conduct which could reasonably be considered inappropriate in a professional setting
3330

3431
## Our Responsibilities
3532

CONTRIBUTING.md

100644100755
+7-12
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,24 @@ Contributions are **welcome** and will be fully **credited**.
44

55
We accept contributions via Pull Requests on [Github](https://github.com/spaceonfire/simple-php-apidoc).
66

7-
87
## Pull Requests
98

10-
- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - Check the code style with ``$ composer check-style`` and fix it with ``$ composer fix-style``.
11-
9+
- **[PSR-12 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-12-extended-coding-style-guide.md)** -
10+
Check the code style with `$ composer codestyle` and fix it with `$ composer codestyle -- --fix`.
1211
- **Add tests!** - Your patch won't be accepted if it doesn't have tests.
13-
1412
- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.
15-
1613
- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.
17-
1814
- **Create feature branches** - Don't ask us to pull from your master branch.
19-
2015
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
21-
22-
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.
23-
16+
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful.
17+
If you had to make multiple intermediate commits while developing,
18+
please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages)
19+
before submitting.
2420

2521
## Running Tests
2622

27-
``` bash
23+
```bash
2824
$ composer test
2925
```
3026

31-
3227
**Happy coding**!

LICENSE.md

100644100755
File mode changed.

Makefile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
start:
2+
docker-compose up -d
3+
docker-compose exec app su-exec nginx bash
4+
5+
stop:
6+
docker-compose down

README.md

+6-17
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,17 @@
33
[![Latest Version on Packagist][ico-version]][link-packagist]
44
[![Software License][ico-license]](LICENSE.md)
55
[![Total Downloads][ico-downloads]][link-downloads]
6+
[![Code Coverage][ico-coverage]][link-actions]
7+
[![Build Status][ico-build-status]][link-actions]
68

79
Simple API documentation generator for your PHP library.
810

9-
## Structure
10-
11-
```
12-
bin/ Package binaries
13-
docs/ API documentation
14-
src/ Source code
15-
tests/ Unit tests
16-
```
17-
1811
## Install
1912

2013
Via Composer
2114

2215
```bash
23-
$ composer require spaceonfire/simple-php-apidoc
16+
composer require spaceonfire/simple-php-apidoc
2417
```
2518

2619
## Usage
@@ -33,12 +26,6 @@ $ composer require spaceonfire/simple-php-apidoc
3326

3427
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
3528

36-
## Testing
37-
38-
```bash
39-
$ composer test
40-
```
41-
4229
## Contributing
4330

4431
Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md) for details.
@@ -59,8 +46,10 @@ The MIT License (MIT). Please see [License File](LICENSE.md) for more informatio
5946
[ico-version]: https://img.shields.io/packagist/v/spaceonfire/simple-php-apidoc.svg?style=flat-square
6047
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
6148
[ico-downloads]: https://img.shields.io/packagist/dt/spaceonfire/simple-php-apidoc.svg?style=flat-square
62-
49+
[ico-coverage]: https://img.shields.io/endpoint?style=flat-square&url=https%3A%2F%2Fgist.githubusercontent.com%2Fhustlahusky%2Fd62607c1a2e4707959b0142e0ea876cd%2Fraw%2Fspaceonfire-simple-php-apidoc.json
50+
[ico-build-status]: https://github.com/spaceonfire/simple-php-apidoc/workflows/Build%20Pipeline/badge.svg
6351
[link-packagist]: https://packagist.org/packages/spaceonfire/simple-php-apidoc
6452
[link-downloads]: https://packagist.org/packages/spaceonfire/simple-php-apidoc
6553
[link-author]: https://github.com/hustlahusky
6654
[link-contributors]: ../../contributors
55+
[link-actions]: ../../actions

0 commit comments

Comments
 (0)