HomeDevCentral

Allow to discover classes in a PSR-4 folder

Description

Allow to discover classes in a PSR-4 folder

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.

Reviewers: dereckson

Reviewed By: dereckson

Maniphest Tasks: T1678

Differential Revision: https://devcentral.nasqueron.org/D2507

Details

Provenance
derecksonAuthored on Feb 8 2022, 02:00
derecksonPushed on Feb 19 2022, 22:15
Parents
rKERUALDfa1c68f22e5b: Refresh collections
Branches
Unknown
Tags
Unknown
References
tag: omnitools/0.7.0

Event Timeline