Answers for "anonymous classes"

0

anonymous classes

return new class($controller) implements Page {
    public function __construct($controller) {
        /* ... */
    }
    /* ... */
};

class MyObject extends MyStuff {
    public function getInterface() {
        return new class implements MyInterface {
            /* ... */
        };
    }
}
Posted by: Guest on June-22-2021

Browse Popular Code Answers by Language