Skip to content

Commit

Permalink
Merge pull request #3 from heiglandreas/addStuff
Browse files Browse the repository at this point in the history
Adds usage of Boxes
  • Loading branch information
heiglandreas authored Feb 14, 2017
2 parents 3a9b0a4 + c9bc3c4 commit e1c196f
Show file tree
Hide file tree
Showing 8 changed files with 423 additions and 112 deletions.
21 changes: 21 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

$finder = PhpCsFixer\Finder::create()
->exclude('migrations')
->in(__DIR__);

$config = PhpCsFixer\Config::create()
->setUsingCache(true)
->setRules([
'@PSR2' => true,
'array_syntax' => [
'syntax' => 'short'
],
'no_unused_imports' => true,
'ordered_imports' => true,
'psr0' => false,
'trailing_comma_in_multiline_array' => true,
])
->setFinder($finder);

return $config;
33 changes: 26 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ matrix:
- php: 5.6
env:
- DEPS=lowest
- php: 5.6
env:
- DEPS=locked
- TEST_COVERAGE=true
- DEPLOY_DOCS="$(if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then echo -n 'true' ; else echo -n 'false' ; fi)"
- PATH="$HOME/.local/bin:$PATH"
- php: 5.6
env:
- DEPS=latest
Expand All @@ -48,12 +42,35 @@ matrix:
- php: 7
env:
- DEPS=latest
- php: hhvm
- php: 7.1
env:
- DEPS=lowest
- php: 7.1
env:
- DEPS=locked
- TEST_COVERAGE=true
- WITH_CS=true
- DEPLOY_DOCS="$(if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then echo -n 'true' ; else echo -n 'false' ; fi)"
- PATH="$HOME/.local/bin:$PATH"
- php: 7.1
env:
- DEPS=latest
- php: nightly
env:
- DEPS=lowest
- php: nightly
env:
- DEPS=latest
- php: hhvm
env:
- DEPS=lowest
- php: hhvm
env:
- DEPS=latest
allow_failures:
- php: hhvm
- php: nightly
- php: 5.5

notifications:
email: [email protected]
Expand All @@ -75,6 +92,8 @@ script:
- if [[ $TEST_COVERAGE != 'true' ]]; then composer test ; fi
- if [[ $CHECK_CS == 'true' ]]; then composer cs-check ; fi
- if [[ $DEPLOY_DOCS == "true" && "$TRAVIS_TEST_RESULT" == "0" ]]; then ./docsinstall.sh; composer api; fi
- if [[ "$WITH_CS" == "true" ]]; then vendor/bin/php-cs-fixer fix --verbose --diff --dry-run; fi


after_success:
- if [[ $DEPLOY_DOCS == "true" ]]; then echo "Preparing to build and deploy documentation" ; ./.builddocs.sh ; echo "Completed deploying documentation" ; fi
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![Build Status](https://travis-ci.org/heiglandreas/Org_Heigl_Ghostscript.svg?branch=master)](https://travis-ci.org/heiglandreas/Org_Heigl_Ghostscript)
[![Coverage Status](https://coveralls.io/repos/github/heiglandreas/Org_Heigl_Ghostscript/badge.svg?branch=master)](https://coveralls.io/github/heiglandreas/Org_Heigl_Ghostscript?branch=master)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/6be2e49960764a688d269c043d30216c)](https://www.codacy.com/app/github_70/Org_Heigl_Ghostscript?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=heiglandreas/Org_Heigl_Ghostscript&amp;utm_campaign=Badge_Grade)

A PHP-wrapper to the Ghostscript-CLI

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
}
},
"require-dev": {
"phpunit/phpunit": "^4.8||^5.3",
"phpunit/phpunit": "^5.3",
"phpdocumentor/phpdocumentor": "^2.9",
"fabpot/php-cs-fixer": "^1.11"
"friendsofphp/php-cs-fixer": "^2.1"
},
"scripts" : {
"cs-check": "php-cs-fixer --version && php-cs-fixer fix . --level=psr2 -v --diff --dry-run",
Expand Down
2 changes: 2 additions & 0 deletions doc/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Convert a PDF- or Postscript-File to a JPEG

This is the basic way of creating a JPEG from a PDF-File

```
<?php
use Org_Heigl\Ghostscript\Ghostscript;
Expand Down
11 changes: 5 additions & 6 deletions src/Device/Png.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,16 @@ public function getDevice()
public function setDevice($device)
{
$device = strtolower($device);
$devices = array(
$devices = [
'pngalpha',
'png16m',
'png256',
'png16',
'pnggray',
'pngmono'
);
if (! in_array($device, $devices)) {
$this -> _device = 'pngalpha';
} else {
'pngmono',
];
$this->_device = 'pngalpha';
if (in_array($device, $devices)) {
$this -> _device = $device;
}

Expand Down
Loading

0 comments on commit e1c196f

Please sign in to comment.