Next major version 2 with PHP 8.1, Symfony 6, Tabler UI, 2FA ... (#2902)

This commit is contained in:
Kevin Papst
2022-12-31 21:19:55 +01:00
committed by GitHub
parent 95e06746bd
commit 90a0fd8a22
2164 changed files with 83700 additions and 86426 deletions

38
src/Pdf/PdfContext.php Normal file
View File

@@ -0,0 +1,38 @@
<?php
/*
* This file is part of the Kimai time-tracking app.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Pdf;
/**
* A simple class that is available in PDF-Renderer context,
* which can be used to define global renderer options.
*/
final class PdfContext
{
private array $options = [];
public function setOption(string $key, string|array|null|bool $value): void
{
$this->options[$key] = $value;
}
public function getOptions(): array
{
return $this->options;
}
public function getOption(string $key): array|string|null
{
if (\array_key_exists($key, $this->options)) {
return $this->options[$key];
}
return null;
}
}