2018-11-29 00:05:56 -05:00
|
|
|
|
<?php
|
|
|
|
|
|
2018-12-21 01:21:00 -05:00
|
|
|
|
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 . " I’m here";
|
|
|
|
|
}
|
2018-12-21 11:39:28 -05:00
|
|
|
|
|
|
|
|
|
public static function bat() : void {}
|
2018-11-29 00:05:56 -05:00
|
|
|
|
}
|
|
|
|
|
|
2018-12-21 09:29:23 -05:00
|
|
|
|
interface I {}
|
|
|
|
|
|
2018-12-21 01:21:00 -05:00
|
|
|
|
class_alias("ClassAliasStubTest\\A", "ClassAliasStubTest\\B");
|
2018-11-29 00:46:34 -05:00
|
|
|
|
class_alias(A::class, C::class);
|
2018-12-21 01:21:00 -05:00
|
|
|
|
|
|
|
|
|
$arr = [
|
2018-12-21 09:29:23 -05:00
|
|
|
|
[A::class, D::class],
|
|
|
|
|
[I::class, IAlias::class],
|
2018-12-21 01:21:00 -05:00
|
|
|
|
];
|
|
|
|
|
|
2018-12-21 09:29:23 -05:00
|
|
|
|
foreach ($arr as list($orig, $alias)) {
|
|
|
|
|
// Psalm cannot reason about this in the loading step
|
|
|
|
|
class_alias($orig, $alias);
|
|
|
|
|
}
|