Page MenuHomeDevCentral

Allow to discover classes in a PSR-4 folder
ClosedPublic

Authored by dereckson on Feb 10 2022, 00:48.
Tags
None
Referenced Files
F18486094: D2507.id6325.diff
Fri, Dec 19, 13:49
Unknown Object (File)
Thu, Dec 18, 00:38
Unknown Object (File)
Thu, Dec 18, 00:01
Unknown Object (File)
Wed, Dec 17, 18:30
Unknown Object (File)
Tue, Dec 16, 04:34
Unknown Object (File)
Sun, Dec 14, 00:15
Unknown Object (File)
Fri, Dec 12, 14:32
Unknown Object (File)
Sat, Dec 6, 13:24
Subscribers
None

Details

Summary

Use case:

Some components need to perform actions on a series of classes,
for example an events systems needs to load events listeners classes,
a service container needs to load provider classes to built it,
or Zed needs to load health checks.

There are two strategies for that:

  • define classes names manually in a configuration array
  • discover classes names in a specific folder

This change allows to ease the discover method, returning an array
of fully qualified class names for a specific folder and prefix,
using PSR-4 convention.

Ref T1678.

Test Plan

Unit tests provided.

Tested in Zed to generate a site health report with rKHEALTH.
Checks are detected through PSR4Namespace::discoverAllClasses.

Diff Detail

Repository
rKOT Keruald OmniTools
Lint
Lint Not Applicable
Unit
Tests Not Applicable