PHP Classes
elePHPant
Icontem

File: vendor/phpdocumentor/type-resolver/examples/06-discovering-the-context-using-file-contents.php

Recommend this page to a friend!
  Classes of Renato De Oliveira Lucena  >  PHP Pokemon Script  >  vendor/phpdocumentor/type-resolver/examples/06-discovering-the-context-using-file-contents.php  >  Download  
File: vendor/phpdocumentor/type-resolver/examples/06-discovering-the-context-using-file-contents.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Pokemon Script
Provides an API to manage a database of Pokemons
Author: By
Last change:
Date: 1 year ago
Size: 746 bytes
 

Contents

Class file image Download
<?php

use phpDocumentor\Reflection\FqsenResolver;
use
phpDocumentor\Reflection\TypeResolver;
use
phpDocumentor\Reflection\Types\ContextFactory;

require
'../vendor/autoload.php';

$typeResolver = new TypeResolver();
$fqsenResolver = new FqsenResolver();

$contextFactory = new ContextFactory();
$context = $contextFactory->createForNamespace('My\Example', file_get_contents('Classy.php'));

// Class named: \phpDocumentor\Reflection\Types\Resolver
var_dump((string)$typeResolver->resolve('Types\Resolver', $context));

// String
var_dump((string)$typeResolver->resolve('string', $context));

// Property named: \phpDocumentor\Reflection\Types\Resolver::$keyWords
var_dump((string)$fqsenResolver->resolve('Types\Resolver::$keyWords', $context));