Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ indent_style = tab
indent_size = tab
tab_width = 4

[{*.json, *.yaml, *.yml, *.md}]
[*.{json,yaml,yml,md}]
indent_style = space
indent_size = 2
9 changes: 8 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
.docs export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
tests/ export-ignore
.travis.yml export-ignore
Makefile export-ignore
README.md export-ignore
phpstan.neon export-ignore
ruleset.xml export-ignore
tests export-ignore
10 changes: 0 additions & 10 deletions .github/.kodiak.toml

This file was deleted.

5 changes: 4 additions & 1 deletion .github/workflows/codesniffer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: "Codesniffer"

on:
pull_request:
workflow_dispatch:

push:
branches: ["*"]
Expand All @@ -12,4 +13,6 @@ on:
jobs:
codesniffer:
name: "Codesniffer"
uses: contributte/.github/.github/workflows/codesniffer.yml@v1
uses: contributte/.github/.github/workflows/codesniffer.yml@master
with:
php: "8.4"
7 changes: 5 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ name: "Coverage"

on:
pull_request:
workflow_dispatch:

push:
branches: ["*"]

schedule:
- cron: "0 8 * * 1"
- cron: "0 9 * * 1"

jobs:
coverage:
name: "Nette Tester"
uses: contributte/.github/.github/workflows/nette-tester-coverage.yml@v1
uses: contributte/.github/.github/workflows/nette-tester-coverage-v2.yml@master
with:
php: "8.4"
7 changes: 5 additions & 2 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ name: "Phpstan"

on:
pull_request:
workflow_dispatch:

push:
branches: ["*"]

schedule:
- cron: "0 8 * * 1"
- cron: "0 10 * * 1"

jobs:
phpstan:
name: "Phpstan"
uses: contributte/.github/.github/workflows/phpstan.yml@v1
uses: contributte/.github/.github/workflows/phpstan.yml@master
with:
php: "8.4"
31 changes: 22 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,42 @@ name: "Nette Tester"

on:
pull_request:
workflow_dispatch:

push:
branches: ["*"]

schedule:
- cron: "0 8 * * 1"
- cron: "0 10 * * 1"

jobs:
test82:
test85:
name: "Nette Tester"
uses: contributte/.github/.github/workflows/nette-tester.yml@v1
uses: contributte/.github/.github/workflows/nette-tester.yml@master
with:
php: "8.2"
php: "8.5"

test84:
name: "Nette Tester"
uses: contributte/.github/.github/workflows/nette-tester.yml@master
with:
php: "8.4"

test81:
test83:
name: "Nette Tester"
uses: contributte/.github/.github/workflows/nette-tester.yml@v1
uses: contributte/.github/.github/workflows/nette-tester.yml@master
with:
php: "8.1"
php: "8.3"

test82:
name: "Nette Tester"
uses: contributte/.github/.github/workflows/nette-tester.yml@master
with:
php: "8.2"

testlowest:
name: "Nette Tester"
uses: contributte/.github/.github/workflows/nette-tester.yml@v1
uses: contributte/.github/.github/workflows/nette-tester.yml@master
with:
php: "8.1"
php: "8.2"
composer: "composer update --no-interaction --no-progress --prefer-dist --prefer-stable --prefer-lowest"
16 changes: 13 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
/vendor/
/.idea/
# IDE
/.idea

# Composer
/vendor
/composer.lock
*.iml

# Tests
/tests/tmp
/coverage.*
/tests/**/*.log
/tests/**/*.html
/tests/**/*.expected
/tests/**/*.actual
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
.PHONY: install qa cs csf phpstan tests coverage

.PHONY: install
install:
composer update

.PHONY: qa
qa: phpstan cs

.PHONY: cs
cs:
ifdef GITHUB_ACTION
vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 --extensions="php,phpt" --colors -nsp -q --report=checkstyle src tests | cs2pr
else
vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 --extensions="php,phpt" --colors -nsp src tests
endif

.PHONY: csf
csf:
vendor/bin/phpcbf --standard=ruleset.xml --encoding=utf-8 --colors -nsp src tests
vendor/bin/phpcbf --standard=ruleset.xml --encoding=utf-8 --extensions="php,phpt" --colors -nsp src tests

.PHONY: phpstan
phpstan:
vendor/bin/phpstan analyse -c phpstan.neon

.PHONY: tests
tests:
vendor/bin/tester -s -p php --colors 1 -C tests/Cases

.PHONY: coverage
coverage:
ifdef GITHUB_ACTION
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage coverage.xml --coverage-src src tests/Cases
Expand Down
13 changes: 9 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@
}
],
"require": {
"php": ">=8.1",
"php": ">=8.2",
"mpdf/mpdf": "^8.1.0",
"nette/application": "^3.1.0",
"nette/http": "^3.2.0"
},
"require-dev": {
"contributte/phpstan": "^0.2.0",
"contributte/qa": "^0.4.0",
"contributte/tester": "^0.3.0",
"nette/di": "^3.1.2",
"contributte/qa": "^0.4",
"contributte/tester": "^0.3",
"contributte/phpstan": "^0.1",
"symfony/css-selector": "^6.3.0",
"symfony/dom-crawler": "^6.3.0"
},
Expand All @@ -58,6 +58,11 @@
"Contributte\\PdfResponse\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
Expand Down
7 changes: 1 addition & 6 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ includes:

parameters:
level: 9
phpVersion: 80100
phpVersion: 80200

scanDirectories:
- src
Expand All @@ -14,8 +14,3 @@ parameters:
paths:
- src
- .docs

excludePaths:
- src/DI/SentryExtension24.php

ignoreErrors:
2 changes: 1 addition & 1 deletion ruleset.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<ruleset>
<rule ref="./vendor/contributte/qa/ruleset.xml">
<rule ref="./vendor/contributte/qa/ruleset-8.2.xml">
<exclude name="Generic.NamingConventions.CamelCapsFunctionName.ScopeNotCamelCaps"/>
</rule>

Expand Down
7 changes: 3 additions & 4 deletions src/PdfResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* @link http://addons.nette.org/cs/pdfresponse2
* @property string $saveMode
* @property string $pageOrientation
* @property string|array $pageFormat
* @property string|array<mixed> $pageFormat
* @property string $pageMargins
* @property string $documentAuthor
* @property string $documentTitle
Expand Down Expand Up @@ -104,7 +104,7 @@ class PdfResponse implements Response

private bool $multiLanguage = false;

/** @var bool, REQUIRES symfony/dom-crawler package */
/** @var bool REQUIRES symfony/dom-crawler package */
private bool $ignoreStylesInHTMLDocument = false;

private string|Template $source;
Expand Down Expand Up @@ -502,8 +502,7 @@ private function build(): Mpdf

if ($this->source instanceof Template) {
try {
/** @noinspection PhpMethodParametersCountMismatchInspection */
$html = $this->source->__toString(true);
$html = $this->source->__toString();
} catch (Throwable $e) {
throw new InvalidStateException('Template rendering failed', 0, $e);
}
Expand Down
4 changes: 0 additions & 4 deletions tests/.coveralls.yml

This file was deleted.