[FEATURE] ilCtrl: add support for PSR-4 compliant filenames.
Hi all,
This PR fixes an issue that prevents GUI-classes to have PSR-4 compliant filenames. The PSR-4 specifies that "The terminating class name corresponds to a file name ending in .php. The file name MUST match the case of the terminating class name".
Until now, ilCtrl only considered GUI-classes whose filenames matched the pattern class.il<class-name>GUI.php. This change removes this restriction entirely and only considers GUI-classes that implement the new ilCtrlCommandClass interface. In bab9cf708b85256a78a1d53ee287c3b5e84786d6 I added this interface to all GUI-classes which have previously been considered a GUI-class by ilCtrl and were stored in the according build-artifact. Using rector, I iterated the artifact and made all these classes implement the new interface. The changes will therefore integrate seamlessly. This is however still a breaking-change for plugin developers, which will have to implement the ilCtrlCommandClass interface for ILIAS>=11 as well.
Furthermore I noticed that the \ILIAS\Setup\ImplementationOfInterfaceFinder has been using \ReflectionClass::isInstantiable(), which only returns true if the constructor of a class is public. I stumbled over this because ILIAS still uses singletons to this day, also for some GUI-classes. This is why in 05998baf56389a695e2a8f0693dcc280d8304c69 I implemented a fix, so the finder now considers singletons without public constructor as well. This may have some effect on other places where this finder is being used.
The actual changes for adding support to ilCtrl for PSR-4 compliant filenames and dropping the filename requirements can be found in bf8dca5e989247caacc7e4283763f37ac27aeb07.
Kind regards, @thibsy
Jour Fixe, 23 JUN 2025: Thibeau briefly presented the PR at the Jour Fixe. As it is currently still being discussed with Richard, a final decision is not yet possible. If there are any questions about the PR, please post them here.