Skip to content

3.4.0

Compare
Choose a tag to compare
@Ocramius Ocramius released this 22 Apr 19:16
3.4.0
68f10dc

Build Status

This release drops support for PHP 7.1 and introduces major performance improvements
when inspecting sources of projects that use composer.json as main dependency tracking
mechanism.

Specifically, following utilities have been introduced to aid in inspecting project
sources:

  • Roave\BetterReflection\SourceLocator\Type\Composer\Factory\MakeLocatorForComposerJsonAndInstalledJson - if
    you need to inspect project and dependencies
  • Roave\BetterReflection\SourceLocator\Type\Composer\Factory\MakeLocatorForComposerJson - if you only want to
    inspect project sources
  • Roave\BetterReflection\SourceLocator\Type\Composer\Factory\MakeLocatorForInstalledJson - if you only want
    to inspect project dependencies

To use them, please follow the usage documentation examples, such as following:

<?php

use Roave\BetterReflection\BetterReflection;
use Roave\BetterReflection\Reflector\ClassReflector;
use Roave\BetterReflection\SourceLocator\Type\AggregateSourceLocator;
use Roave\BetterReflection\SourceLocator\Type\PhpInternalSourceLocator;
use Roave\BetterReflection\SourceLocator\Type\Composer\Factory\MakeLocatorForComposerJsonAndInstalledJson;

$astLocator = (new BetterReflection())->astLocator();
$reflector  = new ClassReflector(new AggregateSourceLocator([
    (new MakeLocatorForComposerJsonAndInstalledJson)('path/to/the/project', $astLocator),
    new PhpInternalSourceLocator($astLocator)
]));

$classes = $reflector->getAllClasses();

Total issues resolved: 4