Commit e6fc19a5 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Fixes PHP 8.4

parent 624da7f4
Loading
Loading
Loading
Loading
Loading
+1 −1
Changes for src/UnicaenPdf/Exporter/ExporterInterface.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -14,5 +14,5 @@ interface ExporterInterface
    /**
     * @param string|null $filename
     */
    public function export(string $filename = null);
    public function export(?string $filename = null);
}
 No newline at end of file
+9 −9
Changes for src/UnicaenPdf/Exporter/PdfExporter.php: 9 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -162,7 +162,7 @@ class PdfExporter implements ExporterInterface
     * @param integer $defaultFontSize false: portrait, true: paysage
     */
    public function __construct(
        PhpRenderer $renderer = null,
        ?PhpRenderer $renderer = null,
        string      $format = 'A4',
        bool        $orientationPaysage = false,
        int         $defaultFontSize = 10)
@@ -189,7 +189,7 @@ class PdfExporter implements ExporterInterface
     * @param string|null $oddOrEven 'O', 'E' ou null
     * @return self
     */
    public function setHeaderScript(string $script = null, string $oddOrEven = null, array $scriptVars = []): self
    public function setHeaderScript(?string $script = null, ?string $oddOrEven = null, array $scriptVars = []): self
    {
        if (!$script) {
            $this->headerScripts = [];
@@ -245,7 +245,7 @@ class PdfExporter implements ExporterInterface
     * @param int|null $resetPageNum A combien doit-on recommencer la numérotation des pages ?
     * @return self
     */
    public function addBodyScript(string $script, bool $newPage = true, array $scriptVars = [], int $resetPageNum = null): self
    public function addBodyScript(string $script, bool $newPage = true, array $scriptVars = [], ?int $resetPageNum = null): self
    {
        $key = uniqid();

@@ -266,7 +266,7 @@ class PdfExporter implements ExporterInterface
     * @param int|null $resetPageNum A combien doit-on recommencer la numérotation des pages ?
     * @return self
     */
    public function addBodyHtml(string $html, bool $newPage = true, int $resetPageNum = null): self
    public function addBodyHtml(string $html, bool $newPage = true, ?int $resetPageNum = null): self
    {
        $key = uniqid();

@@ -283,7 +283,7 @@ class PdfExporter implements ExporterInterface
     * @param string|null $oddOrEven 'O' (pages impaires seulement), 'E' (pages paires seulement) ou null (pages paires et impaires)
     * @return self
     */
    public function setFooterScript(string $script = null, string $oddOrEven = null, array $scriptVars =[]): self
    public function setFooterScript(?string $script = null, ?string $oddOrEven = null, array $scriptVars =[]): self
    {
        if (!$script) {
            $this->footerScripts = [];
@@ -399,7 +399,7 @@ class PdfExporter implements ExporterInterface
     *
     * @throws \Mpdf\MpdfException
     */
    public function export(string $filename = null, string $destination = PdfExporter::DESTINATION_BROWSER, string $memoryLimit = null)
    public function export(?string $filename = null, string $destination = PdfExporter::DESTINATION_BROWSER, ?string $memoryLimit = null)
    {
        if (!$filename) {
            throw new LogicException("Aucun nom de fichier spécifié.");
@@ -858,7 +858,7 @@ class PdfExporter implements ExporterInterface
     * @param string|null $headerTitle
     * @return self
     */
    public function setHeaderTitle(string $headerTitle = null): self
    public function setHeaderTitle(?string $headerTitle = null): self
    {
        $this->headerTitle = $headerTitle;
        return $this;
@@ -870,7 +870,7 @@ class PdfExporter implements ExporterInterface
     * @param string|null $headerSubtitle
     * @return self
     */
    public function setHeaderSubTitle(string $headerSubtitle = null): self
    public function setHeaderSubTitle(?string $headerSubtitle = null): self
    {
        $this->headerSubtitle = $headerSubtitle;
        return $this;
@@ -882,7 +882,7 @@ class PdfExporter implements ExporterInterface
     * @param string|null $footerTitle
     * @return self
     */
    public function setFooterTitle(string $footerTitle = null): self
    public function setFooterTitle(?string $footerTitle = null): self
    {
        $this->footerTitle = $footerTitle;
        return $this;