Skip to content

Is Imagick::destroy() deprecated or not? Documentation vs. Implementation discrepancy #757

@castor4bit

Description

@castor4bit

Description

I noticed an inconsistency between the documentation and the actual implementation regarding the Imagick::destroy() method, and I wanted to ask the community about the intended direction.

Current Situation

  • The documentation states that Imagick::destroy() is deprecated and recommends using clear() instead
  • However, in the actual codebase, destroy() appears to be simply defined as an alias to clear() without any deprecation markers
  • This same pattern exists for similar classes like ImagickDraw and ImagickPixel

My Question

I'm wondering what the intended direction is for these methods:

  1. If deprecation is intended, would it make sense to add proper deprecation markers in the code (e.g., using IMAGICK_METHOD_DEPRECATED_USE_INSTEAD) to match the documentation?
  2. Or, if there's no strong intent to deprecate them, would it be appropriate to update the documentation to simply note they're aliases rather than deprecated methods?

I personally find the destroy() method name clear and intuitive, and since it's just an alias with no functional issues, I'm inclined to think updating the documentation might be simpler. But I'm new to contributing here and would love to hear the community's thoughts and understand the historical context better.

If there's consensus on a direction, I'd be happy to help with a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions