<?php

class アニマルガール
{

    protected $stack = [];

    private final function __construct()
    {}

    public static function サンドスター()
    {
        $class_path = get_called_class();
        return new $class_path();
    }

    public static function __callStatic($method, $arguments)
    {
        return ($instance ?? $instance = static::サンドスター())->$method();
    }

    public function __call($method, $arguments)
    {
        if (in_array($method, ['わーい', 'すごーい', 'たのしー'], true)) {
            $this->stack[] = $method;
        } else {
            $this->stack[] = sprintf('君は%sがとくいなフレンズなんだね！！', $method);
            echo implode(\PHP_EOL, $this->stack), \PHP_EOL;
        }
        return $this;
    }
}

アニマルガール::わーい()->すごーい()->たのしー()->クソリプ();
