Skip to content

Commit

Permalink
Internal changes in PdfDocument and PdfViewerPreferences classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentmuller committed Aug 19, 2024
1 parent cc4e2e0 commit 86143c3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- Internal changes in `PdfDocument` and `PdfViewerPreferences` classes.
- Added `SymfonyInsight` quality check tool, configuration and badge.
- Added descriptions to `PdfBlendMode` enumeration.
- Minor changes in tutorials.
Expand Down
6 changes: 3 additions & 3 deletions src/PdfDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -563,17 +563,17 @@ public function cell(
$border ??= PdfBorder::none();
if ($fill || $border->isAll()) {
if ($fill) {
$op = $border->isAll() ? 'B' : 'f';
$style = $border->isAll() ? PdfRectangleStyle::BOTH : PdfRectangleStyle::FILL;
} else {
$op = 'S';
$style = PdfRectangleStyle::BORDER;
}
$output .= \sprintf(
'%.2F %.2F %.2F %.2F re %s ',
$this->x * $scaleFactor,
($this->height - $this->y) * $scaleFactor,
$width * $scaleFactor,
-$height * $scaleFactor,
$op
$style->value
);
}
if ('' === $output && $border->isAny()) {
Expand Down
6 changes: 3 additions & 3 deletions src/PdfViewerPreferences.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,11 @@ private function getOutputBool(bool $value, string $key): string
}

/**
* @phpstan-template T of \BackedEnum&PdfEnumDefaultInterface
* @phpstan-template T of PdfEnumDefaultInterface&\BackedEnum
*
* @phpstan-param (T&PdfEnumDefaultInterface<T>) $enum
* @phpstan-param PdfEnumDefaultInterface<T>&\BackedEnum $enum
*/
private function getOutputEnum(\BackedEnum&PdfEnumDefaultInterface $enum, string $key): string
private function getOutputEnum(PdfEnumDefaultInterface $enum, string $key): string
{
return $enum->isDefault() ? '' : \sprintf('/%s %s', $key, $enum->value);
}
Expand Down

0 comments on commit 86143c3

Please sign in to comment.