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

Next major version #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 14 additions & 0 deletions .apidocrc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

declare(strict_types=1);

use spaceonfire\ApiDoc\Config\Processor\BuilderProcessor;
use spaceonfire\ApiDoc\Config\Processor\ProcessorInterface;

return static function (): ProcessorInterface {
return (new BuilderProcessor())
->withProjectName('SpaceOnFire ApiDoc')
->withSourceDirectories([__DIR__ . '/src'])
->withOutputDirectory(__DIR__ . '/docs')
->withBaseNamespace('spaceonfire\ApiDoc');
};
11 changes: 2 additions & 9 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,9 @@ root = true
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = tab
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[**.{js,ts,jsx,tsx,less,css,sass,scss,json,yml}]
[**.{js, ts, jsx, tsx, less, css, sass, scss, json, yml, yaml}]
indent_size = 2
indent_style = space

[**.{md,php}]
indent_style = space

[bin/**]
indent_style = space
14 changes: 10 additions & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html

# Ignore all test and documentation with "export-ignore".
/.github export-ignore
/bin/coverage-badge export-ignore
/docs export-ignore
/tests export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.github export-ignore
/phpcs.xml.dist export-ignore
/CODE_OF_CONDUCT.md export-ignore
/CONTRIBUTING.md export-ignore
/docker-compose.yml export-ignore
/ecs.php export-ignore
/Makefile export-ignore
/phpstan.neon.dist export-ignore
/phpunit.xml.dist export-ignore
/tests export-ignore
/docs export-ignore
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
liberapay: hustlahusky
custom:
- https://www.paypal.me/hustlahusky
10 changes: 5 additions & 5 deletions .github/ISSUE_TEMPLATE.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Not obligatory, but suggest an idea for implementing addition or change.

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

* Version used (e.g. PHP 5.6, HHVM 3):
* Operating system and version (e.g. Ubuntu 16.04, Windows 7):
* Link to your project:
* ...
* ...
- Version used (e.g. PHP 5.6, HHVM 3):
- Operating system and version (e.g. Ubuntu 16.04, Windows 7):
- Link to your project:
- ...
- ...
113 changes: 113 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: Build Pipeline

on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:

jobs:
composer:
runs-on: ubuntu-latest
container: spaceonfire/nginx-php-fpm:latest-7.2
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Validate composer.json
run: composer validate

codestyle:
runs-on: ubuntu-latest
container: spaceonfire/nginx-php-fpm:latest-7.2
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
env:
COMPOSER_CACHE_KEY: 'composer-7.2'
with:
path: vendor
key: ${{ env.COMPOSER_CACHE_KEY }}
restore-keys: ${{ env.COMPOSER_CACHE_KEY }}

- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest

- name: Check coding standard
run: vendor/bin/ecs check --no-progress-bar --no-interaction

phpstan:
runs-on: ubuntu-latest
container: spaceonfire/nginx-php-fpm:latest-7.2
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
env:
COMPOSER_CACHE_KEY: 'composer-7.2'
with:
path: vendor
key: ${{ env.COMPOSER_CACHE_KEY }}
restore-keys: ${{ env.COMPOSER_CACHE_KEY }}

- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest

- name: PHPStan
run: vendor/bin/phpstan analyse --no-progress --no-interaction --memory-limit=512M

phpunit:
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- '7.2'
- '7.3'
- '7.4'
container: spaceonfire/nginx-php-fpm:latest-${{ matrix.php-version }}
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
env:
COMPOSER_CACHE_KEY: 'composer-${{ matrix.php-version }}'
with:
path: vendor
key: ${{ env.COMPOSER_CACHE_KEY }}
restore-keys: ${{ env.COMPOSER_CACHE_KEY }}

- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest

- name: PHPUnit
run: |
apk update
docker-php-ext-enable xdebug
vendor/bin/phpunit --no-interaction
cat build/phpunit/coverage.txt

- name: PHPUnit Artifacts
uses: actions/upload-artifact@v2
with:
name: phpunit-${{ matrix.php-version }}
path: build/phpunit/

- name: Generate coverage badge
if: matrix.php-version == '7.2' && github.event_name == 'push' && github.ref == 'refs/heads/master'
run: php bin/coverage-badge ${{ github.repository }}.json ${{ secrets.COVERAGE_GIST_ID }} ${{ secrets.COVERAGE_GIST_TOKEN }}
28 changes: 17 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
# Project folders and files to ignore
build
phpcs.xml
phpunit.xml
vendor

# Numerous always-ignore extensions
*.diff
*.err
Expand All @@ -18,11 +12,6 @@ vendor
*.lock
!**/yarn.lock

# Dotenv
.env
.env.*
!.env.example

# OS or Editor folders
.DS_Store
._*
Expand All @@ -44,3 +33,20 @@ nbproject
.directory
*.sql
*.tar*

# Dotenv
.env
.env.*
!.env.example

# Project folders and files to ignore
build/phpunit
build/box/apidoc.phar
vendor
.phpunit.result.cache
phpunit.xml
phpstan.neon
docker-compose.override.yml
box.phar
box.json
!composer.lock
23 changes: 10 additions & 13 deletions CODE_OF_CONDUCT.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,19 @@ orientation.
Examples of behavior that contributes to creating a positive environment
include:

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

Examples of unacceptable behavior by participants include:

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

## Our Responsibilities

Expand Down
19 changes: 7 additions & 12 deletions CONTRIBUTING.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,24 @@ Contributions are **welcome** and will be fully **credited**.

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


## Pull Requests

- **[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``.

- **[PSR-12 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-12-extended-coding-style-guide.md)** -
Check the code style with `$ composer codestyle` and fix it with `$ composer codestyle -- --fix`.
- **Add tests!** - Your patch won't be accepted if it doesn't have tests.

- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.

- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.

- **Create feature branches** - Don't ask us to pull from your master branch.

- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.

- **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.

- **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.

## Running Tests

``` bash
```bash
$ composer test
```


**Happy coding**!
Empty file modified LICENSE.md
100644 → 100755
Empty file.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
start:
docker-compose up -d
docker-compose exec app su-exec nginx bash

stop:
docker-compose down
23 changes: 6 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,17 @@
[![Latest Version on Packagist][ico-version]][link-packagist]
[![Software License][ico-license]](LICENSE.md)
[![Total Downloads][ico-downloads]][link-downloads]
[![Code Coverage][ico-coverage]][link-actions]
[![Build Status][ico-build-status]][link-actions]

Simple API documentation generator for your PHP library.

## Structure

```
bin/ Package binaries
docs/ API documentation
src/ Source code
tests/ Unit tests
```

## Install

Via Composer

```bash
$ composer require spaceonfire/simple-php-apidoc
composer require spaceonfire/simple-php-apidoc
```

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

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

## Testing

```bash
$ composer test
```

## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md) for details.
Expand All @@ -59,8 +46,10 @@ The MIT License (MIT). Please see [License File](LICENSE.md) for more informatio
[ico-version]: https://img.shields.io/packagist/v/spaceonfire/simple-php-apidoc.svg?style=flat-square
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
[ico-downloads]: https://img.shields.io/packagist/dt/spaceonfire/simple-php-apidoc.svg?style=flat-square

[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
[ico-build-status]: https://github.com/spaceonfire/simple-php-apidoc/workflows/Build%20Pipeline/badge.svg
[link-packagist]: https://packagist.org/packages/spaceonfire/simple-php-apidoc
[link-downloads]: https://packagist.org/packages/spaceonfire/simple-php-apidoc
[link-author]: https://github.com/hustlahusky
[link-contributors]: ../../contributors
[link-actions]: ../../actions
Loading