1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-02 09:37:59 +01:00
psalm/tests/SelfOutTest.php

39 lines
1.0 KiB
PHP
Raw Normal View History

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[]}>
*/
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
}
}