Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Use static function to call internal function

Instead of doing this

  $p = new PurchasePodcast;

This feels better

class PurchasePodcast
  public static function perform()
    return (new static)->handle();
  private function handle()
    // ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment