mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 12:24:49 +01:00
db45ff1ba4
* add native return types * redundant phpdoc
43 lines
1.2 KiB
PHP
43 lines
1.2 KiB
PHP
<?php
|
|
namespace Psalm\Tests;
|
|
|
|
class Php40Test extends TestCase
|
|
{
|
|
use Traits\ValidCodeAnalysisTestTrait;
|
|
|
|
/**
|
|
* @return iterable<string,array{string,assertions?:array<string,string>,error_levels?:string[]}>
|
|
*/
|
|
public function providerValidCodeParse(): iterable
|
|
{
|
|
return [
|
|
'extendOldStyleConstructor' => [
|
|
'<?php
|
|
class A {
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function A() {
|
|
return "hello";
|
|
}
|
|
}
|
|
|
|
class B extends A {
|
|
public function __construct() {
|
|
parent::__construct();
|
|
}
|
|
}',
|
|
],
|
|
'sameNameMethodWithNewStyleConstructor' => [
|
|
'<?php
|
|
class A {
|
|
public function __construct(string $s) { }
|
|
/** @return void */
|
|
public function a(int $i) { }
|
|
}
|
|
new A("hello");',
|
|
],
|
|
];
|
|
}
|
|
}
|