1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00
psalm/stubs/Php81.phpstub
2021-11-28 11:41:43 +02:00

64 lines
1.5 KiB
Plaintext

<?php
namespace {
interface UnitEnum {
/** @var non-empty-string $name */
public readonly string $name;
/** @return non-empty-list<static> */
public static function cases(): array;
}
interface BackedEnum
{
public readonly int|string $value;
public static function from(string|int $value): static;
public static function tryFrom(string|int $value): ?static;
}
class ReflectionEnum extends ReflectionClass implements Reflector
{
public function getBackingType(): ?ReflectionType;
public function getCase(string $name): ReflectionEnumUnitCase;
/** @return list<ReflectionEnumUnitCase> */
public function getCases(): array;
public function hasCase(string $name): bool;
public function isBacked(): bool;
}
class ReflectionEnumUnitCase extends ReflectionClassConstant implements Reflector
{
public function getEnum(): ReflectionEnum;
public function getValue(): UnitEnum;
}
class ReflectionEnumBackedCase extends ReflectionEnumUnitCase implements Reflector
{
public function getBackingValue(): int|string;
}
}
namespace FTP {
final class Connection {}
}
namespace IMAP {
final class Connection {}
}
namespace LDAP {
final class Connection {}
final class Result {}
final class ResultEntry {}
}
namespace PgSql {
final class Connection {}
final class Result {}
final class Lob {}
}
namespace PSpell {
final class Config {}
final class Dictionary {}
}