The command-line interface is the easiest way to try and learn the basic Reflect features.
![]() | |
For all users. |
Without plugins
and analysers
sections in your phpreflect.json
configuration file,
when you invoke the phpreflect
command, you should obtain the following commands and options :
phpReflect version 2.5.0 Usage: [options] command [arguments] Options: --help -h Display this help message. --quiet -q Do not output any message. --verbose -v|vv|vvv Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug --version -V Display this application version. --ansi Force ANSI output. --no-ansi Disable ANSI output. --no-interaction -n Do not ask any interactive question. --profile Display timing and memory usage information. Available commands: help Displays help for a command list Lists commands plugin plugin:list List all plugins installed. provider provider:display Show source of a file in a data source. provider:list List all data source providers. provider:show Show list of files in a data source.
plugin:list |
List all plugins configured (and correctly installed) in Without plugins, you will get. $ phpreflect plugin:list
[Json Configuration] No plugins detected. With only $ phpreflect plugin:list
Plugin Name Plugin Class Events Subscribed Analyser Bartlett\Reflect\Plugin\Analyser\AnalyserPlugin reflect.complete |
provider:list |
List all data source providers configured in Result may vary depending of your current directory, but you will get something like. $ phpreflect provider:list
Source Alias Files . current 46 |
provider:show |
Show list of files corresponding to the (Symfony) Finder rules defined. With Reflect source files. $ phpreflect provider:show .
Possible alternative. $ phpreflect provider:show --alias current
Source Files . 46 Relative Path Name Date Size Bartlett\Reflect\Analyser\AbstractAnalyser.php 2014-02-03T17:25:07+01:00 3475 Bartlett\Reflect\Analyser\AnalyserInterface.php 2014-02-03T17:26:50+01:00 835 Bartlett\Reflect\Analyser\StructureAnalyser.php 2014-02-23T17:31:16+01:00 12798 <... more lines ...> |
provider:display |
Show source code of a file in one of the data source identified. With $ phpreflect provider:display . Bartlett\Reflect.php
Possible alternative. $ phpreflect provider:display --alias current Bartlett\Reflect.php
Source . Relative Path Name Date Size Id Token Line Text 0 T_OPEN_TAG 1 <?php 1 T_DOC_COMMENT 2 /** * Reflect * Reverse-engineer 2 T_WHITESPACE 15 3 T_NAMESPACE 17 namespace 4 T_WHITESPACE 17 5 T_STRING 17 Bartlett 6 T_SEMICOLON 17 ; <... more lines ...> |
When the Analyser
plugin is installed, following lines added into analysers
section
{ "name": "Analyser", "class": "Bartlett\\Reflect\\Plugin\\Analyser\\AnalyserPlugin" }
you will get two additionnal commands.
analyser:list |
List all analysers configured in Without analysers, you will get. $ phpreflect analyser:list
[Json Configuration] No analysers detected. With only $ phpreflect analyser:list
Analyser Name Analyser Class Structure Bartlett\Reflect\Analyser\StructureAnalyser |
analyser:run |
Parse a data source and display results. May wary depending of the data source and analyser used. With $ phpreflect analyser:run .
Possible alternative. $ phpreflect analyser:run --alias current
Data Source Analysed Directories 17 Files 53 Structure Analysis Namespaces 17 Interfaces 10 Traits 0 Classes 51 Abstract Classes 4 (7.84%) Concrete Classes 47 (92.16%) Methods 323 Scope Non-Static Methods 316 (97.83%) Static Methods 7 (2.17%) Visibility Public Method 288 (89.16%) Protected Method 32 (9.91%) Private Method 3 (0.93%) Functions 6 Named Functions 0 (0.00%) Anonymous Functions 6 (100.00%) Constants 30 Global Constants 14 (46.67%) Class Constants 16 (53.33%) |
When the plantUML
plugin is installed, following lines added into plugins
section
{ "name": "PlantUML", "class": "Bartlett\\Reflect\\Plugin\\PlantUML\\PlantUMLPlugin" }
you will get one additionnal command.
plantUML:run |
Parse a data source and draw corresponding UML diagrams (package or class) with the PlantUML syntax. Build a package diagram corresponding to $ phpreflect plantUML:run --package=Bartlett\Reflect\Model .
Possible Alternative. $ phpreflect plantUML:run --package=Bartlett\Reflect\Model --alias current
PlantUML package diagram It’s now time to produce PNG images. Put previous PlantUML code syntax into a text file (e.g named $ java -jar plantuml.jar packageDiagram.plantuml And you should obtain a PNG image like this one Build a class diagram corresponding to $ phpreflect plantUML:run --class=Bartlett\Reflect\Builder .
Possible Alternative. $ phpreflect plantUML:run --class=Bartlett\Reflect\Builder --alias current
PlantUML class diagram It’s now time to produce PNG images. Put previous PlantUML code syntax into a text file (e.g named $ java -jar plantuml.jar classDiagram.plantuml And you should obtain a PNG image like this one |