PHP code example of darling / php-reflection-utilities
1. Go to this page and download the library: Download darling/php-reflection-utilities library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
darling / php-reflection-utilities example snippets
composer
Darling\PHPReflectionUtilities\classes\utilities\Reflection;
use \Darling\PHPTextTypes\classes\strings\ClassString;
$reflection = new Reflection(new ClassString(Reflection::class));
var_dump($reflection->type()->__toString());
var_dump($reflection->methodNames(Reflection::IS_PUBLIC));
var_dump($reflection->methodParameterNames('methodParameterNames'));
var_dump($reflection->methodParameterTypes('methodParameterTypes'));
var_dump($reflection->propertyNames(Reflection::IS_PRIVATE));
var_dump($reflection->propertyTypes(Reflection::IS_PRIVATE));
var_dump($reflection->type());
Darling\PHPReflectionUtilities\classes\utilities\ObjectReflection;
$instanceToReflect = new ArrayIterator(array('test1', 'test2', 'test3'));
$objectReflection = new ObjectReflection($instanceToReflect);
var_dump($objectReflection->propertyValues());
var_dump($objectReflection->methodNames());