Skip to content

Commit e1c196f

Browse files
authored
Merge pull request #3 from heiglandreas/addStuff
Adds usage of Boxes
2 parents 3a9b0a4 + c9bc3c4 commit e1c196f

File tree

8 files changed

+423
-112
lines changed

8 files changed

+423
-112
lines changed

.php_cs

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->exclude('migrations')
5+
->in(__DIR__);
6+
7+
$config = PhpCsFixer\Config::create()
8+
->setUsingCache(true)
9+
->setRules([
10+
'@PSR2' => true,
11+
'array_syntax' => [
12+
'syntax' => 'short'
13+
],
14+
'no_unused_imports' => true,
15+
'ordered_imports' => true,
16+
'psr0' => false,
17+
'trailing_comma_in_multiline_array' => true,
18+
])
19+
->setFinder($finder);
20+
21+
return $config;

.travis.yml

+26-7
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@ matrix:
3333
- php: 5.6
3434
env:
3535
- DEPS=lowest
36-
- php: 5.6
37-
env:
38-
- DEPS=locked
39-
- TEST_COVERAGE=true
40-
- DEPLOY_DOCS="$(if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then echo -n 'true' ; else echo -n 'false' ; fi)"
41-
- PATH="$HOME/.local/bin:$PATH"
4236
- php: 5.6
4337
env:
4438
- DEPS=latest
@@ -48,12 +42,35 @@ matrix:
4842
- php: 7
4943
env:
5044
- DEPS=latest
51-
- php: hhvm
45+
- php: 7.1
46+
env:
47+
- DEPS=lowest
48+
- php: 7.1
49+
env:
50+
- DEPS=locked
51+
- TEST_COVERAGE=true
52+
- WITH_CS=true
53+
- DEPLOY_DOCS="$(if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then echo -n 'true' ; else echo -n 'false' ; fi)"
54+
- PATH="$HOME/.local/bin:$PATH"
55+
- php: 7.1
56+
env:
57+
- DEPS=latest
58+
- php: nightly
59+
env:
60+
- DEPS=lowest
61+
- php: nightly
62+
env:
63+
- DEPS=latest
64+
- php: hhvm
5265
env:
5366
- DEPS=lowest
5467
- php: hhvm
5568
env:
5669
- DEPS=latest
70+
allow_failures:
71+
- php: hhvm
72+
- php: nightly
73+
- php: 5.5
5774

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

7998
after_success:
8099
- if [[ $DEPLOY_DOCS == "true" ]]; then echo "Preparing to build and deploy documentation" ; ./.builddocs.sh ; echo "Completed deploying documentation" ; fi

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![Build Status](https://travis-ci.org/heiglandreas/Org_Heigl_Ghostscript.svg?branch=master)](https://travis-ci.org/heiglandreas/Org_Heigl_Ghostscript)
44
[![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)
5+
[![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)
56

67
A PHP-wrapper to the Ghostscript-CLI
78

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
}
2121
},
2222
"require-dev": {
23-
"phpunit/phpunit": "^4.8||^5.3",
23+
"phpunit/phpunit": "^5.3",
2424
"phpdocumentor/phpdocumentor": "^2.9",
25-
"fabpot/php-cs-fixer": "^1.11"
25+
"friendsofphp/php-cs-fixer": "^2.1"
2626
},
2727
"scripts" : {
2828
"cs-check": "php-cs-fixer --version && php-cs-fixer fix . --level=psr2 -v --diff --dry-run",

doc/usage.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

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

5+
This is the basic way of creating a JPEG from a PDF-File
6+
57
```
68
<?php
79
use Org_Heigl\Ghostscript\Ghostscript;

src/Device/Png.php

+5-6
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,16 @@ public function getDevice()
7979
public function setDevice($device)
8080
{
8181
$device = strtolower($device);
82-
$devices = array(
82+
$devices = [
8383
'pngalpha',
8484
'png16m',
8585
'png256',
8686
'png16',
8787
'pnggray',
88-
'pngmono'
89-
);
90-
if (! in_array($device, $devices)) {
91-
$this -> _device = 'pngalpha';
92-
} else {
88+
'pngmono',
89+
];
90+
$this->_device = 'pngalpha';
91+
if (in_array($device, $devices)) {
9392
$this -> _device = $device;
9493
}
9594

0 commit comments

Comments
 (0)