2020-06-23 18:54:45 +02:00
|
|
|
<?php
|
|
|
|
namespace Psalm\Tests;
|
|
|
|
|
2020-06-30 17:35:30 +02:00
|
|
|
class SelfOutTest extends TestCase
|
2020-06-23 18:54:45 +02:00
|
|
|
{
|
|
|
|
use Traits\ValidCodeAnalysisTestTrait;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return iterable<string,array{string,assertions?:array<string,string>,error_levels?:string[]}>
|
|
|
|
*/
|
2020-09-12 17:24:05 +02:00
|
|
|
public function providerValidCodeParse(): iterable
|
2020-06-23 18:54:45 +02:00
|
|
|
{
|
2020-06-24 22:36:04 +02:00
|
|
|
return [
|
|
|
|
'changeInterface' => [
|
|
|
|
'<?php
|
|
|
|
interface Foo {
|
|
|
|
/**
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function far() {
|
|
|
|
}
|
2020-06-23 18:54:45 +02:00
|
|
|
}
|
2020-06-24 22:36:04 +02:00
|
|
|
class Bar {
|
|
|
|
/**
|
|
|
|
* @psalm-self-out Foo
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function baz() {
|
|
|
|
}
|
2020-06-23 18:54:45 +02:00
|
|
|
}
|
2020-06-24 22:36:04 +02:00
|
|
|
$bar = new Bar();
|
|
|
|
$bar->baz();
|
|
|
|
$bar->far();
|
|
|
|
'
|
|
|
|
]
|
|
|
|
];
|
2020-06-23 18:54:45 +02:00
|
|
|
}
|
|
|
|
}
|