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