Skip to content

Extensibility issues #231

@schlessera

Description

@schlessera

We're using this library in wp-cli/i18n-command as the new basis to improve the translations build step for WordPress Core.

To extend it so that it does what we need, we need to jump through some hoops in various places of the code, because extensibility is made difficult by a few practices like ignoring late static binding or directly instantiating specific classes within a big chunk of logic.

Would you be open to a pull request that (in a generally backwards compatible way) improves extensibility across the board?

This would allow us to make the changes we need without copy-pasting big chunks of code and needing to keep them in sync.

The main changes I would like to introduce are:

  • For non-final classes, default to static instead of self (late static binding) => this allows for all the code to properly support any extensions down the line.
  • For instantiations of classes, extract the actual classes either into a method/constant that can be overridden, or a factory

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions