Skip to content

Commit 09d1ff7

Browse files
committed
Merge branch 'master' into custom-visitor
2 parents 5e0f750 + acf0f06 commit 09d1ff7

15 files changed

+138
-3156
lines changed

.gitignore

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,6 @@
1-
# Composer dependencies.
1+
/composer.lock
22
/vendor/
33

4-
# VSCode stuff (ignore everything but these config files).
5-
/.vscode/
6-
!/.vscode/tasks.json
7-
!/.vscode/launch.json
8-
!/.vscode/cSpell.json
9-
!/.vscode/settings.json
10-
!/.vscode/extensions.json
11-
12-
# PHP CS Fixer cache file
4+
# Cache files
135
.php_cs.cache
14-
15-
16-
# General rules from gitignore templates.
17-
~*
18-
._*
19-
Icon
20-
*.log
21-
.apdisk
22-
.Trashes
23-
.AppleDB
24-
.DS_Store
25-
.fseventsd
26-
.LSOverride
27-
.AppleDouble
28-
.AppleDesktop
29-
Temporary Items
30-
.Spotlight-V100
31-
.TemporaryItems
32-
.VolumeIcon.icns
33-
Network Trash Folder
34-
.DocumentRevisions-V100
35-
.com.apple.timemachine.donotpresent
6+
.phpunit.result.cache

.travis.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
1-
language: php
1+
# TravisCI configuration for php-stubs/generator
2+
3+
language: "php"
4+
os:
5+
- "linux"
6+
dist: "bionic"
27

38
php:
4-
- '7.1'
5-
- '7.2'
6-
- nightly
9+
- "7.3"
10+
- "7.4"
11+
- "8.0"
12+
13+
cache:
14+
directories:
15+
- "${HOME}/.composer/cache"
716

8-
matrix:
9-
allow_failures:
10-
- php: nightly
17+
before_install:
18+
- "composer validate --strict"
1119

12-
install: composer install
20+
install:
21+
- "composer update"
1322

1423
script:
15-
- vendor/bin/phpunit
16-
- vendor/bin/psalm
24+
- "vendor/bin/phpunit --verbose"

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# PHP Stubs Generator
22

3-
[![Build Status](https://travis-ci.org/GiacoCorsiglia/php-stubs-generator.svg?branch=master)](https://travis-ci.org/GiacoCorsiglia/php-stubs-generator)
3+
[![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 [Psalm](https://getpsalm.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

@@ -75,7 +75,7 @@ namespace MyNamespace {
7575
To install:
7676

7777
```
78-
composer global require giacocorsiglia/stubs-generator
78+
composer global require php-stubs/generator
7979
```
8080

8181
To get the pretty-printed stubs for all the PHP files in a directory:
@@ -103,7 +103,7 @@ generate-stubs --help
103103
To install:
104104

105105
```
106-
composer require giacocorsiglia/stubs-generator
106+
composer require php-stubs/generator
107107
```
108108

109109
### Simple Example
@@ -155,11 +155,10 @@ The set of symbol types are:
155155
- `StubsGenerator::DOCUMENTED_GLOBALS`: Global variables, but only those with a doc comment.
156156
- `StubsGenerator::UNDOCUMENTED_GLOBALS`: Global variable, but only those without a doc comment.
157157
- `StubsGenerator::GLOBALS`: Shortcut to include both documented and undocumented global variables.
158+
- `StubsGenerator::CONSTANTS`: Constant declarations.
158159
- `StubsGenerator::DEFAULT`: Shortcut to include everything _except_ undocumented global variables.
159160
- `StubsGenerator::ALL`: Shortcut to include everything.
160161

161162
## TODO
162163

163-
- Add support for constants declared with `const`.
164-
- Add support for constants declared with `define()`.
165-
- Consider parsing function and method bodies for these declarations.
164+
- Consider parsing function and method bodies for constant declarations.

composer.json

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"name": "giacocorsiglia/stubs-generator",
2+
"name": "php-stubs/generator",
33
"description": "Generate stubs from any PHP code for IDE completion and static analysis.",
44
"type": "library",
55
"license": "MIT",
66
"keywords": [
77
"IDE",
88
"static analysis"
99
],
10-
"homepage": "https://github.com/GiacoCorsiglia/php-stubs-generator",
10+
"homepage": "https://github.com/php-stubs/generator",
1111
"authors": [
1212
{
1313
"name": "Giaco Corsiglia",
@@ -16,23 +16,22 @@
1616
],
1717
"autoload": {
1818
"psr-4": {
19-
"StubsGenerator\\": "src"
19+
"StubsGenerator\\": "src/"
2020
}
2121
},
2222
"bin": [
2323
"bin/generate-stubs"
2424
],
2525
"require": {
26-
"php": ">=7.1",
27-
"symfony/console": "^4.0",
28-
"nikic/php-parser": "^3.1",
29-
"symfony/finder": "^4.0",
30-
"symfony/filesystem": "^4.0"
26+
"php": "^7.3 || ^8.0",
27+
"nikic/php-parser": "^4.10",
28+
"symfony/console": "^5.1",
29+
"symfony/filesystem": "^5.0",
30+
"symfony/finder": "^5.0"
3131
},
3232
"require-dev": {
33-
"vimeo/psalm": "^0.3.92",
34-
"phpunit/phpunit": "^7.0",
35-
"friendsofphp/php-cs-fixer": "^2.10"
36-
},
37-
"minimum-stability": "stable"
33+
"vimeo/psalm": "^4.1",
34+
"phpunit/phpunit": "^9.4",
35+
"friendsofphp/php-cs-fixer": "^2.16"
36+
}
3837
}

0 commit comments

Comments
 (0)