diff --git a/CHANGELOG.md b/CHANGELOG.md index eb0e8d2..db0d0fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/src/PdfDocument.php b/src/PdfDocument.php index 1b67893..d909dc6 100644 --- a/src/PdfDocument.php +++ b/src/PdfDocument.php @@ -563,9 +563,9 @@ 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 ', @@ -573,7 +573,7 @@ public function cell( ($this->height - $this->y) * $scaleFactor, $width * $scaleFactor, -$height * $scaleFactor, - $op + $style->value ); } if ('' === $output && $border->isAny()) { diff --git a/src/PdfViewerPreferences.php b/src/PdfViewerPreferences.php index ed8d42b..822a35d 100644 --- a/src/PdfViewerPreferences.php +++ b/src/PdfViewerPreferences.php @@ -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) $enum + * @phpstan-param PdfEnumDefaultInterface&\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); }