From 19f27116cf7e0fbfd1583765bad6094a8c01beaa Mon Sep 17 00:00:00 2001
From: Maximilian Kresse <545671+MaximilianKresse@users.noreply.github.com>
Date: Tue, 1 Sep 2026 15:51:06 +0200
Subject: [PATCH 1/8] Added support for php 8.6
---
composer.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/composer.json b/composer.json
index 29d6612..f5e73d4 100644
--- a/composer.json
+++ b/composer.json
@@ -15,7 +15,7 @@
}
},
"require": {
- "php": ">=7.2 <=8.5.99999",
+ "php": ">=7.2 <=8.6.99999",
"ext-zlib": "*"
},
"conflict": {
From d364ca78fac3254a5daaf916a33343078469ac45 Mon Sep 17 00:00:00 2001
From: Maximilian Kresse <545671+MaximilianKresse@users.noreply.github.com>
Date: Tue, 1 Sep 2026 15:51:06 +0200
Subject: [PATCH 2/8] Verified support for php 8.6
---
composer.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/composer.json b/composer.json
index 29d6612..f5e73d4 100644
--- a/composer.json
+++ b/composer.json
@@ -15,7 +15,7 @@
}
},
"require": {
- "php": ">=7.2 <=8.5.99999",
+ "php": ">=7.2 <=8.6.99999",
"ext-zlib": "*"
},
"conflict": {
From 49273b0dfa3a29251ae883753487c75b1937cf9b Mon Sep 17 00:00:00 2001
From: Maximilian Kresse <545671+MaximilianKresse@users.noreply.github.com>
Date: Tue, 1 Sep 2026 15:59:50 +0200
Subject: [PATCH 3/8] Added php 8.6 testsuite
---
.github/workflows/tests.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 0ba773f..52c1214 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -37,7 +37,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
+ php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5', '8.6']
steps:
- name: Checkout
uses: actions/checkout@v6
From 7080db7aa8b482449ff312870d5c50c3c3bfd74e Mon Sep 17 00:00:00 2001
From: Maximilian Kresse <545671+MaximilianKresse@users.noreply.github.com>
Date: Tue, 1 Sep 2026 16:22:09 +0200
Subject: [PATCH 4/8] Improved code styling
---
composer.json | 12 +-
composer.lock | 251 ++++++++++++++++++--
phpcs.xml | 15 ++
src/FpdfTplTrait.php | 4 +-
src/FpdfTrait.php | 3 +-
src/Fpdi.php | 5 -
src/FpdiTrait.php | 8 +-
src/PdfParser/CrossReference/LineReader.php | 2 +-
src/PdfParser/Filter/Flate.php | 14 +-
src/PdfParser/PdfParser.php | 2 +-
src/PdfParser/StreamReader.php | 4 +-
src/PdfParser/Type/PdfStream.php | 4 +-
src/PdfReader/PdfReader.php | 2 +-
src/Tcpdf/Fpdi.php | 2 +-
14 files changed, 279 insertions(+), 49 deletions(-)
diff --git a/composer.json b/composer.json
index f5e73d4..059b76d 100644
--- a/composer.json
+++ b/composer.json
@@ -41,7 +41,8 @@
"setasign/fpdf": "^1.9.0",
"tecnickcom/tcpdf": "^6.8",
"setasign/tfpdf": "~1.33",
- "squizlabs/php_codesniffer": "^3.5"
+ "squizlabs/php_codesniffer": "^4.0",
+ "slevomat/coding-standard": "^8.0"
},
"autoload-dev": {
"psr-4": {
@@ -50,6 +51,13 @@
},
"scripts": {
"all-tests": "@php vendor/bin/phpunit",
- "cs": "@php vendor/bin/phpcs"
+ "cs": "@php vendor/bin/phpcs",
+
+ "cbf": "@php vendor/bin/phpcbf"
+ },
+ "config": {
+ "allow-plugins": {
+ "dealerdirect/phpcodesniffer-composer-installer": true
+ }
}
}
diff --git a/composer.lock b/composer.lock
index 7e9c57f..e476674 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,9 +4,105 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "38406fa75303a8c338842852f8807db4",
+ "content-hash": "f416beab667b3a136350cd895533161d",
"packages": [],
"packages-dev": [
+ {
+ "name": "dealerdirect/phpcodesniffer-composer-installer",
+ "version": "v1.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/PHPCSStandards/composer-installer.git",
+ "reference": "963f0c67bffde0eac41b56be71ac0e8ba132f0bd"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/963f0c67bffde0eac41b56be71ac0e8ba132f0bd",
+ "reference": "963f0c67bffde0eac41b56be71ac0e8ba132f0bd",
+ "shasum": ""
+ },
+ "require": {
+ "composer-plugin-api": "^2.2",
+ "php": ">=5.4",
+ "squizlabs/php_codesniffer": "^3.1.0 || ^4.0"
+ },
+ "require-dev": {
+ "composer/composer": "^2.2",
+ "ext-json": "*",
+ "ext-zip": "*",
+ "php-parallel-lint/php-parallel-lint": "^1.4.0",
+ "phpcompatibility/php-compatibility": "^9.0 || ^10.0.0@dev",
+ "yoast/phpunit-polyfills": "^1.0"
+ },
+ "type": "composer-plugin",
+ "extra": {
+ "class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin"
+ },
+ "autoload": {
+ "psr-4": {
+ "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Franck Nijhof",
+ "email": "opensource@frenck.dev",
+ "homepage": "https://frenck.dev",
+ "role": "Open source developer"
+ },
+ {
+ "name": "Contributors",
+ "homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors"
+ }
+ ],
+ "description": "PHP_CodeSniffer Standards Composer Installer Plugin",
+ "keywords": [
+ "PHPCodeSniffer",
+ "PHP_CodeSniffer",
+ "code quality",
+ "codesniffer",
+ "composer",
+ "installer",
+ "phpcbf",
+ "phpcs",
+ "plugin",
+ "qa",
+ "quality",
+ "standard",
+ "standards",
+ "style guide",
+ "stylecheck",
+ "tests"
+ ],
+ "support": {
+ "issues": "https://github.com/PHPCSStandards/composer-installer/issues",
+ "security": "https://github.com/PHPCSStandards/composer-installer/security/policy",
+ "source": "https://github.com/PHPCSStandards/composer-installer"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/PHPCSStandards",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/jrfnl",
+ "type": "github"
+ },
+ {
+ "url": "https://opencollective.com/php_codesniffer",
+ "type": "open_collective"
+ },
+ {
+ "url": "https://thanks.dev/u/gh/phpcsstandards",
+ "type": "thanks_dev"
+ }
+ ],
+ "time": "2026-05-06T08:26:05+00:00"
+ },
{
"name": "doctrine/instantiator",
"version": "1.5.0",
@@ -255,6 +351,53 @@
},
"time": "2022-02-21T01:04:05+00:00"
},
+ {
+ "name": "phpstan/phpdoc-parser",
+ "version": "2.3.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpstan/phpdoc-parser.git",
+ "reference": "148cefffaf0233e4c08cc13db8a195a56dd6dfe9"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/148cefffaf0233e4c08cc13db8a195a56dd6dfe9",
+ "reference": "148cefffaf0233e4c08cc13db8a195a56dd6dfe9",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.4 || ^8.0"
+ },
+ "require-dev": {
+ "doctrine/annotations": "^2.0",
+ "nikic/php-parser": "^5.3.0",
+ "php-parallel-lint/php-parallel-lint": "^1.2",
+ "phpstan/extension-installer": "^1.0",
+ "phpstan/phpstan": "^2.0",
+ "phpstan/phpstan-phpunit": "^2.0",
+ "phpstan/phpstan-strict-rules": "^2.0",
+ "phpunit/phpunit": "^9.6",
+ "symfony/process": "^5.2"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "PHPStan\\PhpDocParser\\": [
+ "src/"
+ ]
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "PHPDoc parser with support for nullable, intersection and generic types",
+ "support": {
+ "issues": "https://github.com/phpstan/phpdoc-parser/issues",
+ "source": "https://github.com/phpstan/phpdoc-parser/tree/2.3.5"
+ },
+ "time": "2026-08-31T16:05:28+00:00"
+ },
{
"name": "phpunit/php-code-coverage",
"version": "7.0.17",
@@ -1517,28 +1660,98 @@
},
"time": "2022-12-20T10:26:07+00:00"
},
+ {
+ "name": "slevomat/coding-standard",
+ "version": "8.31.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/slevomat/coding-standard.git",
+ "reference": "0a40807a48873948bfa7ffce2a4e69ba40cf5e76"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/0a40807a48873948bfa7ffce2a4e69ba40cf5e76",
+ "reference": "0a40807a48873948bfa7ffce2a4e69ba40cf5e76",
+ "shasum": ""
+ },
+ "require": {
+ "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || ^1.2.1",
+ "php": "^7.4 || ^8.0",
+ "phpstan/phpdoc-parser": "^2.3.3",
+ "squizlabs/php_codesniffer": "^4.0.1"
+ },
+ "require-dev": {
+ "phing/phing": "3.0.1|3.1.2",
+ "php-parallel-lint/php-parallel-lint": "1.4.0",
+ "phpstan/phpstan": "2.2.7",
+ "phpstan/phpstan-deprecation-rules": "2.0.5",
+ "phpstan/phpstan-phpunit": "2.0.18",
+ "phpstan/phpstan-strict-rules": "2.0.12",
+ "phpunit/phpunit": "9.6.34|10.5.63|11.4.4|11.5.56|12.5.33"
+ },
+ "type": "phpcodesniffer-standard",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "8.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "SlevomatCodingStandard\\": "SlevomatCodingStandard/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.",
+ "keywords": [
+ "dev",
+ "phpcs"
+ ],
+ "support": {
+ "issues": "https://github.com/slevomat/coding-standard/issues",
+ "source": "https://github.com/slevomat/coding-standard/tree/8.31.1"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/kukulich",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/slevomat/coding-standard",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2026-07-31T10:42:43+00:00"
+ },
{
"name": "squizlabs/php_codesniffer",
- "version": "3.13.6",
+ "version": "4.0.4",
"source": {
"type": "git",
"url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git",
- "reference": "4c378e1a528ea066890fc2397cbdd2f94eb2fc91"
+ "reference": "bbdc3d0532623e21838b7041a4364383a8126f96"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/4c378e1a528ea066890fc2397cbdd2f94eb2fc91",
- "reference": "4c378e1a528ea066890fc2397cbdd2f94eb2fc91",
+ "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/bbdc3d0532623e21838b7041a4364383a8126f96",
+ "reference": "bbdc3d0532623e21838b7041a4364383a8126f96",
"shasum": ""
},
"require": {
+ "ext-libxml": "*",
"ext-simplexml": "*",
"ext-tokenizer": "*",
"ext-xmlwriter": "*",
- "php": ">=5.4.0"
+ "php": ">=7.2.0"
},
"require-dev": {
- "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4"
+ "phpunit/phpunit": "^8.4.0 || ^9.3.4 || ^10.5.32 || 11.3.3 - 11.5.28 || ^11.5.31"
+ },
+ "suggest": {
+ "ext-iconv": "For accurate character length calculation when the checked files contain multi-byte characters.",
+ "ext-pcntl": "For parallel processing support via the --parallel CLI option."
},
"bin": [
"bin/phpcbf",
@@ -1563,7 +1776,7 @@
"homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors"
}
],
- "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
+ "description": "PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.",
"homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer",
"keywords": [
"phpcs",
@@ -1594,20 +1807,20 @@
"type": "thanks_dev"
}
],
- "time": "2026-08-06T00:17:32+00:00"
+ "time": "2026-08-06T02:45:27+00:00"
},
{
"name": "tecnickcom/tcpdf",
- "version": "6.11.3",
+ "version": "6.11.4",
"source": {
"type": "git",
"url": "https://github.com/tecnickcom/TCPDF.git",
- "reference": "b18f6119161019916c5bb07cb8da5205ae5c1b63"
+ "reference": "fbbaf14cfae8fe646f154f7c530d15ec25764040"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/b18f6119161019916c5bb07cb8da5205ae5c1b63",
- "reference": "b18f6119161019916c5bb07cb8da5205ae5c1b63",
+ "url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/fbbaf14cfae8fe646f154f7c530d15ec25764040",
+ "reference": "fbbaf14cfae8fe646f154f7c530d15ec25764040",
"shasum": ""
},
"require": {
@@ -1618,7 +1831,7 @@
"ext-gd": "Enables additional image handling in some workflows.",
"ext-imagick": "Enables additional image format support when available.",
"ext-zlib": "Recommended for compressed streams and related features.",
- "tecnickcom/tc-lib-pdf": "Modern replacement for TCPDF for new projects."
+ "tecnickcom/tc-lib-pdf": "Modern replacement for TCPDF."
},
"type": "library",
"autoload": {
@@ -1650,7 +1863,7 @@
"role": "lead"
}
],
- "description": "Deprecated legacy PDF engine for PHP. For new projects use tecnickcom/tc-lib-pdf.",
+ "description": "Deprecated legacy PDF engine for PHP. Migrate to tecnickcom/tc-lib-pdf.",
"homepage": "https://tcpdf.org",
"keywords": [
"PDFD32000-2008",
@@ -1667,11 +1880,11 @@
},
"funding": [
{
- "url": "https://www.paypal.com/donate/?hosted_button_id=NZUEC5XS8MFBJ",
- "type": "paypal"
+ "url": "https://github.com/sponsors/tecnickcom",
+ "type": "github"
}
],
- "time": "2026-04-21T17:00:18+00:00"
+ "time": "2026-08-28T11:28:19+00:00"
},
{
"name": "theseer/tokenizer",
@@ -1730,7 +1943,7 @@
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
- "php": ">=7.2 <=8.5.99999",
+ "php": ">=7.2 <=8.6.99999",
"ext-zlib": "*"
},
"platform-dev": [],
diff --git a/phpcs.xml b/phpcs.xml
index 2beccd5..a366b22 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -14,4 +14,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/FpdfTplTrait.php b/src/FpdfTplTrait.php
index 772997a..41a7d02 100644
--- a/src/FpdfTplTrait.php
+++ b/src/FpdfTplTrait.php
@@ -107,7 +107,7 @@ public function useTemplate($tpl, $x = 0, $y = 0, $width = null, $height = null,
if (\is_array($x)) {
unset($x['tpl']);
- \extract($x, EXTR_IF_EXISTS);
+ \extract($x, \EXTR_IF_EXISTS);
/** @noinspection NotOptimalIfConditionsInspection */
/** @phpstan-ignore function.alreadyNarrowedType */
if (\is_array($x)) {
@@ -408,7 +408,7 @@ public function SetFontSize($size)
{
parent::SetFontSize($size);
if ($this->page === 0 && $this->currentTemplateId !== null) {
- $this->_out(sprintf('BT /F%d %.2F Tf ET', $this->CurrentFont['i'], $this->FontSizePt));
+ $this->_out(\sprintf('BT /F%d %.2F Tf ET', $this->CurrentFont['i'], $this->FontSizePt));
}
}
diff --git a/src/FpdfTrait.php b/src/FpdfTrait.php
index 090b5d5..f768c8f 100644
--- a/src/FpdfTrait.php
+++ b/src/FpdfTrait.php
@@ -14,7 +14,6 @@
use setasign\Fpdi\PdfParser\PdfParserException;
use setasign\Fpdi\PdfParser\Type\PdfIndirectObject;
use setasign\Fpdi\PdfParser\Type\PdfNull;
-use setasign\Fpdi\PdfParser\Type\PdfType;
/**
* This trait is used for the implementation of FPDI in FPDF and tFPDF.
@@ -139,7 +138,7 @@ protected function _putlinks($n)
$this->_newobj();
$rect = \sprintf('%.2F %.2F %.2F %.2F', $pl[0], $pl[1], $pl[0] + $pl[2], $pl[1] - $pl[3]);
$this->_put('<_put('/A <_escape($pl[4]) . ')>>');
$values = $pl['importedLink']['pdfObject']->value;
diff --git a/src/Fpdi.php b/src/Fpdi.php
index caf85bc..dec378b 100644
--- a/src/Fpdi.php
+++ b/src/Fpdi.php
@@ -10,11 +10,6 @@
namespace setasign\Fpdi;
-use setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException;
-use setasign\Fpdi\PdfParser\PdfParserException;
-use setasign\Fpdi\PdfParser\Type\PdfIndirectObject;
-use setasign\Fpdi\PdfParser\Type\PdfNull;
-
/**
* Class Fpdi
*
diff --git a/src/FpdiTrait.php b/src/FpdiTrait.php
index 7063535..cb72a73 100644
--- a/src/FpdiTrait.php
+++ b/src/FpdiTrait.php
@@ -98,7 +98,7 @@ trait FpdiTrait
*/
public function cleanUp($allReaders = false)
{
- $readers = $allReaders ? array_keys($this->readers) : $this->createdReaders;
+ $readers = $allReaders ? \array_keys($this->readers) : $this->createdReaders;
foreach ($readers as $id) {
$this->readers[$id]->getParser()->getStreamReader()->cleanUp();
unset($this->readers[$id]);
@@ -335,7 +335,7 @@ public function importPage(
if ($rotation !== 0) {
$rotation *= -1;
- $angle = $rotation * M_PI / 180;
+ $angle = $rotation * \M_PI / 180;
$a = \cos($angle);
$b = \sin($angle);
$c = -$b;
@@ -451,7 +451,7 @@ public function useImportedPage($pageId, $x = 0, $y = 0, $width = null, $height
if (\is_array($x)) {
/** @noinspection OffsetOperationsInspection */
unset($x['pageId']);
- \extract($x, EXTR_IF_EXISTS);
+ \extract($x, \EXTR_IF_EXISTS);
/** @noinspection NotOptimalIfConditionsInspection */
/** @phpstan-ignore function.alreadyNarrowedType */
if (\is_array($x)) {
@@ -489,7 +489,7 @@ public function useImportedPage($pageId, $x = 0, $y = 0, $width = null, $height
)
);
- if (count($importedPage['externalLinks']) > 0) {
+ if (\count($importedPage['externalLinks']) > 0) {
foreach ($importedPage['externalLinks'] as $externalLink) {
// mPDF uses also 'externalLinks' but doesn't come with a rect-value
if (!isset($externalLink['rect'])) {
diff --git a/src/PdfParser/CrossReference/LineReader.php b/src/PdfParser/CrossReference/LineReader.php
index bd18ea0..6d5ee2f 100644
--- a/src/PdfParser/CrossReference/LineReader.php
+++ b/src/PdfParser/CrossReference/LineReader.php
@@ -119,7 +119,7 @@ protected function read($xrefContent)
// can be reverted for php7.2
$differentLineEndings = \count(\array_count_values($m[0]));
if ($differentLineEndings > 1) {
- $lines = \preg_split("/(\r\n|\n|\r)/", $xrefContent, -1, PREG_SPLIT_NO_EMPTY);
+ $lines = \preg_split("/(\r\n|\n|\r)/", $xrefContent, -1, \PREG_SPLIT_NO_EMPTY);
} else {
$lines = \explode($m[0][0], $xrefContent);
}
diff --git a/src/PdfParser/Filter/Flate.php b/src/PdfParser/Filter/Flate.php
index 890b981..098be3b 100644
--- a/src/PdfParser/Filter/Flate.php
+++ b/src/PdfParser/Filter/Flate.php
@@ -42,21 +42,21 @@ public function decode($data)
$data = (($data !== '') ? @\gzuncompress($data) : '');
if ($data === false) {
// let's try if the checksum is CRC32
- $fh = fopen('php://temp', 'w+b');
- fwrite($fh, "\x1f\x8b\x08\x00\x00\x00\x00\x00" . $oData);
+ $fh = \fopen('php://temp', 'w+b');
+ \fwrite($fh, "\x1f\x8b\x08\x00\x00\x00\x00\x00" . $oData);
// "window" == 31 -> 16 + (8 to 15): Uses the low 4 bits of the value as the window size logarithm.
// The input must include a gzip header and trailer (via 16).
- stream_filter_append($fh, 'zlib.inflate', STREAM_FILTER_READ, ['window' => 31]);
- fseek($fh, 0);
- $data = @stream_get_contents($fh);
- fclose($fh);
+ \stream_filter_append($fh, 'zlib.inflate', \STREAM_FILTER_READ, ['window' => 31]);
+ \fseek($fh, 0);
+ $data = @\stream_get_contents($fh);
+ \fclose($fh);
if ($data) {
return $data;
}
// Try this fallback (remove the zlib stream header)
- $data = @(gzinflate(substr($oData, 2)));
+ $data = @(\gzinflate(\substr($oData, 2)));
if ($data === false) {
throw new FlateException(
diff --git a/src/PdfParser/PdfParser.php b/src/PdfParser/PdfParser.php
index 61fec51..724ceea 100644
--- a/src/PdfParser/PdfParser.php
+++ b/src/PdfParser/PdfParser.php
@@ -185,7 +185,7 @@ public function getPdfVersion()
'.',
PdfName::unescape(PdfType::resolve($catalog->value['Version'], $this)->value)
);
- if (count($versionParts) === 2) {
+ if (\count($versionParts) === 2) {
[$major, $minor] = $versionParts;
}
}
diff --git a/src/PdfParser/StreamReader.php b/src/PdfParser/StreamReader.php
index 9b847c3..1cb3e60 100644
--- a/src/PdfParser/StreamReader.php
+++ b/src/PdfParser/StreamReader.php
@@ -113,7 +113,7 @@ public function __construct($stream, $closeStream = false)
);
}
- if (fseek($stream, 0) === -1) {
+ if (\fseek($stream, 0) === -1) {
throw new \InvalidArgumentException(
'Given stream is not seekable!'
);
@@ -137,7 +137,7 @@ public function __destruct()
*/
public function cleanUp()
{
- if ($this->closeStream && is_resource($this->stream)) {
+ if ($this->closeStream && \is_resource($this->stream)) {
\fclose($this->stream);
}
}
diff --git a/src/PdfParser/Type/PdfStream.php b/src/PdfParser/Type/PdfStream.php
index 7c0d31e..aae1d90 100644
--- a/src/PdfParser/Type/PdfStream.php
+++ b/src/PdfParser/Type/PdfStream.php
@@ -144,13 +144,13 @@ public function getStream($cache = false)
$this->reader->reset($this->stream, $length->value);
$buffer = $this->reader->getBuffer(false);
if ($this->parser !== null) {
- $this->reader->reset($this->stream + strlen($buffer));
+ $this->reader->reset($this->stream + \strlen($buffer));
$this->parser->getTokenizer()->clearStack();
$token = $this->parser->readValue();
if (!($token instanceof PdfToken) || $token->value !== 'endstream') {
$this->reader->reset($this->stream, 100000);
$buffer = $this->extractStream();
- $this->reader->reset($this->stream + strlen($buffer));
+ $this->reader->reset($this->stream + \strlen($buffer));
}
}
}
diff --git a/src/PdfReader/PdfReader.php b/src/PdfReader/PdfReader.php
index 2af777f..eb742b4 100644
--- a/src/PdfReader/PdfReader.php
+++ b/src/PdfReader/PdfReader.php
@@ -244,7 +244,7 @@ protected function readPages($readAll = false)
}
// stop if all pages are read - faulty documents exists with additional entries with invalid data.
- if (count($this->pages) === $expectedPageCount) {
+ if (\count($this->pages) === $expectedPageCount) {
break;
}
}
diff --git a/src/Tcpdf/Fpdi.php b/src/Tcpdf/Fpdi.php
index 22a43c5..7dc36a7 100644
--- a/src/Tcpdf/Fpdi.php
+++ b/src/Tcpdf/Fpdi.php
@@ -333,7 +333,7 @@ protected function adjustLastLink($externalLink, $xPt, $scaleX, $yPt, $newHeight
case 'Border':
$borderArray = PdfArray::ensure($value)->value;
- if (count($borderArray) < 3) {
+ if (\count($borderArray) < 3) {
continue 2;
}
From 645ff501776e2d61a45380cfe1bbb29cca7cbc62 Mon Sep 17 00:00:00 2001
From: Maximilian Kresse <545671+MaximilianKresse@users.noreply.github.com>
Date: Tue, 1 Sep 2026 16:27:53 +0200
Subject: [PATCH 5/8] Moved phpcs to own composer.json
---
composer.json | 20 +-
composer.lock | 294 +--------------------------
phpcs.xml | 5 +-
vendor-bin/phpcs/composer.json | 26 +++
vendor-bin/phpcs/composer.lock | 355 +++++++++++++++++++++++++++++++++
5 files changed, 396 insertions(+), 304 deletions(-)
create mode 100644 vendor-bin/phpcs/composer.json
create mode 100644 vendor-bin/phpcs/composer.lock
diff --git a/composer.json b/composer.json
index 059b76d..ea88f40 100644
--- a/composer.json
+++ b/composer.json
@@ -40,9 +40,7 @@
"phpunit/phpunit": "^8.5.52",
"setasign/fpdf": "^1.9.0",
"tecnickcom/tcpdf": "^6.8",
- "setasign/tfpdf": "~1.33",
- "squizlabs/php_codesniffer": "^4.0",
- "slevomat/coding-standard": "^8.0"
+ "setasign/tfpdf": "~1.33"
},
"autoload-dev": {
"psr-4": {
@@ -51,13 +49,15 @@
},
"scripts": {
"all-tests": "@php vendor/bin/phpunit",
- "cs": "@php vendor/bin/phpcs",
+ "cs": "@php vendor-bin/phpcs/vendor/bin/phpcs",
- "cbf": "@php vendor/bin/phpcbf"
- },
- "config": {
- "allow-plugins": {
- "dealerdirect/phpcodesniffer-composer-installer": true
- }
+ "post-install-cmd": [
+ "@composer --working-dir=vendor-bin/phpcs install"
+ ],
+ "post-update-cmd": [
+ "@composer --working-dir=vendor-bin/phpcs update"
+ ],
+
+ "cbf": "@php vendor-bin/phpcs/vendor/bin/phpcbf"
}
}
diff --git a/composer.lock b/composer.lock
index e476674..085e3a3 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,105 +4,9 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "f416beab667b3a136350cd895533161d",
+ "content-hash": "4d8f27e888948d9e31ee8d2e13dca39a",
"packages": [],
"packages-dev": [
- {
- "name": "dealerdirect/phpcodesniffer-composer-installer",
- "version": "v1.2.1",
- "source": {
- "type": "git",
- "url": "https://github.com/PHPCSStandards/composer-installer.git",
- "reference": "963f0c67bffde0eac41b56be71ac0e8ba132f0bd"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/963f0c67bffde0eac41b56be71ac0e8ba132f0bd",
- "reference": "963f0c67bffde0eac41b56be71ac0e8ba132f0bd",
- "shasum": ""
- },
- "require": {
- "composer-plugin-api": "^2.2",
- "php": ">=5.4",
- "squizlabs/php_codesniffer": "^3.1.0 || ^4.0"
- },
- "require-dev": {
- "composer/composer": "^2.2",
- "ext-json": "*",
- "ext-zip": "*",
- "php-parallel-lint/php-parallel-lint": "^1.4.0",
- "phpcompatibility/php-compatibility": "^9.0 || ^10.0.0@dev",
- "yoast/phpunit-polyfills": "^1.0"
- },
- "type": "composer-plugin",
- "extra": {
- "class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin"
- },
- "autoload": {
- "psr-4": {
- "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Franck Nijhof",
- "email": "opensource@frenck.dev",
- "homepage": "https://frenck.dev",
- "role": "Open source developer"
- },
- {
- "name": "Contributors",
- "homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors"
- }
- ],
- "description": "PHP_CodeSniffer Standards Composer Installer Plugin",
- "keywords": [
- "PHPCodeSniffer",
- "PHP_CodeSniffer",
- "code quality",
- "codesniffer",
- "composer",
- "installer",
- "phpcbf",
- "phpcs",
- "plugin",
- "qa",
- "quality",
- "standard",
- "standards",
- "style guide",
- "stylecheck",
- "tests"
- ],
- "support": {
- "issues": "https://github.com/PHPCSStandards/composer-installer/issues",
- "security": "https://github.com/PHPCSStandards/composer-installer/security/policy",
- "source": "https://github.com/PHPCSStandards/composer-installer"
- },
- "funding": [
- {
- "url": "https://github.com/PHPCSStandards",
- "type": "github"
- },
- {
- "url": "https://github.com/jrfnl",
- "type": "github"
- },
- {
- "url": "https://opencollective.com/php_codesniffer",
- "type": "open_collective"
- },
- {
- "url": "https://thanks.dev/u/gh/phpcsstandards",
- "type": "thanks_dev"
- }
- ],
- "time": "2026-05-06T08:26:05+00:00"
- },
{
"name": "doctrine/instantiator",
"version": "1.5.0",
@@ -351,53 +255,6 @@
},
"time": "2022-02-21T01:04:05+00:00"
},
- {
- "name": "phpstan/phpdoc-parser",
- "version": "2.3.5",
- "source": {
- "type": "git",
- "url": "https://github.com/phpstan/phpdoc-parser.git",
- "reference": "148cefffaf0233e4c08cc13db8a195a56dd6dfe9"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/148cefffaf0233e4c08cc13db8a195a56dd6dfe9",
- "reference": "148cefffaf0233e4c08cc13db8a195a56dd6dfe9",
- "shasum": ""
- },
- "require": {
- "php": "^7.4 || ^8.0"
- },
- "require-dev": {
- "doctrine/annotations": "^2.0",
- "nikic/php-parser": "^5.3.0",
- "php-parallel-lint/php-parallel-lint": "^1.2",
- "phpstan/extension-installer": "^1.0",
- "phpstan/phpstan": "^2.0",
- "phpstan/phpstan-phpunit": "^2.0",
- "phpstan/phpstan-strict-rules": "^2.0",
- "phpunit/phpunit": "^9.6",
- "symfony/process": "^5.2"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "PHPStan\\PhpDocParser\\": [
- "src/"
- ]
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "description": "PHPDoc parser with support for nullable, intersection and generic types",
- "support": {
- "issues": "https://github.com/phpstan/phpdoc-parser/issues",
- "source": "https://github.com/phpstan/phpdoc-parser/tree/2.3.5"
- },
- "time": "2026-08-31T16:05:28+00:00"
- },
{
"name": "phpunit/php-code-coverage",
"version": "7.0.17",
@@ -1660,155 +1517,6 @@
},
"time": "2022-12-20T10:26:07+00:00"
},
- {
- "name": "slevomat/coding-standard",
- "version": "8.31.1",
- "source": {
- "type": "git",
- "url": "https://github.com/slevomat/coding-standard.git",
- "reference": "0a40807a48873948bfa7ffce2a4e69ba40cf5e76"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/0a40807a48873948bfa7ffce2a4e69ba40cf5e76",
- "reference": "0a40807a48873948bfa7ffce2a4e69ba40cf5e76",
- "shasum": ""
- },
- "require": {
- "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || ^1.2.1",
- "php": "^7.4 || ^8.0",
- "phpstan/phpdoc-parser": "^2.3.3",
- "squizlabs/php_codesniffer": "^4.0.1"
- },
- "require-dev": {
- "phing/phing": "3.0.1|3.1.2",
- "php-parallel-lint/php-parallel-lint": "1.4.0",
- "phpstan/phpstan": "2.2.7",
- "phpstan/phpstan-deprecation-rules": "2.0.5",
- "phpstan/phpstan-phpunit": "2.0.18",
- "phpstan/phpstan-strict-rules": "2.0.12",
- "phpunit/phpunit": "9.6.34|10.5.63|11.4.4|11.5.56|12.5.33"
- },
- "type": "phpcodesniffer-standard",
- "extra": {
- "branch-alias": {
- "dev-master": "8.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "SlevomatCodingStandard\\": "SlevomatCodingStandard/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.",
- "keywords": [
- "dev",
- "phpcs"
- ],
- "support": {
- "issues": "https://github.com/slevomat/coding-standard/issues",
- "source": "https://github.com/slevomat/coding-standard/tree/8.31.1"
- },
- "funding": [
- {
- "url": "https://github.com/kukulich",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/slevomat/coding-standard",
- "type": "tidelift"
- }
- ],
- "time": "2026-07-31T10:42:43+00:00"
- },
- {
- "name": "squizlabs/php_codesniffer",
- "version": "4.0.4",
- "source": {
- "type": "git",
- "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git",
- "reference": "bbdc3d0532623e21838b7041a4364383a8126f96"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/bbdc3d0532623e21838b7041a4364383a8126f96",
- "reference": "bbdc3d0532623e21838b7041a4364383a8126f96",
- "shasum": ""
- },
- "require": {
- "ext-libxml": "*",
- "ext-simplexml": "*",
- "ext-tokenizer": "*",
- "ext-xmlwriter": "*",
- "php": ">=7.2.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^8.4.0 || ^9.3.4 || ^10.5.32 || 11.3.3 - 11.5.28 || ^11.5.31"
- },
- "suggest": {
- "ext-iconv": "For accurate character length calculation when the checked files contain multi-byte characters.",
- "ext-pcntl": "For parallel processing support via the --parallel CLI option."
- },
- "bin": [
- "bin/phpcbf",
- "bin/phpcs"
- ],
- "type": "library",
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Greg Sherwood",
- "role": "Former lead"
- },
- {
- "name": "Juliette Reinders Folmer",
- "role": "Current lead"
- },
- {
- "name": "Contributors",
- "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors"
- }
- ],
- "description": "PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.",
- "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer",
- "keywords": [
- "phpcs",
- "standards",
- "static analysis"
- ],
- "support": {
- "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues",
- "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy",
- "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer",
- "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki"
- },
- "funding": [
- {
- "url": "https://github.com/PHPCSStandards",
- "type": "github"
- },
- {
- "url": "https://github.com/jrfnl",
- "type": "github"
- },
- {
- "url": "https://opencollective.com/php_codesniffer",
- "type": "open_collective"
- },
- {
- "url": "https://thanks.dev/u/gh/phpcsstandards",
- "type": "thanks_dev"
- }
- ],
- "time": "2026-08-06T02:45:27+00:00"
- },
{
"name": "tecnickcom/tcpdf",
"version": "6.11.4",
diff --git a/phpcs.xml b/phpcs.xml
index a366b22..2ba0b48 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -1,6 +1,6 @@
src
@@ -15,6 +15,9 @@
+
+
+
diff --git a/vendor-bin/phpcs/composer.json b/vendor-bin/phpcs/composer.json
new file mode 100644
index 0000000..d2754ee
--- /dev/null
+++ b/vendor-bin/phpcs/composer.json
@@ -0,0 +1,26 @@
+{
+ "require-dev": {
+ "squizlabs/php_codesniffer": "^4.0",
+ "slevomat/coding-standard": "~8.0",
+ "setasign/phpcs-teamcity-report": "^1.1"
+ },
+
+
+ "config": {
+ "process-timeout": 600,
+ "secure-http": false,
+ "platform": {
+ "php": "8.5.8"
+ },
+ "allow-plugins": {
+ "dealerdirect/phpcodesniffer-composer-installer": true
+ }
+ },
+
+ "repositories": [
+ {
+ "type": "composer",
+ "url": "http://satis.webproxy.internal.setasign.com/"
+ }
+ ]
+}
diff --git a/vendor-bin/phpcs/composer.lock b/vendor-bin/phpcs/composer.lock
new file mode 100644
index 0000000..cbc500a
--- /dev/null
+++ b/vendor-bin/phpcs/composer.lock
@@ -0,0 +1,355 @@
+{
+ "_readme": [
+ "This file locks the dependencies of your project to a known state",
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
+ "This file is @generated automatically"
+ ],
+ "content-hash": "9ff50e87a53e41e8dc7f5dd60d5e71c2",
+ "packages": [],
+ "packages-dev": [
+ {
+ "name": "dealerdirect/phpcodesniffer-composer-installer",
+ "version": "v1.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/PHPCSStandards/composer-installer.git",
+ "reference": "963f0c67bffde0eac41b56be71ac0e8ba132f0bd"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/963f0c67bffde0eac41b56be71ac0e8ba132f0bd",
+ "reference": "963f0c67bffde0eac41b56be71ac0e8ba132f0bd",
+ "shasum": ""
+ },
+ "require": {
+ "composer-plugin-api": "^2.2",
+ "php": ">=5.4",
+ "squizlabs/php_codesniffer": "^3.1.0 || ^4.0"
+ },
+ "require-dev": {
+ "composer/composer": "^2.2",
+ "ext-json": "*",
+ "ext-zip": "*",
+ "php-parallel-lint/php-parallel-lint": "^1.4.0",
+ "phpcompatibility/php-compatibility": "^9.0 || ^10.0.0@dev",
+ "yoast/phpunit-polyfills": "^1.0"
+ },
+ "type": "composer-plugin",
+ "extra": {
+ "class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin"
+ },
+ "autoload": {
+ "psr-4": {
+ "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Franck Nijhof",
+ "email": "opensource@frenck.dev",
+ "homepage": "https://frenck.dev",
+ "role": "Open source developer"
+ },
+ {
+ "name": "Contributors",
+ "homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors"
+ }
+ ],
+ "description": "PHP_CodeSniffer Standards Composer Installer Plugin",
+ "keywords": [
+ "PHPCodeSniffer",
+ "PHP_CodeSniffer",
+ "code quality",
+ "codesniffer",
+ "composer",
+ "installer",
+ "phpcbf",
+ "phpcs",
+ "plugin",
+ "qa",
+ "quality",
+ "standard",
+ "standards",
+ "style guide",
+ "stylecheck",
+ "tests"
+ ],
+ "support": {
+ "issues": "https://github.com/PHPCSStandards/composer-installer/issues",
+ "security": "https://github.com/PHPCSStandards/composer-installer/security/policy",
+ "source": "https://github.com/PHPCSStandards/composer-installer"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/PHPCSStandards",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/jrfnl",
+ "type": "github"
+ },
+ {
+ "url": "https://opencollective.com/php_codesniffer",
+ "type": "open_collective"
+ },
+ {
+ "url": "https://thanks.dev/u/gh/phpcsstandards",
+ "type": "thanks_dev"
+ }
+ ],
+ "time": "2026-05-06T08:26:05+00:00"
+ },
+ {
+ "name": "phpstan/phpdoc-parser",
+ "version": "2.3.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpstan/phpdoc-parser.git",
+ "reference": "148cefffaf0233e4c08cc13db8a195a56dd6dfe9"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/148cefffaf0233e4c08cc13db8a195a56dd6dfe9",
+ "reference": "148cefffaf0233e4c08cc13db8a195a56dd6dfe9",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.4 || ^8.0"
+ },
+ "require-dev": {
+ "doctrine/annotations": "^2.0",
+ "nikic/php-parser": "^5.3.0",
+ "php-parallel-lint/php-parallel-lint": "^1.2",
+ "phpstan/extension-installer": "^1.0",
+ "phpstan/phpstan": "^2.0",
+ "phpstan/phpstan-phpunit": "^2.0",
+ "phpstan/phpstan-strict-rules": "^2.0",
+ "phpunit/phpunit": "^9.6",
+ "symfony/process": "^5.2"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "PHPStan\\PhpDocParser\\": [
+ "src/"
+ ]
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "PHPDoc parser with support for nullable, intersection and generic types",
+ "support": {
+ "issues": "https://github.com/phpstan/phpdoc-parser/issues",
+ "source": "https://github.com/phpstan/phpdoc-parser/tree/2.3.5"
+ },
+ "time": "2026-08-31T16:05:28+00:00"
+ },
+ {
+ "name": "setasign/phpcs-teamcity-report",
+ "version": "v1.1.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/Setasign/phpcs-teamcity-report.git",
+ "reference": "22322dc171076fc82f6c2f335403bb3eb4fa1be3"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/Setasign/phpcs-teamcity-report/zipball/22322dc171076fc82f6c2f335403bb3eb4fa1be3",
+ "reference": "22322dc171076fc82f6c2f335403bb3eb4fa1be3",
+ "shasum": ""
+ },
+ "require": {
+ "ext-mbstring": "*",
+ "php": ">=7.2",
+ "squizlabs/php_codesniffer": "4.*"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "setasign\\PhpcsTeamcityReport\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Setasign",
+ "email": "support@setasign.com"
+ }
+ ],
+ "support": {
+ "issues": "https://github.com/Setasign/phpcs-teamcity-report/issues",
+ "source": "https://github.com/Setasign/phpcs-teamcity-report/tree/v1.1.1"
+ },
+ "time": "2026-08-31T09:20:23+00:00"
+ },
+ {
+ "name": "slevomat/coding-standard",
+ "version": "8.31.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/slevomat/coding-standard.git",
+ "reference": "0a40807a48873948bfa7ffce2a4e69ba40cf5e76"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/0a40807a48873948bfa7ffce2a4e69ba40cf5e76",
+ "reference": "0a40807a48873948bfa7ffce2a4e69ba40cf5e76",
+ "shasum": ""
+ },
+ "require": {
+ "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || ^1.2.1",
+ "php": "^7.4 || ^8.0",
+ "phpstan/phpdoc-parser": "^2.3.3",
+ "squizlabs/php_codesniffer": "^4.0.1"
+ },
+ "require-dev": {
+ "phing/phing": "3.0.1|3.1.2",
+ "php-parallel-lint/php-parallel-lint": "1.4.0",
+ "phpstan/phpstan": "2.2.7",
+ "phpstan/phpstan-deprecation-rules": "2.0.5",
+ "phpstan/phpstan-phpunit": "2.0.18",
+ "phpstan/phpstan-strict-rules": "2.0.12",
+ "phpunit/phpunit": "9.6.34|10.5.63|11.4.4|11.5.56|12.5.33"
+ },
+ "type": "phpcodesniffer-standard",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "8.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "SlevomatCodingStandard\\": "SlevomatCodingStandard/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.",
+ "keywords": [
+ "dev",
+ "phpcs"
+ ],
+ "support": {
+ "issues": "https://github.com/slevomat/coding-standard/issues",
+ "source": "https://github.com/slevomat/coding-standard/tree/8.31.1"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/kukulich",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/slevomat/coding-standard",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2026-07-31T10:42:43+00:00"
+ },
+ {
+ "name": "squizlabs/php_codesniffer",
+ "version": "4.0.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git",
+ "reference": "bbdc3d0532623e21838b7041a4364383a8126f96"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/bbdc3d0532623e21838b7041a4364383a8126f96",
+ "reference": "bbdc3d0532623e21838b7041a4364383a8126f96",
+ "shasum": ""
+ },
+ "require": {
+ "ext-libxml": "*",
+ "ext-simplexml": "*",
+ "ext-tokenizer": "*",
+ "ext-xmlwriter": "*",
+ "php": ">=7.2.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^8.4.0 || ^9.3.4 || ^10.5.32 || 11.3.3 - 11.5.28 || ^11.5.31"
+ },
+ "suggest": {
+ "ext-iconv": "For accurate character length calculation when the checked files contain multi-byte characters.",
+ "ext-pcntl": "For parallel processing support via the --parallel CLI option."
+ },
+ "bin": [
+ "bin/phpcbf",
+ "bin/phpcs"
+ ],
+ "type": "library",
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Greg Sherwood",
+ "role": "Former lead"
+ },
+ {
+ "name": "Juliette Reinders Folmer",
+ "role": "Current lead"
+ },
+ {
+ "name": "Contributors",
+ "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors"
+ }
+ ],
+ "description": "PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.",
+ "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer",
+ "keywords": [
+ "phpcs",
+ "standards",
+ "static analysis"
+ ],
+ "support": {
+ "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues",
+ "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy",
+ "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer",
+ "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/PHPCSStandards",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/jrfnl",
+ "type": "github"
+ },
+ {
+ "url": "https://opencollective.com/php_codesniffer",
+ "type": "open_collective"
+ },
+ {
+ "url": "https://thanks.dev/u/gh/phpcsstandards",
+ "type": "thanks_dev"
+ }
+ ],
+ "time": "2026-08-06T02:45:27+00:00"
+ }
+ ],
+ "aliases": [],
+ "minimum-stability": "stable",
+ "stability-flags": [],
+ "prefer-stable": false,
+ "prefer-lowest": false,
+ "platform": [],
+ "platform-dev": [],
+ "platform-overrides": {
+ "php": "8.5.8"
+ },
+ "plugin-api-version": "2.2.0"
+}
From 6eef38372b1f09df80d39aa8525aed22e2265c6b Mon Sep 17 00:00:00 2001
From: Maximilian Kresse <545671+MaximilianKresse@users.noreply.github.com>
Date: Tue, 1 Sep 2026 16:31:50 +0200
Subject: [PATCH 6/8] Moved phpstan to own composer.json
---
composer.json | 7 ++-
vendor-bin/phpstan/composer.json | 11 ++++
vendor-bin/phpstan/composer.lock | 86 ++++++++++++++++++++++++++++++++
3 files changed, 102 insertions(+), 2 deletions(-)
create mode 100644 vendor-bin/phpstan/composer.json
create mode 100644 vendor-bin/phpstan/composer.lock
diff --git a/composer.json b/composer.json
index ea88f40..ab0b598 100644
--- a/composer.json
+++ b/composer.json
@@ -50,12 +50,15 @@
"scripts": {
"all-tests": "@php vendor/bin/phpunit",
"cs": "@php vendor-bin/phpcs/vendor/bin/phpcs",
+ "phpstan": "@php vendor-bin/phpstan/vendor/bin/phpstan analyse",
"post-install-cmd": [
- "@composer --working-dir=vendor-bin/phpcs install"
+ "@composer --working-dir=vendor-bin/phpcs install",
+ "@composer --working-dir=vendor-bin/phpstan install"
],
"post-update-cmd": [
- "@composer --working-dir=vendor-bin/phpcs update"
+ "@composer --working-dir=vendor-bin/phpcs update",
+ "@composer --working-dir=vendor-bin/phpstan update"
],
"cbf": "@php vendor-bin/phpcs/vendor/bin/phpcbf"
diff --git a/vendor-bin/phpstan/composer.json b/vendor-bin/phpstan/composer.json
new file mode 100644
index 0000000..3dfd4e3
--- /dev/null
+++ b/vendor-bin/phpstan/composer.json
@@ -0,0 +1,11 @@
+{
+ "require-dev": {
+ "phpstan/phpstan": "^2.1"
+ },
+
+ "config": {
+ "platform": {
+ "php": "8.5.8"
+ }
+ }
+}
diff --git a/vendor-bin/phpstan/composer.lock b/vendor-bin/phpstan/composer.lock
new file mode 100644
index 0000000..378ac0c
--- /dev/null
+++ b/vendor-bin/phpstan/composer.lock
@@ -0,0 +1,86 @@
+{
+ "_readme": [
+ "This file locks the dependencies of your project to a known state",
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
+ "This file is @generated automatically"
+ ],
+ "content-hash": "c9de1068b633305329235a1a3fa436e5",
+ "packages": [],
+ "packages-dev": [
+ {
+ "name": "phpstan/phpstan",
+ "version": "2.2.12",
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/174b0d88710f00a42598886504dd7a146f91ace5",
+ "reference": "174b0d88710f00a42598886504dd7a146f91ace5",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.4|^8.0"
+ },
+ "conflict": {
+ "phpstan/phpstan-shim": "*"
+ },
+ "bin": [
+ "phpstan",
+ "phpstan.phar"
+ ],
+ "type": "library",
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Ondřej Mirtes"
+ },
+ {
+ "name": "Markus Staab"
+ },
+ {
+ "name": "Vincent Langlet"
+ }
+ ],
+ "description": "PHPStan - PHP Static Analysis Tool",
+ "keywords": [
+ "dev",
+ "static analysis"
+ ],
+ "support": {
+ "docs": "https://phpstan.org/user-guide/getting-started",
+ "forum": "https://github.com/phpstan/phpstan/discussions",
+ "issues": "https://github.com/phpstan/phpstan/issues",
+ "security": "https://github.com/phpstan/phpstan/security/policy",
+ "source": "https://github.com/phpstan/phpstan-src"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/ondrejmirtes",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/phpstan",
+ "type": "github"
+ }
+ ],
+ "time": "2026-08-31T19:09:43+00:00"
+ }
+ ],
+ "aliases": [],
+ "minimum-stability": "stable",
+ "stability-flags": [],
+ "prefer-stable": false,
+ "prefer-lowest": false,
+ "platform": [],
+ "platform-dev": [],
+ "platform-overrides": {
+ "php": "8.5.8"
+ },
+ "plugin-api-version": "2.2.0"
+}
From df8dd1edc4cf089c925200fa3e615febabebe707 Mon Sep 17 00:00:00 2001
From: Maximilian Kresse <545671+MaximilianKresse@users.noreply.github.com>
Date: Tue, 1 Sep 2026 16:33:59 +0200
Subject: [PATCH 7/8] Updated code style actions
---
.github/workflows/code-style.yml | 9 ++++-----
phpstan.neon | 2 ++
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/code-style.yml b/.github/workflows/code-style.yml
index 67bf8a4..70951b9 100644
--- a/.github/workflows/code-style.yml
+++ b/.github/workflows/code-style.yml
@@ -19,13 +19,13 @@ jobs:
- name: Install php
uses: shivammathur/setup-php@v2
with:
- php-version: "7.2"
+ php-version: "8.5"
- name: Install dependencies
run: composer update --dev --no-interaction --prefer-dist --no-progress --no-suggest --ansi
- name: Run phpcs
- run: ./vendor/bin/phpcs -q --report=checkstyle src
+ run: ./vendor-bin/phpcs/vendor/bin/phpcs -q --report=checkstyle src
phpstan:
name: phpstan
@@ -39,11 +39,10 @@ jobs:
- name: Install php
uses: shivammathur/setup-php@v2
with:
- php-version: "7.4"
- tools: phpstan
+ php-version: "8.5"
- name: Install dependencies
run: composer update --dev --no-interaction --prefer-dist --no-progress --no-suggest --ansi
- name: Run phpstan
- run: phpstan analyse --no-progress
\ No newline at end of file
+ run: ./vendor-bin/phpstan/vendor/bin/phpstan analyse --no-progress
\ No newline at end of file
diff --git a/phpstan.neon b/phpstan.neon
index e602b7c..c4ca42e 100644
--- a/phpstan.neon
+++ b/phpstan.neon
@@ -6,6 +6,8 @@ parameters:
#- tests
ignoreErrors:
+ -
+ identifier: unset.possiblyHookedProperty
-
message: "#^Method setasign\\\\Fpdi\\\\Fpdi\\:\\:getPdfParserInstance\\(\\) has invalid return type setasign\\\\FpdiPdfParser\\\\PdfParser\\\\PdfParser\\.$#"
count: 1
From 3393eae003b38ab6b01b371b2df93d895e6e5ca2 Mon Sep 17 00:00:00 2001
From: Maximilian Kresse <545671+MaximilianKresse@users.noreply.github.com>
Date: Tue, 1 Sep 2026 16:39:14 +0200
Subject: [PATCH 8/8] Fixed phpcs
---
vendor-bin/phpcs/composer.json | 9 +--------
vendor-bin/phpcs/composer.lock | 2 +-
2 files changed, 2 insertions(+), 9 deletions(-)
diff --git a/vendor-bin/phpcs/composer.json b/vendor-bin/phpcs/composer.json
index d2754ee..3963d78 100644
--- a/vendor-bin/phpcs/composer.json
+++ b/vendor-bin/phpcs/composer.json
@@ -15,12 +15,5 @@
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
- },
-
- "repositories": [
- {
- "type": "composer",
- "url": "http://satis.webproxy.internal.setasign.com/"
- }
- ]
+ }
}
diff --git a/vendor-bin/phpcs/composer.lock b/vendor-bin/phpcs/composer.lock
index cbc500a..4cd7eed 100644
--- a/vendor-bin/phpcs/composer.lock
+++ b/vendor-bin/phpcs/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "9ff50e87a53e41e8dc7f5dd60d5e71c2",
+ "content-hash": "aea56402af63176e1260b59199dcfb0b",
"packages": [],
"packages-dev": [
{