Skip to content

Commit

Permalink
Merge branch 'release/1.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
endelwar committed Oct 7, 2023
2 parents 50545f8 + dfb5168 commit 7a2eacb
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These are supported funding model platforms

github: [endelwar]
ko_fi: endelwar
12 changes: 10 additions & 2 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,23 @@
;

return (new PhpCsFixer\Config())
->setFinder($finder)
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'array_syntax' => ['syntax' => 'short'],
'concat_space' => ['spacing' => 'one'],
'cast_spaces' => ['space' => 'none'],
'native_function_invocation' => false,
'types_spaces' => ['space' => 'none'],
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true],
'phpdoc_to_comment' => false,
'fopen_flags' => ['b_mode' => true],
'native_function_invocation' => ['include' => ['@all']],
'function_declaration' => ['closure_function_spacing' => 'none', 'closure_fn_spacing' => 'none'],
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
'keep_multiple_spaces_after_comma' => false,
],
])
->setFinder($finder)
;
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ and this project adheres to [Semantic Versioning(https://semver.org/spec/v2.0.0.

## Unreleased

## 1.3.0 - 2023-10-07
### Added
- Support WeasyPrint 60.0 new option

## 1.2.0 - 2023-05-11
### Added
- Support WeasyPrint 59.0b1 new option
- Support WeasyPrint 59.0b1 new options

## 1.1.1 - 2023-04-27
### Security
Expand Down
2 changes: 1 addition & 1 deletion src/AbstractGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ protected function checkOutput(string $output, string $command): void
protected function checkProcessStatus(?int $status, string $stdout, string $stderr, string $command): void
{
if (null === $status) {
throw new \RuntimeException(sprintf('The command is not terminated.' . "\n" . 'stderr: "%s"' . "\n" . 'stdout: "%s"' . "\n" . 'command: %s', $stderr, $stdout, $command));
throw new \RuntimeException(\sprintf('The command is not terminated.' . "\n" . 'stderr: "%s"' . "\n" . 'stdout: "%s"' . "\n" . 'command: %s', $stderr, $stdout, $command));
}

if (0 !== $status && '' !== $stderr) {
Expand Down
5 changes: 3 additions & 2 deletions src/Pdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected function handleOptions(array $options = []): array

if ('attachment' === $option || 'stylesheet' === $option) {
$handledOption = $this->handleArrayOptions($option, $value);
if (count($handledOption) > 0) {
if (\count($handledOption) > 0) {
$options[$option] = $handledOption;
}
}
Expand All @@ -66,7 +66,7 @@ protected function handleOptions(array $options = []): array
*/
private function handleArrayOptions(string $option, $value): array
{
if (!is_array($value)) {
if (!\is_array($value)) {
$value = [$value];
}

Expand Down Expand Up @@ -120,6 +120,7 @@ protected function configure(): void
'jpeg-quality' => null, // added in WeasyPrint 59.0b1
'optimize-images' => null, // no longer deprecated in WeasyPrint 59.0b1
'cache-folder' => null, // added in WeasyPrint 59.0b1
'timeout' => null, // added in WeasyPrint 60.0
// Deprecated
'format' => null, // deprecated in WeasyPrint 53.0b2
'resolution' => null, // deprecated - png only
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/AbstractGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ private function getPHPExecutableFromPath(): ?string

/**
* test against CVE-2023-28115
* fix and test by @AntoineLelaisant
* fix and test by @AntoineLelaisant.
*/
public function testFailingGenerateWithOutputContainingPharPrefix(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/PdfTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected function tearDown(): void

$htmlFiles = new \CallbackFilterIterator(
new \DirectoryIterator(__DIR__),
function ($filename) {
function($filename) {
return 1 === \preg_match('/\.html$/', $filename);
}
);
Expand Down

0 comments on commit 7a2eacb

Please sign in to comment.