1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 22:01:48 +01:00
psalm/tests/SelfOutTest.php

39 lines
977 B
PHP

<?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()
{
return [
'changeInterface' => [
'<?php
interface Foo {
/**
* @return void
*/
public function far() {
}
}
class Bar {
/**
* @psalm-self-out Foo
* @return void
*/
public function baz() {
}
}
$bar = new Bar();
$bar->baz();
$bar->far();
'
]
];
}
}