Skip to content

Commit

Permalink
Merge pull request #3 from robopuff/1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
robopuff authored Apr 23, 2021
2 parents 77a7416 + bb65342 commit 0d5456a
Show file tree
Hide file tree
Showing 50 changed files with 3,049 additions and 1,808 deletions.
7 changes: 4 additions & 3 deletions .phan/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
// then Phan assumes the PHP version which is closest to the minor version
// of the php executable used to execute phan.
// Automatically inferred from composer.json requirement for "php" of "^7.1"
'target_php_version' => '7.2',
'target_php_version' => '7.4',

// If enabled, missing properties will be created when
// they are first seen. If false, we'll report an
Expand Down Expand Up @@ -216,7 +216,9 @@

// Add any issue types (such as 'PhanUndeclaredMethod')
// to this black-list to inhibit them from being reported.
'suppress_issue_types' => [],
'suppress_issue_types' => [
'PhanTypeInvalidThrowsIsInterface'
],

// A regular expression to match files to be excluded
// from parsing and analysis and will not be read at all.
Expand Down Expand Up @@ -292,7 +294,6 @@
'vendor/psr/cache/src',
'vendor/psr/http-message/src',
'vendor/psr/log/Psr/Log',
'vendor/ocramius/package-versions/src',
],

// A list of individual files to include in analysis
Expand Down
13 changes: 5 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,15 @@ env:

matrix:
include:
- php: 7.3
env:
- DEPS=locked
- php: 7.3
env:
- DEPS=latest
- php: 7.4
env:
- DEPS=locked
- php: 7.4
- php: 8.0
env:
- DEPS=locked
- php: 8.0
env:
- DEPS=latest
- DEPS=latest

before_install:
- if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ composer require robopuff/tinypng
## Usage

```php
$tinyPng = new \TinyPng\TinyPng('your_api_key');
$tinyPng->fromFile('unoptimized_image.png')->toFile('optimized_image.png');
$tinyPng = new \TinyPng\TinyPng(new \TinyPng\Client\GuzzleClient('your_api_key'));
$tinyPng
->optimize(new \TinyPng\Input\Filesystem('unoptimized_image.png'))
->store(new \TinyPng\Output\Storage\Filesystem('optimized_image.png'));
```

## Running tests
Expand Down
23 changes: 12 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,22 @@
"sort-packages": true
},
"require": {
"php": "^7.3",
"psr/cache": "^1.0",
"php": "^7.4 || ^8.0",
"psr/cache": "^3.0",
"psr/http-message": "^1.0",
"psr/log": "^1.0",
"guzzlehttp/guzzle": "^6.3",
"ocramius/package-versions": "^1.5"
"psr/log": "^1.1",
"guzzlehttp/guzzle": "^7.3",
"ext-json": "*"
},
"require-dev": {
"paragonie/certainty": "^2.6",
"phan/phan": "^2.4",
"paragonie/certainty": "^2.8",
"phan/phan": "^4.0",
"phpspec/prophecy-phpunit": "^2.0",
"phpstan/phpstan": "^0.12",
"phpunit/php-code-coverage": "^7.0",
"phpunit/phpunit": "^8.5",
"phpunit/php-code-coverage": "^9.2",
"phpunit/phpunit": "^9.5",
"roave/security-advisories": "dev-master",
"squizlabs/php_codesniffer": "^3.5"
"squizlabs/php_codesniffer": "^3.6"
},
"autoload": {
"psr-4": {
Expand All @@ -38,7 +39,7 @@
},
"scripts": {
"phan": "phan --color --allow-polyfill-parser",
"analyse": "phpstan analyse --level 7 --ansi -n ./src",
"analyse": "phpstan analyse --ansi -n -c ./phpstan.neon",
"cs-check": "phpcs",
"cs-fix": "phpcbf",
"test": "phpunit --colors=always",
Expand Down
Loading

0 comments on commit 0d5456a

Please sign in to comment.