Skip to content

Commit

Permalink
Php8 (#3)
Browse files Browse the repository at this point in the history
* Require PHP 8.0+

* Enable max phpstan level and fix errors
  • Loading branch information
nicolaasuni authored Nov 10, 2023
1 parent 4043338 commit ea3887e
Show file tree
Hide file tree
Showing 16 changed files with 1,894 additions and 510 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,10 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ["7.2", "7.3", "7.4", "8.0", "8.1", "8.2"]
php-version: ["8.0", "8.1", "8.2"]
experimental: [false]
os: [ubuntu-latest]
coverage-extension: [pcov]
include:
#- { php-version: '5.3', experimental: false, os: ubuntu-latest, coverage-extension: 'xdebug' }
#- { php-version: '5.4', experimental: false, os: ubuntu-latest, coverage-extension: 'xdebug' }
- { php-version: '5.5', experimental: false, os: ubuntu-latest, coverage-extension: 'xdebug' }
- { php-version: '5.6', experimental: false, os: ubuntu-latest, coverage-extension: 'xdebug' }
- { php-version: '7.1', experimental: false, os: ubuntu-latest, coverage-extension: 'xdebug' }
steps:
- uses: actions/checkout@v4
- name: Use php ${{ matrix.php-version }}
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@
**/.vagrant
**/auth.json
**/nbproject
**/temp.php
**/test.php
.phpdoc
.phpunit.cache
.phpunit.result.cache
composer.lock
ecs.php
phpunit.xml
rector.php
target
vendor
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ All artifacts are generated in the target directory.

Examples are located in the `example` directory.

Start a development server (requires PHP 5.4) using the command:
Start a development server (requires PHP 8.0+) using the command:

```
make server
Expand All @@ -78,15 +78,15 @@ Create a composer.json in your projects root-directory:
```json
{
"require": {
"tecnickcom/tc-lib-pdf-image": "^1.2"
"tecnickcom/tc-lib-pdf-image": "^2.0"
}
}
```

Or add to an existing project with:

```bash
composer require tecnickcom/tc-lib-pdf-image ^1.2
composer require tecnickcom/tc-lib-pdf-image ^2.0
```


Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.20
2.0.6
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
}
],
"require": {
"php": ">=5.4",
"php": ">=8.0",
"ext-gd": "*",
"ext-zlib": "*",
"tecnickcom/tc-lib-file": "^1.7",
"tecnickcom/tc-lib-color": "^1.14",
"tecnickcom/tc-lib-pdf-encrypt": "^1.6"
"tecnickcom/tc-lib-file": "^2.0",
"tecnickcom/tc-lib-color": "^2.0",
"tecnickcom/tc-lib-pdf-encrypt": "^2.0"
},
"require-dev": {
"pdepend/pdepend": "2.13.0",
"phpmd/phpmd": "2.13.0",
"phpunit/phpunit": "10.1.2 || 9.6.7 || 8.5.31 || 7.5.20 || 6.5.14 || 5.7.27 || 4.8.36",
"squizlabs/php_codesniffer": "3.7.2 || 2.9.2"
"phpunit/phpunit": "10.1.2 || 9.6.13",
"squizlabs/php_codesniffer": "3.7.2"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
parameters:
level: 5
level: max
paths:
- src
- test
Expand Down
2 changes: 1 addition & 1 deletion resources/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ Vcs-Git: https://github.com/~#VENDOR#~/~#PROJECT#~.git
Package: ~#PKGNAME#~
Provides: php-~#PROJECT#~
Architecture: all
Depends: php (>= 5.4.0), php-gd, php-zip, php-tecnickcom-tc-lib-file (<< 2.0.0), php-tecnickcom-tc-lib-file (>= 1.7.39), php-tecnickcom-tc-lib-color (<< 2.0.0), php-tecnickcom-tc-lib-color (>= 1.14.39), php-tecnickcom-tc-lib-pdf-encrypt (<< 2.0.0), php-tecnickcom-tc-lib-pdf-encrypt (>= 1.6.35), ${misc:Depends}
Depends: php (>= 8.0.0), php-gd, php-zip, php-tecnickcom-tc-lib-file (<< 2.0.0), php-tecnickcom-tc-lib-file (>= 2.0.6), php-tecnickcom-tc-lib-color (<< 2.0.0), php-tecnickcom-tc-lib-color (>= 2.0.3), php-tecnickcom-tc-lib-pdf-encrypt (<< 2.0.0), php-tecnickcom-tc-lib-pdf-encrypt (>= 2.0.6), ${misc:Depends}
Description: PHP PDF Image Library
PHP library containing PDF Image methods.
8 changes: 4 additions & 4 deletions resources/rpm/rpm.spec
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ URL: https://github.com/%{gh_owner}/%{gh_project}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n)
BuildArch: noarch

Requires: php(language) >= 5.4.0
Requires: php(language) >= 8.0.0
Requires: php-gd
Requires: php-zlib
Requires: php-composer(%{c_vendor}/tc-lib-file) < 2.0.0
Requires: php-composer(%{c_vendor}/tc-lib-file) >= 1.7.39
Requires: php-composer(%{c_vendor}/tc-lib-file) >= 2.0.6
Requires: php-composer(%{c_vendor}/tc-lib-color) < 2.0.0
Requires: php-composer(%{c_vendor}/tc-lib-color) >= 1.14.39
Requires: php-composer(%{c_vendor}/tc-lib-color) >= 2.0.3
Requires: php-composer(%{c_vendor}/tc-lib-pdf-encrypt) < 2.0.0
Requires: php-composer(%{c_vendor}/tc-lib-pdf-encrypt) >= 1.6.35
Requires: php-composer(%{c_vendor}/tc-lib-pdf-encrypt) >= 2.0.6

Provides: php-composer(%{c_vendor}/%{gh_project}) = %{version}
Provides: php-%{gh_project} = %{version}
Expand Down
28 changes: 14 additions & 14 deletions src/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
/**
* Exception.php
*
* @since 2011-05-23
* @category Library
* @package PdfImage
* @author Nicola Asuni <[email protected]>
* @copyright 2011-2023 Nicola Asuni - Tecnick.com LTD
* @license http://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE.TXT)
* @link https://github.com/tecnickcom/tc-lib-pdf-Image
* @since 2011-05-23
* @category Library
* @package PdfImage
* @author Nicola Asuni <[email protected]>
* @copyright 2011-2023 Nicola Asuni - Tecnick.com LTD
* @license http://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE.TXT)
* @link https://github.com/tecnickcom/tc-lib-pdf-Image
*
* This file is part of tc-lib-pdf-Image software library.
*/
Expand All @@ -21,13 +21,13 @@
*
* Custom Exception class
*
* @since 2011-05-23
* @category Library
* @package PdfImage
* @author Nicola Asuni <[email protected]>
* @copyright 2011-2023 Nicola Asuni - Tecnick.com LTD
* @license http://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE.TXT)
* @link https://github.com/tecnickcom/tc-lib-pdf-Image
* @since 2011-05-23
* @category Library
* @package PdfImage
* @author Nicola Asuni <[email protected]>
* @copyright 2011-2023 Nicola Asuni - Tecnick.com LTD
* @license http://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE.TXT)
* @link https://github.com/tecnickcom/tc-lib-pdf-Image
*/
class Exception extends \Exception
{
Expand Down
Loading

0 comments on commit ea3887e

Please sign in to comment.