1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 13:51:54 +01:00

Introduce test with code inside namespace

This commit is contained in:
dennis 2022-09-13 11:28:26 +02:00
parent 3b7e508c78
commit 44785fadfc

View File

@ -118,6 +118,30 @@ class ThrowsBlockAdditionTest extends FileManipulationTestCase
['MissingThrowsDocblock'],
true,
],
'addThrowsAnnotationToFunctionInNamespace' => [
'<?php
namespace Foo;
function foo(string $s): string {
if("" === $s) {
throw new \InvalidArgumentException();
}
return $s;
}',
'<?php
namespace Foo;
/**
* @throws \InvalidArgumentException
*/
function foo(string $s): string {
if("" === $s) {
throw new \InvalidArgumentException();
}
return $s;
}',
'7.4',
['MissingThrowsDocblock'],
true,
],
];
}
}