PHP code example of webservco / reflection

1. Go to this page and download the library: Download webservco/reflection 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/ */

    

webservco / reflection example snippets


use WebServCo\Reflection\Factory\ReflectionClassFactory;
use WebServCo\Reflection\Service\ReflectionService;

// \WebServCo\Reflection\Contract\ReflectionServiceInterface
$reflectionService = new ReflectionService(new ReflectionClassFactory());

// Type of the second constructor parameter. Indexes start at 1.
$type = $reflectionService->getConstructorParameterTypeAtIndex(TestController::class, 2);

// \ReflectionClass
$reflectionClass = $reflectionService->getReflectionClass(TestController::class);