Skip to content

Commit 69a32da

Browse files
authored
Improve README
1 parent 842db74 commit 69a32da

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

README.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
[![Build Status](https://travis-ci.com/php-stubs/generator.svg?branch=master)](https://travis-ci.com/github/php-stubs/generator)
44

5-
Use this tool to generate stub declarations for functions, classes, interfaces, and global variables defined in any PHP code. The stubs can subsequently be used to facilitate IDE completion or static analysis via [Psalm](https://getpsalm.org) or potentially other tools. Stub generation is particularly useful for code which mixes definitions with side-effects.
5+
Use this tool to generate stub declarations for functions, classes, interfaces, and global variables defined in any PHP code. The stubs can subsequently be used to facilitate IDE completion or static analysis via [PHPStan](https://phpstan.org) or potentially other tools. Stub generation is particularly useful for code which mixes definitions with side-effects.
66

77
The generator is based on nikic's [PHP-Parser](https://github.com/nikic/PHP-Parser), and the code also relies on several [Symfony](https://symfony.com) components.
88

9-
Contributions in the form of issue reports or Pull Requests are welcome!
9+
Contributions in the form of [issues](https://github.com/php-stubs/generator/issues/new) or Pull Requests are welcome!
1010

1111
## Example
1212

@@ -69,40 +69,39 @@ namespace MyNamespace {
6969
}
7070
```
7171

72-
7372
## Command Line Usage
7473

7574
To install:
7675

77-
```
76+
```bash
7877
composer global require php-stubs/generator
7978
```
8079

8180
To get the pretty-printed stubs for all the PHP files in a directory:
8281

83-
```
82+
```bash
8483
generate-stubs /path/to/my-library
8584
```
8685

8786
You may also pass multiple directories, or filenames, separated by spaces. All stubs will be concatenated in the output.
8887

8988
To write the stubs to a file (and see a few statistics in the stdout):
9089

91-
```
90+
```bash
9291
generate-stubs /path/to/my-library --out=/path/to/output.php
9392
```
9493

9594
For the complete set of command line options:
9695

97-
```
96+
```bash
9897
generate-stubs --help
9998
```
10099

101100
## Usage in PHP
102101

103102
To install:
104103

105-
```
104+
```bash
106105
composer require php-stubs/generator
107106
```
108107

@@ -158,7 +157,3 @@ The set of symbol types are:
158157
- `StubsGenerator::CONSTANTS`: Constant declarations.
159158
- `StubsGenerator::DEFAULT`: Shortcut to include everything _except_ undocumented global variables.
160159
- `StubsGenerator::ALL`: Shortcut to include everything.
161-
162-
## TODO
163-
164-
- Consider parsing function and method bodies for constant declarations.

0 commit comments

Comments
 (0)