1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00
psalm/tests/FileManipulation/PureAnnotationAdditionTest.php
2020-08-23 10:28:26 -04:00

46 lines
1.3 KiB
PHP

<?php
namespace Psalm\Tests\FileManipulation;
class PureAnnotationAdditionTest extends FileManipulationTest
{
/**
* @return array<string,array{string,string,string,string[],bool}>
*/
public function providerValidCodeParse()
{
return [
'addPureAnnotationToFunction' => [
'<?php
function foo(string $s): string {
return $s;
}',
'<?php
/**
* @psalm-pure
*/
function foo(string $s): string {
return $s;
}',
'7.4',
['MissingPureAnnotation'],
true,
],
'dontAddPureAnnotationToImpureFunction' => [
'<?php
function foo(string $s): string {
echo $s;
return $s;
}',
'<?php
function foo(string $s): string {
echo $s;
return $s;
}',
'7.4',
['MissingPureAnnotation'],
true,
],
];
}
}