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:
parent
3b7e508c78
commit
44785fadfc
@ -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,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user