Simple reflection helper for PHP.
You can install the package via composer:
composer require nabeghe/reflecty
use Nabeghe\Reflecty\Reflecty;
class Animal
{
}
class Lion extends Animal
{
}
class Cat extends Lion
{
}
print_r(Reflecty::classAncestors(Cat::class));
/*
Array
(
[0] => Lion
[1] => Animal
)
*/
Copyright (c) Hadi Akbarzadeh
Licensed under the MIT license, see LICENSE.md for details.