1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00
psalm/tests/Php40Test.php

43 lines
1.2 KiB
PHP
Raw Normal View History

2016-11-21 20:36:06 +01:00
<?php
namespace Psalm\Tests;
class Php40Test extends TestCase
2016-11-21 20:36:06 +01:00
{
2018-11-06 03:57:36 +01:00
use Traits\ValidCodeAnalysisTestTrait;
2016-11-21 20:36:06 +01:00
2017-01-13 20:07:23 +01:00
/**
2019-03-01 21:55:20 +01:00
* @return iterable<string,array{string,assertions?:array<string,string>,error_levels?:string[]}>
2017-01-13 20:07:23 +01:00
*/
public function providerValidCodeParse(): iterable
2016-11-21 20:36:06 +01:00
{
return [
'extendOldStyleConstructor' => [
'<?php
class A {
/**
* @return string
*/
public function A() {
return "hello";
}
}
2018-11-06 03:57:36 +01:00
class B extends A {
public function __construct() {
parent::__construct();
}
2017-05-27 02:05:57 +02:00
}',
],
'sameNameMethodWithNewStyleConstructor' => [
'<?php
class A {
public function __construct(string $s) { }
/** @return void */
public function a(int $i) { }
}
2017-05-27 02:05:57 +02:00
new A("hello");',
],
];
2016-11-21 20:36:06 +01:00
}
}