Skip to content

Commit

Permalink
use phpDocumentor for API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
splitbrain committed Feb 5, 2021
1 parent 750286f commit c311230
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 34 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/apigen.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/phpdoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: PhpDocumentor

on:
workflow_run:
workflows: ["Unit Tests"]
branches: [master]
types:
- completed

jobs:
PHPDoc:
#if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4

- name: Generate Docs
run: |
wget -q https://phpdoc.org/phpDocumentor.phar
chmod +x phpDocumentor.phar
./phpDocumentor.phar -d src -t docs --visibility public,protected --title $GITHUB_REPOSITORY
- name: Deploy
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: docs # The folder the action should deploy.
CLEAN: true # Automatically remove deleted files from the deploy branch

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ try {
}
```

Please also check the [API Docs](https://splitbrain.github.io/slika/) for details.

## Operations

### resize
Expand Down
4 changes: 0 additions & 4 deletions apigen.neon

This file was deleted.

4 changes: 3 additions & 1 deletion src/Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

namespace splitbrain\slika;


/**
* Base class for image adapters. Defines what image processing adapters need to provide
*/
abstract class Adapter
{
/** @var string path tot he image */
Expand Down
4 changes: 3 additions & 1 deletion src/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

namespace splitbrain\slika;


/**
* Exception thrown on all errors during image processing
*/
class Exception extends \Exception
{

Expand Down
4 changes: 3 additions & 1 deletion src/GdAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

namespace splitbrain\slika;


/**
* Image processing adapter for PHP's libGD
*/
class GdAdapter extends Adapter
{
/** @var resource libGD image */
Expand Down
4 changes: 3 additions & 1 deletion src/ImageMagickAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

namespace splitbrain\slika;


/**
* Image Processing Adapter for ImageMagick's command line utility `convert`
*/
class ImageMagickAdapter extends Adapter
{
/** @var array the CLI arguments to run imagemagick */
Expand Down
12 changes: 7 additions & 5 deletions src/Slika.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@

namespace splitbrain\slika;


/**
* Factory to process an image using an available Adapter
*/
class Slika
{
/** @var int rotate an image counter clock wise */
/** rotate an image counter clock wise */
const ROTATE_CCW = 8;
/** @var int rotate an image clock wise */
/** rotate an image clock wise */
const ROTATE_CW = 6;
/** @var int rotate on it's head */
/** rotate on it's head */
const ROTATE_TOPDOWN = 3;


/** these can be overwritten using the options array in run() */
const DEFAULT_OPTIONS = [
'quality' => 92,
'imconvert' => '/usr/bin/convert',
Expand Down

0 comments on commit c311230

Please sign in to comment.