Reflect 3.0.0-beta-3 has just been released.
News :
Old
plantUML:run
command was migrated in two new API methods/commands :In a quick look you can see what is in scope of package and what it isn’tIt’s extensible to other graphic engine (like GraphViz), but required to implement new processors with interfaceBartlett\Reflect\Api\V3\Diagram\ProcessorInterface
. E.g:Bartlett\Reflect\Api\V3\Diagram\PlantUmlProcessor
The Migration Guide to v3 is now available.
Bugs :
fix missing output in CLI (Linux OS). Thanks to Remi Collet (see commit b56ba62)
Published by Laurent Laville on 2015-02-26Download :
Reflect 3.0.0-beta-2 has just been released.
Changes :
CacheAwareEventDispatcher
replacedEventDispatcher
to improve memory usage by removingast
data for all listener except the CachePlugin.
ast
data onphpreflect.success
event is transmitted un-serialized now. Serialization is proceed on CachePlugin.
phpdocumentor/reflection-docblock
dependency was upgraded to version 2.0.4 to include the LICENSE file, in phar distribution.
xdebug.max_nesting_level
ini option was removed. See RFC to learn more.The Developer Guide is now available.
Published by Laurent Laville on 2015-02-19Download :
Reflect 3.0.0-beta-1 has just been released.
3.0.0-beta1 is final milestone of API 3.0
We have reached a point where API is stabilized and is ready for a release candidate.
Like
composer
, Reflect has adopted an ascii text logo._ ____ __ _ _ _ __ | |__ _ __ | _ \ ___ / _| | ___ ___| |_ | '_ \| '_ \| '_ \| |_) / _ \ |_| |/ _ \/ __| __| | |_) | | | | |_) | _ < __/ _| | __/ (__| |_ | .__/|_| |_| .__/|_| \_\___|_| |_|\___|\___|\__| |_| |_|Generator is online at http://patorjk.com/software/taag/#p=display&f=Standard&t=phpReflect
Add a new component, the
NotifierPlugin
that allow to be notified at end of a long parsing process.Actually only a
Growl
notifier is provided (by PEAR/Net_Growl 2.7 package), but your are free to make your own.Specific code remaining
Collection\ReferenceCollection
to CompatInfo have been transfered to this project.Removed setter
Reflect::setPluginManager()
, and getterReflect::getPluginManager()
, no more used.Added a new class
Reflect\Util
on code refactoring, to remove dupplicated code about time formatted to display.A bit of color to make the phar manifest more readable.
Updated php min version required (5.3.2) due to usage of
stream_resolve_include_path
(see PR#17)Ensures that there will be no errors when traversing highly nested node trees (E.g : https://github.com/phpmd/phpmd/blob/master/src/test/resources/files/Regression/24975295/testLocalVariableUsedInDoubleQuoteStringGetsNotReported.php). See commit [defded5]9eb8eab6fb02475970745529bbf8f51a1
A new file queue strategy was applied to detect conditional code. Used only by CompatInfo and its
compatibility
analyser. See php-compatinfo GH-160 issue.Published by Laurent Laville on 2015-02-03Download :
Reflect 3.0.0-beta-1 preview.
While 3.0.0-beta1 was initially planned on
2015-01-30
(see roadmap), it’s now ready to be released on February 3rd 2015.With Symfony Console verbosity level 3, you will print the raw API response rather than the console view report. Easy to debug and compare.
Example 1: Compare analyser run process (with a single analyser)
CLI$ php bin\phpreflect -vvv analyser:run ../srcPHP<?php require_once dirname(__DIR__) . '/vendor/autoload.php'; use Bartlett\Reflect\Client; // creates an instance of client $client = new Client(); // request for a Bartlett\Reflect\Api\Analyser $api = $client->api('analyser'); // perform request, on a data source with default analyser $dataSource = dirname(__DIR__) . '/src'; $analysers = array('structure'); $metrics = $api->run($dataSource, $analysers); print_r($metrics);
Example 2: Compare analyser list process
CLI$ php bin\phpreflect -vvv analyser:listPHP<?php require_once dirname(__DIR__) . '/vendor/autoload.php'; use Bartlett\Reflect\Client; // creates an instance of client $client = new Client(); // request for a Bartlett\Reflect\Api\Analyser $api = $client->api('analyser'); $analysers = $api->dir(); print_r($analysers);
Example 3: Compare plugin list process
CLI$ php bin\phpreflect -vvv plugin:listPHP<?php require_once dirname(__DIR__) . '/vendor/autoload.php'; use Bartlett\Reflect\Client; use Bartlett\Reflect\Environment; // defines environment where to find the JSON config file if (!getenv("BARTLETTRC")) { putenv("BARTLETTRC=phpreflect.json"); } Environment::setScanDir(); // creates an instance of client $client = new Client(); // request for a Bartlett\Reflect\Api\Plugin $api = $client->api('plugin'); $plugins = $api->dir(); print_r($plugins);
Example 4: Compare reflection class process
CLI$ php bin\phpreflect reflection:class Bartlett\Reflect ../srcDo not use verbose level 3 to compare results in this case. It will return aBartlett\Reflect\Model\ClassModel
instance.PHP<?php require_once dirname(__DIR__) . '/vendor/autoload.php'; use Bartlett\Reflect\Client; // creates an instance of client $client = new Client(); // request for a Bartlett\Reflect\Api\Reflection $api = $client->api('reflection'); // perform request, on a data source $dataSource = dirname(__DIR__) . '/src'; $model = $api->class_('Bartlett\\Reflect', $dataSource); echo $model;CLI or PHP mode will print such output
Published by Laurent Laville on 2015-02-02Class [ <user> class Bartlett\Reflect extends Bartlett\Reflect\Event\AbstractDispatcher ] { @@ C:\home\github\php-reflect\src\Bartlett\Reflect.php 45 - 340 - Constants [0] { } - Properties [2] { Property [ private $analysers ] Property [ private $dataSourceId ] } - Methods [6] { Method [ <user> public method __construct ] { @@ C:\home\github\php-reflect\src\Bartlett\Reflect.php 53 - 57 - Parameters [0] { } } Method [ <user> public method addAnalyser ] { @@ C:\home\github\php-reflect\src\Bartlett\Reflect.php 66 - 71 - Parameters [1] { Parameter #0 [ <required> PhpParser\NodeVisitor $analyser ] } } Method [ <user> public method getAnalysers ] { @@ C:\home\github\php-reflect\src\Bartlett\Reflect.php 78 - 81 - Parameters [0] { } } Method [ <user> public method setDataSourceId ] { @@ C:\home\github\php-reflect\src\Bartlett\Reflect.php 90 - 94 - Parameters [1] { Parameter #0 [ <required> $id ] } } Method [ <user> public method getDataSourceId ] { @@ C:\home\github\php-reflect\src\Bartlett\Reflect.php 101 - 104 - Parameters [0] { } } Method [ <user> public method parse ] { @@ C:\home\github\php-reflect\src\Bartlett\Reflect.php 113 - 339 - Parameters [1] { Parameter #0 [ <required> Symfony\Component\Finder\Finder $finder ] } } } }