Skip to content

Address issues reported by phpstan #133

Open

Description

@bsweeney

phpstan reports the same warnings with both 8 and 9. They should probably be fixed regardless. The signatures are the same, so I imagine they are compatible.

I'm hesitant to fix these, though, because you're still supporting PHP 7.1, and maintaining compatibility with that is awkward. If yo ever release a new version, I'd recommend rector and updating to only supported versions of php.

Very low priority, I just noticed the new version of that library.

phpstan analyze src
29/29 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%


Line Svg/Style.php


89 Method Svg\Style::fromAttributes() should return Svg\Style but return statement is missing.
🪪 return.missing
91 Method Svg\Style::fromAttributes() should return Svg\Style but return statement is missing.
🪪 return.missing



Line Svg/Surface/CPdf.php


1109 Undefined variable: $object
🪪 variable.undefined
1111 Undefined variable: $object
🪪 variable.undefined
3624 Call to vsprintf contains 3 placeholders, 4 values given.
🪪 argument.vsprintf
3663 Call to vsprintf contains 3 placeholders, 4 values given.
🪪 argument.vsprintf



Line Svg/Surface/SurfaceCpdf.php


220 Call to an undefined method Svg\Surface\SurfaceCpdf::_convert_gif_bmp_to_png().
🪪 method.notFound


Originally posted by @tacman in #132 (comment)

Activity

  1. added this to the 1.0.1 milestone on Aug 21, 2025
  2. changed the title [-]phpstan reports the same warnings with both 8 and 9. They should probably be fixed regardless. The signatures are the same, so I imagine they are compatible.[/-] [+]Address issues reported by phpstan[/+] on Aug 21, 2025
  3. williamdes commented on Sep 18, 2025

    @williamdes
    Contributor

    Curiously _convert_gif_bmp_to_png does not exist for us, but some users seems to have it: https://github.com/search?q=%22_convert_gif_bmp_to_png%22&type=code

  4. williamdes commented on Sep 18, 2025

    @williamdes
    Contributor

    Aha, it was renamed from _convert_gif_bmp_to_png to _convert_to_png in dompdf/dompdf@beb8984

  5. williamdes commented on Sep 18, 2025

    @williamdes
    Contributor

    Svg/Surface/CPdf.php
    Line 1109 Undefined variable: $object
    Line 1111 Undefined variable: $object

    @bsweeney you should look into this as it seems you changed the nearby code in the recent years

  6. bsweeney commented on Sep 23, 2025

    @bsweeney
    MemberAuthor

    I'll review differences between the Dompdf and SvgLib versions for the next release. Thanks for your efforts.

  7. modified the milestones: 1.0.1, 1.0.2 on Jan 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions