JakubMisek Yeap, it's more correct. But I thought that keys-of should show keys of accociative array.
But how would one implement the method-of functionality? Coz it's not provided by phpDocumentator and similar tools.
Anyway, I hope for the functionality that can override returning type, so I can create constuction like this:
<?php
/**
* Abstract controller class
*/
abstract class Controller {
/**
* Get URI for given controller's method name
* @param method-of<static> $methodName
* @return void
*/
public static function methodURL(string $methodName) {
/* it's should be to returns /some-page/some-page-action or /some-page/another-page-action */
}
}
/**
* Controller of /some-page. Including action handlers `somePageAction` and `anotherPageAction`
*/
class SomePageController extends Controller {
public function get_somePageAction() {
/* ... */
}
public function post_anotherPageAction() {
/* ... */
}
}