dispify/class_aliases

The function for getting class aliases

1.0.0 2020-08-30 11:23 UTC

This package is auto-updated.

Last update: 2024-06-29 05:12:31 UTC


README

Build Status codecov GitHub license

Packagist PHP Version Support

class_aliases

There is a class_parents, class_uses, class_implements function in the PHP. PHP allows to declare aliases of class but there is no class_aliases function which returns all aliases for specified class name. This library adds this functionality.

Getting Started

$ composer require dispify/class_aliases
class A {}
class_alias(A::class, 'Alias');

Dispify\class_aliases(A::class); // returns ['alias']

⚠️ The class is created by class_alias is lowercased!