Page MenuHomeDevCentral

Get class name with or without namespace
ClosedPublic

Authored by dereckson on Jun 30 2023, 21:49.
Tags
None
Referenced Files
F3324757: D3215.id8233.diff
Mon, Jul 8, 05:30
F3324742: D3215.id8232.diff
Mon, Jul 8, 05:23
F3324257: D3215.id8232.diff
Mon, Jul 8, 03:20
F3323832: D3215.id8236.diff
Mon, Jul 8, 01:59
F3323831: D3215.id.diff
Mon, Jul 8, 01:59
Unknown Object (File)
Sun, Jul 7, 12:18
Unknown Object (File)
Sun, Jul 7, 09:01
Unknown Object (File)
Sun, Jul 7, 08:16
Subscribers
None

Details

Summary
  • CodeClass::getClassName allows to get class name with namespace
  • CodeClass::getShortClassName returns only the class name
Test Plan

This is used in Zed for XmlDocument serialization:

$key = CodeClass::from($value)->getShortClassName();

Unit tests provided.

Diff Detail

Repository
rKERUALD Keruald libraries development repository
Lint
Lint Warnings
SeverityLocationCodeMessage
Warningomnitools/tests/Reflection/CodeClassTest.php:27PHPCS.W.Generic.Files.LineLength.TooLongGeneric.Files.LineLength.TooLong
Warningomnitools/tests/Reflection/CodeClassTest.php:31PHPCS.W.Generic.Files.LineLength.TooLongGeneric.Files.LineLength.TooLong
Unit
Tests Passed
Branch
codeclass
Build Status
Buildable 5066
Build 5347: arc lint + arc unit

Event Timeline

dereckson created this revision.

Remove from static constructor

This revision is now accepted and ready to land.Jun 30 2023, 21:53