Skip to content

Commit d88bf46

Browse files
committed
Merge branch 'master' of github.com:phpDocumentor/TypeResolver into add-pseudo-type-support-and-use-true-and-false
2 parents 229d114 + 94f3ddc commit d88bf46

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+28342
-343
lines changed

.gitattributes

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
.gitignore export-ignore
33
.scrutinizer.yml export-ignore
44
.travis.yml export-ignore
5+
composer-require-config.json export-ignore
6+
Makefile export-ignore
7+
phive.xml export-ignore
8+
phpcs.xml.dist export-ignore
9+
phpstan.neon export-ignore
10+
psalm.xml export-ignore
11+
/.github/ export-ignore
512
/examples/ export-ignore
613
/phpmd.xml.dist export-ignore
714
/phpunit.xml.dist export-ignore

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: composer
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 10

.github/workflows/push.yml

Lines changed: 132 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
1-
on: push
1+
on:
2+
push:
3+
branches:
4+
- master
5+
pull_request:
26
name: Qa workflow
37
jobs:
48
setup:
59
runs-on: ubuntu-latest
610
steps:
711
- uses: actions/checkout@master
8-
- name: Restore/cache vendor folder
9-
uses: actions/cache@v1
10-
with:
11-
path: vendor
12-
key: all-build-${{ hashFiles('**/composer.lock') }}
13-
restore-keys: |
14-
all-build-${{ hashFiles('**/composer.lock') }}
15-
all-build-
12+
1613
- name: Restore/cache tools folder
1714
uses: actions/cache@v1
1815
with:
@@ -21,37 +18,41 @@ jobs:
2118
restore-keys: |
2219
all-tools-${{ github.sha }}-
2320
all-tools-
21+
2422
- name: composer
2523
uses: docker://composer
2624
env:
2725
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2826
with:
2927
args: install --no-interaction --prefer-dist --optimize-autoloader
28+
3029
- name: composer-require-checker
3130
uses: docker://phpga/composer-require-checker-ga
3231
env:
3332
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3433
with:
3534
args: check --config-file ./composer-require-config.json composer.json
35+
3636
- name: Install phive
3737
run: make install-phive
38+
3839
- name: Install PHAR dependencies
39-
run: tools/phive.phar --no-progress install --copy --trust-gpg-keys 4AA394086372C20A,D2CCAC42F6295E7D,E82B2FB314E9906E,8E730BA25823D8B5 --force-accept-unsigned
40+
run: tools/phive.phar --no-progress install --copy --trust-gpg-keys 4AA394086372C20A,8A03EA3B385DBAA1 --force-accept-unsigned
4041

4142
phpunit-with-coverage:
4243
runs-on: ubuntu-latest
4344
name: Unit tests
4445
needs: setup
4546
steps:
4647
- uses: actions/checkout@master
47-
- name: Restore/cache vendor folder
48-
uses: actions/cache@v1
48+
49+
- name: Setup PHP
50+
uses: shivammathur/setup-php@v2
4951
with:
50-
path: vendor
51-
key: all-build-${{ hashFiles('**/composer.lock') }}
52-
restore-keys: |
53-
all-build-${{ hashFiles('**/composer.lock') }}
54-
all-build-
52+
php-version: 7.2
53+
ini-values: memory_limit=2G, display_errors=On, error_reporting=-1
54+
coverage: pcov
55+
5556
- name: Restore/cache tools folder
5657
uses: actions/cache@v1
5758
with:
@@ -60,14 +61,22 @@ jobs:
6061
restore-keys: |
6162
all-tools-${{ github.sha }}-
6263
all-tools-
63-
- name: Setup PHP
64-
uses: shivammathur/setup-php@master
64+
65+
- name: Get composer cache directory
66+
id: composer-cache
67+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
68+
69+
- name: Cache composer dependencies
70+
uses: actions/cache@v1
6571
with:
66-
php-version: 7.2
67-
extension-csv: mbstring, intl, iconv, libxml, dom, json, simplexml, zlib
68-
ini-values-csv: memory_limit=2G, display_errors=On, error_reporting=-1
69-
coverage: xdebug
70-
pecl: false
72+
path: ${{ steps.composer-cache.outputs.dir }}
73+
key: ubuntu-latest-composer-${{ hashFiles('**/composer.lock') }}
74+
restore-keys: ubuntu-latest-composer-
75+
76+
- name: Install Composer dependencies
77+
run: |
78+
composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
79+
7180
- name: Run PHPUnit
7281
run: php tools/phpunit
7382

@@ -86,6 +95,7 @@ jobs:
8695
- phpunit-with-coverage
8796
steps:
8897
- uses: actions/checkout@master
98+
8999
- name: Restore/cache vendor folder
90100
uses: actions/cache@v1
91101
with:
@@ -94,6 +104,7 @@ jobs:
94104
restore-keys: |
95105
all-build-${{ hashFiles('**/composer.lock') }}
96106
all-build-
107+
97108
- name: Restore/cache tools folder
98109
uses: actions/cache@v1
99110
with:
@@ -102,13 +113,29 @@ jobs:
102113
restore-keys: |
103114
all-tools-${{ github.sha }}-
104115
all-tools-
116+
105117
- name: Setup PHP
106-
uses: shivammathur/setup-php@master
118+
uses: shivammathur/setup-php@v2
107119
with:
108120
php-version: ${{ matrix.php-versions }}
109-
extension-csv: mbstring, intl, iconv, libxml, dom, json, simplexml, zlib
110-
ini-values-csv: memory_limit=2G, display_errors=On, error_reporting=-1
111-
pecl: false
121+
ini-values: memory_limit=2G, display_errors=On, error_reporting=-1
122+
coverage: none
123+
124+
- name: Get composer cache directory
125+
id: composer-cache
126+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
127+
128+
- name: Cache composer dependencies
129+
uses: actions/cache@v1
130+
with:
131+
path: ${{ steps.composer-cache.outputs.dir }}
132+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
133+
restore-keys: ${{ runner.os }}-composer-
134+
135+
- name: Install Composer dependencies
136+
run: |
137+
composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
138+
112139
- name: Run PHPUnit
113140
continue-on-error: true
114141
run: php tools/phpunit
@@ -126,20 +153,10 @@ jobs:
126153
restore-keys: |
127154
all-build-${{ hashFiles('**/composer.lock') }}
128155
all-build-
129-
- name: Restore/cache tools folder
130-
uses: actions/cache@v1
131-
with:
132-
path: tools
133-
key: all-tools-${{ github.sha }}
134-
restore-keys: |
135-
all-tools-${{ github.sha }}-
136-
all-tools-
137156
- name: Code style check
138-
uses: docker://phpdoc/phpcs-ga:latest
139-
env:
140-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
157+
uses: phpDocumentor/coding-standard@master
141158
with:
142-
args: -d memory_limit=1024M
159+
args: -s
143160

144161
phpstan:
145162
runs-on: ubuntu-latest
@@ -154,53 +171,53 @@ jobs:
154171
restore-keys: |
155172
all-build-${{ hashFiles('**/composer.lock') }}
156173
all-build-
157-
- name: Restore/cache tools folder
158-
uses: actions/cache@v1
159-
with:
160-
path: tools
161-
key: all-tools-${{ github.sha }}
162-
restore-keys: |
163-
all-tools-${{ github.sha }}-
164-
all-tools-
165174
- name: PHPStan
166-
uses: docker://phpdoc/phpstan-ga:latest
175+
uses: phpDocumentor/phpstan-ga@master
167176
env:
168177
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
169178
with:
170-
args: analyse src --level max --configuration phpstan.neon
179+
args: analyse src --configuration phpstan.neon
171180

172181
psalm:
173182
runs-on: ubuntu-latest
174183
needs: [setup, phpunit]
175184
steps:
176185
- uses: actions/checkout@master
177-
- name: Restore/cache vendor folder
178-
uses: actions/cache@v1
186+
187+
- name: Setup PHP
188+
uses: shivammathur/setup-php@v2
179189
with:
180-
path: vendor
181-
key: all-build-${{ hashFiles('**/composer.lock') }}
182-
restore-keys: |
183-
all-build-${{ hashFiles('**/composer.lock') }}
184-
all-build-
185-
- name: Restore/cache tools folder
190+
php-version: 7.2
191+
ini-values: memory_limit=2G, display_errors=On, error_reporting=-1
192+
tools: psalm
193+
coverage: none
194+
195+
- name: Get composer cache directory
196+
id: composer-cache
197+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
198+
199+
- name: Cache composer dependencies
186200
uses: actions/cache@v1
187201
with:
188-
path: tools
189-
key: all-tools-${{ github.sha }}
190-
restore-keys: |
191-
all-tools-${{ github.sha }}-
192-
all-tools-
202+
path: ${{ steps.composer-cache.outputs.dir }}
203+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
204+
restore-keys: ${{ runner.os }}-composer-
205+
206+
- name: Install Composer dependencies
207+
run: |
208+
composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
209+
193210
- name: Psalm
194-
uses: docker://mickaelandrieu/psalm-ga
195-
env:
196-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
211+
run: psalm --output-format=github
197212

198213
bc_check:
199214
name: BC Check
200215
runs-on: ubuntu-latest
201216
needs: [setup, phpunit]
202217
steps:
203218
- uses: actions/checkout@master
219+
- name: fetch tags
220+
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
204221
- name: Restore/cache vendor folder
205222
uses: actions/cache@v1
206223
with:
@@ -211,3 +228,52 @@ jobs:
211228
all-build-
212229
- name: Roave BC Check
213230
uses: docker://nyholm/roave-bc-check-ga
231+
232+
profile:
233+
runs-on: ubuntu-latest
234+
name: profile
235+
needs: [setup, phpunit]
236+
services:
237+
blackfire:
238+
image: blackfire/blackfire
239+
ports:
240+
- 8707:8707
241+
env:
242+
BLACKFIRE_SERVER_ID: "517a7aa6-1ec8-4d29-bff8-dddecf4333de"
243+
BLACKFIRE_SERVER_TOKEN: "21795bdce7c0b5d24f0ccbb42e2a7518feb5359840752b163652899f927cbf2b"
244+
245+
steps:
246+
- uses: actions/checkout@master
247+
248+
- name: Setup PHP
249+
uses: shivammathur/setup-php@v2
250+
with:
251+
php-version: 7.2
252+
extensions: blackfire
253+
ini-values: memory_limit=2G, display_errors=On, error_reporting=-1, blackfire.agent_socket=tcp://localhost:8707
254+
coverage: none
255+
256+
- name: Get Composer Cache Directory
257+
id: composer-cache
258+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
259+
260+
- name: Cache dependencies
261+
uses: actions/cache@v1
262+
with:
263+
path: ${{ steps.composer-cache.outputs.dir }}
264+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
265+
restore-keys: ${{ runner.os }}-composer-
266+
267+
- name: Install dependencies
268+
run: composer install --prefer-dist --no-progress --no-suggest
269+
270+
- name: Install phpbench
271+
run: |
272+
composer global require jaapio/phpbench-blackfire:1.x-dev@dev && \
273+
sudo ln -sf "$(composer -q global config home)"/vendor/bin/phpbench /usr/local/bin/phpbench
274+
275+
- name: Run phpbench
276+
run: phpbench run -l blackfire --revs=1 --tag="Build_PR_${{ github.event.number }}"
277+
env:
278+
BLACKFIRE_CLIENT_ID: ${{ secrets.BLACKFIRE_CLIENT_ID }}
279+
BLACKFIRE_CLIENT_TOKEN: ${{ secrets.BLACKFIRE_CLIENT_TOKEN }}

Makefile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.PHONY: install-phive
22
install-phive:
33
mkdir tools; \
4-
wget -O tools/phive.phar https://phar.io/releases/phive.phar; \
5-
wget -O tools/phive.phar.asc https://phar.io/releases/phive.phar.asc; \
4+
wget -O tools/phive.phar https://github.com/phar-io/phive/releases/download/0.13.2/phive-0.13.2.phar; \
5+
wget -O tools/phive.phar.asc https://github.com/phar-io/phive/releases/download/0.13.2/phive-0.13.2.phar.asc; \
66
gpg --keyserver pool.sks-keyservers.net --recv-keys 0x9D8A98B29B2D5D79; \
77
gpg --verify tools/phive.phar.asc tools/phive.phar; \
88
chmod +x tools/phive.phar
@@ -13,16 +13,15 @@ setup: install-phive
1313

1414
.PHONY: phpcs
1515
phpcs:
16-
docker run -it --rm -v${PWD}:/opt/project -w /opt/project phpdoc/phpcs-ga:latest -d memory_limit=1024M
16+
docker run -it --rm -v${PWD}:/opt/project -w /opt/project phpdoc/phpcs-ga:latest -s
1717

1818
.PHONY: phpstan
1919
phpstan:
20-
docker run -it --rm -v${PWD}:/opt/project -w /opt/project phpdoc/phpstan-ga:latest analyse src --no-progress --level max --configuration phpstan.neon
20+
docker run -it --rm -v${PWD}:/opt/project -w /opt/project phpdoc/phpstan-ga:latest analyse src --no-progress --configuration phpstan.neon
2121

2222
.PHONY: psaml
2323
psalm:
24-
docker run -it --rm -v${PWD}:/opt/project -w /opt/project mickaelandrieu/psalm-ga
25-
24+
docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:7.2 tools/psalm
2625
.PHONY: test
2726
test:
2827
docker run -it --rm -v${PWD}:/opt/project -w /opt/project php:7.2 tools/phpunit

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
},
2525
"autoload-dev": {
2626
"psr-4": {
27-
"phpDocumentor\\Reflection\\": "tests/unit"
27+
"phpDocumentor\\Reflection\\": ["tests/unit", "tests/benchmark"]
2828
}
2929
},
3030
"extra": {

0 commit comments

Comments
 (0)