Skip to content

Commit 4d0e62b

Browse files
committed
Maintenance
1 parent aaf5138 commit 4d0e62b

File tree

12 files changed

+58
-45
lines changed

12 files changed

+58
-45
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ trim_trailing_whitespace = true
1111

1212
[*.yml]
1313
indent_size = 2
14+
15+
[*.neon]
16+
indent_style = tab

.github/codecov:.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
codecov:
2+
require_ci_to_pass: no
3+
4+
coverage:
5+
range: "90...100"
6+
7+
comment: false

.github/workflows/ci.yml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,14 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
php-version: ['8.1', '8.2']
21-
prefer-lowest: ['']
20+
php-version: ['8.1', '8.2', '8.3']
21+
dependencies: ['highest']
2222
include:
23+
- php-version: '8.4'
24+
dependencies: 'highest'
25+
composer-options: '--ignore-platform-req=php'
2326
- php-version: '8.1'
24-
prefer-lowest: 'prefer-lowest'
27+
dependencies: 'lowest'
2528

2629
steps:
2730
- uses: actions/checkout@v4
@@ -42,27 +45,27 @@ jobs:
4245
wkhtmltopdf --version
4346
4447
- name: Composer install
45-
run: |
46-
if ${{ matrix.prefer-lowest == 'prefer-lowest' }}; then
47-
composer update --prefer-lowest --prefer-stable
48-
else
49-
composer install
50-
fi
48+
uses: ramsey/composer-install@v3
49+
with:
50+
dependency-versions: ${{ matrix.dependencies }}
51+
composer-options: ${{ matrix.composer-options }}
5152

5253
- name: Setup problem matchers for PHPUnit
5354
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
5455

5556
- name: Run PHPUnit
5657
run: |
57-
if [[ ${{ matrix.php-version }} == '8.1' ]]; then
58-
vendor/bin/phpunit --coverage-clover=coverage.xml
58+
if [[ ${{ matrix.php-version }} == '8.3' ]]; then
59+
vendor/bin/phpunit --display-warnings --display-deprecations --display-incomplete --display-skipped --coverage-clover=coverage.xml
5960
else
60-
vendor/bin/phpunit
61+
vendor/bin/phpunit --display-warnings --display-deprecations
6162
fi
6263
6364
- name: Code Coverage Report
64-
if: matrix.php-version == '8.1'
65-
uses: codecov/codecov-action@v3
65+
if: matrix.php-version == '8.3'
66+
uses: codecov/codecov-action@v4
67+
env:
68+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
6669

6770
cs-stan:
6871
uses: cakephp/.github/.github/workflows/[email protected]

.phive/phars.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phive xmlns="https://phar.io/phive">
3-
<phar name="phpstan" version="1.10.37" installed="1.10.37" location="./tools/phpstan" copy="false"/>
4-
<phar name="psalm" version="5.15.0" installed="5.15.0" location="./tools/psalm" copy="false"/>
3+
<phar name="phpstan" version="2.0.1" installed="2.0.1" location="./tools/phpstan" copy="false"/>
4+
<phar name="psalm" version="5.26.1" installed="5.26.1" location="./tools/psalm" copy="false"/>
55
</phive>

phpstan.neon

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
parameters:
2-
level: 6
3-
checkMissingIterableValueType: false
4-
bootstrapFiles:
5-
- vendor/cakephp/cakephp/src/Core/Exception/CakeException.php
6-
- tests/bootstrap.php
7-
paths:
8-
- src
2+
level: 8
3+
bootstrapFiles:
4+
- vendor/cakephp/cakephp/src/Core/Exception/CakeException.php
5+
- tests/bootstrap.php
6+
paths:
7+
- src
8+
ignoreErrors:
9+
-
10+
identifier: missingType.iterableValue

psalm-baseline.xml

Lines changed: 0 additions & 11 deletions
This file was deleted.

psalm.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
66
xmlns="https://getpsalm.org/schema/config"
77
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
8-
errorBaseline="psalm-baseline.xml"
8+
findUnusedBaselineEntry="true"
9+
findUnusedCode="false"
910
>
1011
<projectFiles>
1112
<directory name="src" />
@@ -32,5 +33,6 @@
3233
<RedundantConditionGivenDocblockType errorLevel="info" />
3334

3435
<UnsafeInstantiation errorLevel="info" />
36+
<RiskyTruthyFalsyComparison errorLevel="info" />
3537
</issueHandlers>
3638
</psalm>

src/Pdf/CakePdf.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,6 @@ public function write(string $destination, bool $create = true, ?string $html =
349349
}
350350

351351
$splFileInfo = $fileInfo->getPathInfo();
352-
/** @phpstan-ignore-next-line */
353352
if ($splFileInfo === null) {
354353
throw new CakeException('Failed to retrieve path information');
355354
}
@@ -378,7 +377,6 @@ public function engine(array|string|null $name = null): ?AbstractPdfEngine
378377
$name = $name['className'];
379378
}
380379

381-
/** @var class-string<\CakePdf\Pdf\Engine\AbstractPdfEngine>|null $engineClassName */
382380
$engineClassName = App::className($name, 'Pdf/Engine', 'Engine');
383381
if ($engineClassName === null) {
384382
throw new CakeException(sprintf('Pdf engine "%s" not found', $name));
@@ -580,10 +578,10 @@ public function margin(
580578
$right = $left;
581579
}
582580

583-
$this->marginBottom($bottom);
584-
$this->marginLeft($left);
585-
$this->marginRight($right);
586-
$this->marginTop($top);
581+
$this->marginBottom($bottom); // @phpstan-ignore argument.type
582+
$this->marginLeft($left); // @phpstan-ignore argument.type
583+
$this->marginRight($right); // @phpstan-ignore argument.type
584+
$this->marginTop($top); // @phpstan-ignore argument.type
587585

588586
return $this;
589587
}

src/Pdf/Crypto/PdftkCrypto.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ public function encrypt(string $data): string
8484
];
8585

8686
$prochandle = proc_open($command, $descriptorspec, $pipes);
87+
if ($prochandle === false) {
88+
throw new CakeException('Unable to execute pdftk, proc_open() failed');
89+
}
8790

8891
fwrite($pipes[0], $data);
8992
fclose($pipes[0]);

src/Pdf/Engine/TexToPdfEngine.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ protected function _exec(string $cmd, string $input): array
102102
$result = ['stdout' => '', 'stderr' => '', 'return' => ''];
103103

104104
$proc = proc_open($cmd, [0 => ['pipe', 'r'], 1 => ['pipe', 'w'], 2 => ['pipe', 'w']], $pipes);
105+
if ($proc === false) {
106+
throw new CakeException('Unable to execute latexpdf, proc_open() failed');
107+
}
108+
105109
fwrite($pipes[0], $input);
106110
fclose($pipes[0]);
107111

0 commit comments

Comments
 (0)