2017 © Pedro Peláez
 

library element-reflection

Parses PHP code to class, constant, property and method elements reflections.

image

apigen/element-reflection

Parses PHP code to class, constant, property and method elements reflections.

  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Element Reflection

Build Status Quality Score Code Coverage Downloads this Month Latest stable, (*1)

This package scans PHP source and creates Reflection for every class, function, constant, property, method and parameter element found., (*2)

Installation

Ad dependency via composer:, (*3)

composer require apigen/element-reflection

Register extension in your config.neon:, (*4)

extensions:
    - ApiGen\ElementReflection\DI\ElementReflectionExtension

Usage

<?php

namespace ApiGen\ElementReflection;

use ApiGen\ElementReflection\Storage\MemoryStorage;

// parse source dir
$parser = new Parser(new MemoryStorage);
$storage = $parser->processDirectory(__DIR__ . '/vendor/doctrine');

$class = $storage->getClass('Doctrine\ORM\EntityManager'); // instance of ApiGen\ElementReflection\Reflection\ClassReflection
$class = $storage->getClass('Exception');    // instance of ApiGen\ElementReflection\Php\ClassReflection

$function = $storage->getFunction(...); // instance of ApiGen\ElementReflection\PhpParser\FunctionReflection
$constant = $storage->getConstant(...); // instance of ApiGen\ElementReflection\PhpParser\ConstantReflection

Particular Reflections

  • FunctionReflection
  • ConstantReflection
  • ClassReflection
  • ClassConstantReflection
  • PropertyReflection
  • MethodReflection
  • ParameterReflection

Internal Elements - ApiGen\ElementReflection\Php\*

When you ask the Broker for an internal element e.g. Zip or Phar, it returns a ApiGen\ElementReflection\Php\Reflection* that encapsulates the internal reflection functionality and adds our features., (*5)

The Versions