Skip to content

Proposal: Create static methods for easier usage when formatting #169

@deanc

Description

@deanc

It's a little inconvenient having to instantiate an object to call methods for formatting each time, particularly for colours. The existing API is:

$climate = new \League\CLImate\CLImate;
$climate->red('Whoa now this text is red.');

I propose adding some static utility methods to make usage easier and more concise, especially as there's not a great need for state.

CLImate::redStatic('Whoa now this text is red.');

Method name can adjusted, of course, but I guess it's important to maintain backwards compatibility so it can't just be ::red

I don't mind working on this if a PR would be accepted.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions