1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00

#10026 added workaround for DateTimeInterface::__unserialize() signature

This commit is contained in:
Thomas Bley 2023-07-19 23:14:04 +02:00
parent 0f99799fa9
commit 804087b5d5

View File

@ -76,6 +76,19 @@ trait ValidCodeAnalysisTestTrait
$codebase->enterServerMode();
$codebase->config->visitPreloadedStubFiles($codebase);
if (version_compare(PHP_VERSION, '8.2.0', '>=')) {
$this->addStubFile(
'stubOne.phpstub',
'<?php
namespace {
interface DateTimeInterface {
public function __unserialize(mixed[] $data) {}
}
}
',
);
}
$file_path = self::$src_dir_path . 'somefile.php';
$this->addFile($file_path, $code);