2018-11-29 06:05:56 +01:00
|
|
|
|
<?php
|
2018-12-21 07:21:00 +01:00
|
|
|
|
namespace ClassAliasStubTest;
|
|
|
|
|
|
2019-03-23 19:27:54 +01:00
|
|
|
|
class A
|
|
|
|
|
{
|
2018-11-29 06:05:56 +01:00
|
|
|
|
/**
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
2019-03-23 19:27:54 +01:00
|
|
|
|
public $foo = 'hello';
|
2018-11-29 06:05:56 +01:00
|
|
|
|
|
2019-03-23 19:27:54 +01:00
|
|
|
|
public function bar(string $s) : string
|
|
|
|
|
{
|
|
|
|
|
return $s . ' I’m here';
|
2018-11-29 06:05:56 +01:00
|
|
|
|
}
|
2018-12-21 17:39:28 +01:00
|
|
|
|
|
2019-03-23 19:27:54 +01:00
|
|
|
|
public static function bat() : void
|
|
|
|
|
{
|
|
|
|
|
}
|
2018-11-29 06:05:56 +01:00
|
|
|
|
}
|
|
|
|
|
|
2019-03-23 19:27:54 +01:00
|
|
|
|
interface I
|
|
|
|
|
{
|
|
|
|
|
}
|
2018-12-21 15:29:23 +01:00
|
|
|
|
|
2019-03-23 19:27:54 +01:00
|
|
|
|
class_alias('ClassAliasStubTest\\A', 'ClassAliasStubTest\\B');
|
2018-11-29 06:46:34 +01:00
|
|
|
|
class_alias(A::class, C::class);
|
2018-12-21 07:21:00 +01:00
|
|
|
|
|
|
|
|
|
$arr = [
|
2018-12-21 15:29:23 +01:00
|
|
|
|
[A::class, D::class],
|
|
|
|
|
[I::class, IAlias::class],
|
2018-12-21 07:21:00 +01:00
|
|
|
|
];
|
|
|
|
|
|
2020-09-02 06:17:41 +02:00
|
|
|
|
foreach ($arr as [$orig, $alias]) {
|
2018-12-21 15:29:23 +01:00
|
|
|
|
// Psalm cannot reason about this in the loading step
|
|
|
|
|
class_alias($orig, $alias);
|
|
|
|
|
}
|