1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 13:51:54 +01:00
psalm/tests/stubs/class_alias.php

32 lines
560 B
PHP
Raw Normal View History

2018-11-29 00:05:56 -05:00
<?php
namespace ClassAliasStubTest;
2018-11-29 00:05:56 -05:00
class A {
/**
* @var string
*/
public $foo = "hello";
public function bar(string $s) : string {
return $s . " Im here";
}
public static function bat() : void {}
2018-11-29 00:05:56 -05:00
}
interface I {}
class_alias("ClassAliasStubTest\\A", "ClassAliasStubTest\\B");
class_alias(A::class, C::class);
$arr = [
[A::class, D::class],
[I::class, IAlias::class],
];
foreach ($arr as list($orig, $alias)) {
// Psalm cannot reason about this in the loading step
class_alias($orig, $alias);
}