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
F24517375: D2507.id6324.diff
Tue, Feb 24, 21:14
F24517265: D2507.id6324.diff
Tue, Feb 24, 21:07
F24506780: D2507.diff
Tue, Feb 24, 05:45
F24506688: D2507.diff
Tue, Feb 24, 05:40
F24505710: D2507.id6325.diff
Tue, Feb 24, 04:28
Unknown Object (File)
Wed, Feb 18, 19:37
Unknown Object (File)
Tue, Feb 17, 09:47
Unknown Object (File)
Thu, Feb 12, 14:02
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 Passed
Unit
Tests Passed
Branch
feature/psr4-discover
Build Status
Buildable 3913
Build 4164: arc lint + arc unit