Skip to content

Commit 5a992cb

Browse files
committed
update readme file to latest version
1 parent bcea943 commit 5a992cb

File tree

2 files changed

+9
-73
lines changed

2 files changed

+9
-73
lines changed

README.md

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,9 @@ are however several advantages to using this library:
2222

2323
* [Creates an object graph] containing the structure of your application much like a site map shows the
2424
structure of a website.
25-
* Supports [incrementally updating] a previously analyzed codebase by caching the results
26-
and checking if any of the files have changed.
27-
* Can [filter] the object graph, for example to hide specific elements.
28-
* You can inspect your object graph, analyze it and report any errors and inconsistencies found using [validators].
2925
* Can read and interpret code of any PHP version starting with 5.2 up to and including your currently installed version
3026
of PHP.
31-
* Can be integrated into Silex and Cilex using a [Service Provider].
27+
* Due it's clean interface it can be in any application without a complex setup.
3228

3329
## Installation
3430

@@ -41,49 +37,30 @@ After the installation is complete no further configuration is necessary and you
4137

4238
## Basic Usage
4339

44-
This Reflection library uses [PSR-0] and it is recommended to use a PSR-0 compatible autoloader to load all the
40+
This Reflection library uses [PSR-4] and it is recommended to use a PSR-4 compatible autoloader to load all the
4541
files containing the classes for this library.
4642

4743
An easy way to do this is by including the [composer] autoloader as shown here:
4844

4945
include 'vendor/autoload.php';
5046

51-
Once that is done you can use the `create()` method of the `Analyzer` class to instantiate your source Analyzer and
47+
Once that is done you can use the `createIntance()` method of the `\phpDocumentor\Reflection\Php\ProjectFactory` class to instantiate a new project factory and
5248
pre-configure it with sensible defaults.
5349

54-
$analyzer = phpDocumentor\Reflection\Php\Analyzer::create();
50+
$projectFactory = \phpDocumentor\Reflection\Php\ProjectFactory::createInstance();
5551

56-
At this point we are ready to analyze files, one at a time. By loading the file using an `SplFileObject` class and
57-
feeding that to the `analyze` of the `Analyzer` method we convert the PHP code in that file into an object of type
58-
`phpDocumentor\Reflection\Php\File`.
52+
At this point we are ready to analyze your complete project or just one file at the time. Just pass an array of file paths to the `create` method of the project factory.
5953

60-
This object describing a file is returned to us but also added to another object that describes your entire project.
54+
$projectFiles = ['tests/example.file.php'];
55+
$project = $projectFactory->create('My Project', $projectFiles);
6156

62-
$splFileObject = new \SplFileObject('tests/example.file.php');
63-
$analyzer->analyze($splFileObject);
64-
65-
The step above can be repeated for as many files as you have. When you are done you will have to call the finalize
66-
method of the analyzer. This method will do another analysis pass. This pass will connect the dots and do any processing
67-
that relies the structure to be complete, such as adding linkage between all elements.
68-
69-
When the finalization is ready a new object of type `phpDocumentor\Reflection\Php\Project` will be returned that
70-
contains a complete hierarchy of all files with their classes, traits and interfaces (and everything in there), but also
71-
all namespaces and packages as a hierarchical tree.
72-
73-
$project = $analyzer->finalize();
74-
75-
When the finalization is ready a new object of type `phpDocumentor\Reflection\Php\Project` will be returned that
57+
When the process is ready a new object of type `phpDocumentor\Reflection\Php\Project` will be returned that
7658
contains a complete hierarchy of all files with their classes, traits and interfaces (and everything in there), but also
7759
all namespaces and packages as a hierarchical tree.
7860

7961
> See the [example] script for a detailed and commented example
8062
8163
[Build Status]: https://secure.travis-ci.org/phpDocumentor/Reflection.png
82-
[PSR-0]: http://php-fig.com
83-
[Creates an object graph]: docs/usage.rst
84-
[incrementally updating]: docs/incremental-updates.rst
85-
[filter]: docs/filtering.rst
86-
[validators]: docs/inspecting.rst
87-
[Service Provider]: docs/integrating-with-silex-and-cilex.rst
64+
[PSR-4]: http://php-fig.com
8865
[example]: example.php
8966
[composer]: http://getcomposer.org

TODO

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)