File tree 5 files changed +44
-0
lines changed
e2e/result-cache-meta-extension
5 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -233,6 +233,15 @@ jobs:
233
233
cd e2e/bug-11857
234
234
composer install
235
235
../../bin/phpstan
236
+ - script : |
237
+ cd e2e/result-cache-meta-extension
238
+ ../../bin/phpstan -vvv
239
+ ../../bin/phpstan -vvv --fail-without-result-cache
240
+ echo 'modified-hash' > hash.txt
241
+ OUTPUT=$(../bashunit -a exit_code "2" "../../bin/phpstan -vvv --fail-without-result-cache")
242
+ echo "$OUTPUT"
243
+ ../bashunit -a matches "Note: Using configuration file .+phpstan.neon." "$OUTPUT"
244
+ ../bashunit -a contains 'Result cache not used because the metadata do not match: metaExtensions' "$OUTPUT"
236
245
237
246
steps :
238
247
- name : " Checkout"
Original file line number Diff line number Diff line change 140
140
"classmap" : [
141
141
" tests/e2e" ,
142
142
" tests/PHPStan"
143
+ ],
144
+ "files" : [
145
+ " e2e/result-cache-meta-extension/src/DummyResultCacheMetaExtension.php"
143
146
]
144
147
},
145
148
"repositories" : [
Original file line number Diff line number Diff line change
1
+ initial-hash
Original file line number Diff line number Diff line change
1
+ parameters :
2
+ level : 8
3
+ paths :
4
+ - src
5
+
6
+ services :
7
+ -
8
+ class : ResultCacheE2E\MetaExtension\DummyResultCacheMetaExtension
9
+ tags :
10
+ - phpstan.resultCacheMetaExtension
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace ResultCacheE2E \MetaExtension ;
6
+
7
+ use PHPStan \Analyser \ResultCache \ResultCacheMetaExtension ;
8
+
9
+ final class DummyResultCacheMetaExtension implements ResultCacheMetaExtension
10
+ {
11
+ public function getKey (): string
12
+ {
13
+ return 'e2e-self-hashing-result-cache-meta-extension ' ;
14
+ }
15
+
16
+ public function getHash (): string
17
+ {
18
+ // @phpstan-ignore argument.type (the file is always present so this won't pass `false` as an argument)
19
+ return trim (file_get_contents (__DIR__ . '/../hash.txt ' ));
20
+ }
21
+ }
You can’t perform that action at this time.
0 commit comments