Skip to content

Commit 4a0ffab

Browse files
authored
Apply the stricter signatures for PHP 8.0 after the basic ones for PHP 8.0
1 parent 9db34df commit 4a0ffab

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

resources/functionMap_php80delta_bleedingEdge.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
'error_log' => ['bool', 'message'=>'string', 'message_type='=>'0|1|3|4', 'destination='=>'string', 'extra_headers='=>'string'],
66
'filter_input' => ['mixed', 'type'=>'INPUT_GET|INPUT_POST|INPUT_COOKIE|INPUT_SERVER|INPUT_ENV', 'variable_name'=>'string', 'filter='=>'int', 'options='=>'array|int'],
77
'filter_input_array' => ['array|false|null', 'type'=>'INPUT_GET|INPUT_POST|INPUT_COOKIE|INPUT_SERVER|INPUT_ENV', 'definition='=>'int|array', 'add_empty='=>'bool'],
8-
'hash_hkdf' => ['non-empty-string', 'algo'=>'non-falsy-string', 'key'=>'string', 'length='=>'0|positive-int', 'info='=>'string', 'salt='=>'string'],
8+
'hash_hkdf' => ['non-falsy-string', 'algo'=>'non-falsy-string', 'key'=>'string', 'length='=>'0|positive-int', 'info='=>'string', 'salt='=>'string'],
99
'hash_pbkdf2' => ['non-empty-string', 'algo'=>'non-falsy-string', 'password'=>'string', 'salt'=>'string', 'iterations'=>'positive-int', 'length='=>'0|positive-int', 'raw_output='=>'bool'],
1010
'imagecreate' => ['__benevolent<GdImage|false>', 'width'=>'int<1, max>', 'height'=>'int<1, max>'],
1111
'imagecreatetruecolor' => ['__benevolent<GdImage|false>', 'width'=>'int<1, max>', 'height'=>'int<1, max>'],

src/Reflection/SignatureMap/FunctionSignatureMapProvider.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -190,15 +190,6 @@ public function getSignatureMap(): array
190190
}
191191

192192
$signatureMap = $this->computeSignatureMap($signatureMap, $stricterFunctionMap);
193-
194-
if ($this->phpVersion->getVersionId() >= 80000) {
195-
$php80StricterFunctionMapDelta = require __DIR__ . '/../../../resources/functionMap_php80delta_bleedingEdge.php';
196-
if (!is_array($php80StricterFunctionMapDelta)) {
197-
throw new ShouldNotHappenException('Signature map could not be loaded.');
198-
}
199-
200-
$signatureMap = $this->computeSignatureMap($signatureMap, $php80StricterFunctionMapDelta);
201-
}
202193
}
203194

204195
if ($this->phpVersion->getVersionId() >= 70400) {
@@ -217,6 +208,15 @@ public function getSignatureMap(): array
217208
}
218209

219210
$signatureMap = $this->computeSignatureMap($signatureMap, $php80MapDelta);
211+
212+
if ($this->stricterFunctionMap) {
213+
$php80StricterFunctionMapDelta = require __DIR__ . '/../../../resources/functionMap_php80delta_bleedingEdge.php';
214+
if (!is_array($php80StricterFunctionMapDelta)) {
215+
throw new ShouldNotHappenException('Signature map could not be loaded.');
216+
}
217+
218+
$signatureMap = $this->computeSignatureMap($signatureMap, $php80StricterFunctionMapDelta);
219+
}
220220
}
221221

222222
if ($this->phpVersion->getVersionId() >= 80100) {

0 commit comments

Comments
 (0)