Page MenuHomeDevCentral

Get class name with or without namespace
ClosedPublic

Authored by dereckson on Jun 30 2023, 21:49.
Tags
None
Referenced Files
F19063957: D3215.id8233.diff
Tue, Dec 23, 08:10
F19063849: D3215.id8236.diff
Tue, Dec 23, 08:08
F19029892: D3215.id8235.diff
Tue, Dec 23, 02:03
Unknown Object (File)
Mon, Dec 22, 10:04
Unknown Object (File)
Mon, Dec 22, 10:04
Unknown Object (File)
Mon, Dec 22, 04:21
Unknown Object (File)
Sun, Dec 21, 18:37
Unknown Object (File)
Sun, Dec 21, 13:54
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