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

43 lines
1.1 KiB
PHP
Raw Normal View History

2016-11-21 14:36:06 -05:00
<?php
2016-11-21 14:36:06 -05:00
namespace Psalm\Tests;
2021-12-04 21:55:53 +01:00
use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait;
class Php40Test extends TestCase
2016-11-21 14:36:06 -05:00
{
2021-12-04 21:55:53 +01:00
use ValidCodeAnalysisTestTrait;
2016-11-21 14:36:06 -05:00
public function providerValidCodeParse(): iterable
2016-11-21 14:36:06 -05:00
{
return [
'extendOldStyleConstructor' => [
'code' => '<?php
class A {
/**
* @return string
*/
public function A() {
return "hello";
}
}
2018-11-05 21:57:36 -05:00
class B extends A {
public function __construct() {
parent::__construct();
}
2017-05-26 20:05:57 -04:00
}',
],
'sameNameMethodWithNewStyleConstructor' => [
'code' => '<?php
class A {
public function __construct(string $s) { }
/** @return void */
public function a(int $i) { }
}
2017-05-26 20:05:57 -04:00
new A("hello");',
],
];
2016-11-21 14:36:06 -05:00
}
}