Repository navigation
Commit 31d485d
Let OpenSslCipherMethodsProvider contribute its own result cache meta
The provider builds its list of supported ciphers by asking
openssl_get_cipher_methods() and then probing every algorithm with
openssl_cipher_iv_length(), and the inferred type follows it:
openssl_cipher_iv_length() is int for a supported algorithm and false
for an unsupported one.
That list is a property of the PHP build rather than of the PHP version,
so two hosts on the same PHP_VERSION_ID disagree. Measured across CI
runners and docker images:
PHP 8.4.25, ubuntu-latest, OpenSSL 3.0.13 -> 212 ciphers
PHP 8.4.25, macos-latest, OpenSSL 3.6.3 -> 208 ciphers
The four missing on macOS are aes-128-cbc-hmac-sha1,
aes-128-cbc-hmac-sha256, aes-256-cbc-hmac-sha1 and
aes-256-cbc-hmac-sha256, so openssl_cipher_iv_length() for one of them
is int on the first and false on the second. phpExtensions records
extension names only, so the metadata is identical and the cache is
reused across the difference.
Implementing ResultCacheMetaExtension on the provider puts the
fingerprint where the knowledge already lives, and it costs nothing for
projects that never touch openssl, since the list is only computed when
something asks for it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 9effa00 commit 31d485d
2 files changed
Lines changed: 74 additions & 4 deletions
File tree
- src/Type/Php
- tests/PHPStan/Type/Php
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| 15 | + | |
| 16 | + | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
16 | | - | |
| 20 | + | |
17 | 21 | | |
18 | 22 | | |
19 | | - | |
20 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
21 | 33 | | |
22 | 34 | | |
23 | 35 | | |
| |||
27 | 39 | | |
28 | 40 | | |
29 | 41 | | |
30 | | - | |
| 42 | + | |
31 | 43 | | |
32 | 44 | | |
33 | 45 | | |
| |||
54 | 66 | | |
55 | 67 | | |
56 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
57 | 88 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
0 commit comments