mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
d4590711d6
* Fix object-like array keys (fixes #5427). * Fix incorrect return types for tests. * Fix false positive list with literal int key.
32 lines
819 B
PHP
32 lines
819 B
PHP
<?php
|
|
namespace Psalm\Tests;
|
|
|
|
class TraceTest extends TestCase
|
|
{
|
|
use Traits\InvalidCodeAnalysisTestTrait;
|
|
|
|
/**
|
|
* @return iterable<string,array{string,error_message:string,1?:string[],2?:bool,3?:string}>
|
|
*/
|
|
public function providerInvalidCodeParse(): iterable
|
|
{
|
|
return [
|
|
'traceVariable' => [
|
|
'<?php
|
|
/** @psalm-trace $a */
|
|
$a = getmypid();',
|
|
'error_message' => 'Trace',
|
|
],
|
|
'undefinedTraceVariable' => [
|
|
'<?php
|
|
/** @psalm-trace $b */
|
|
echo 1;',
|
|
'error_message' => 'UndefinedTrace',
|
|
'error_levels' => [
|
|
'MixedAssignment',
|
|
],
|
|
]
|
|
];
|
|
}
|
|
}
|