1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-15 10:57:08 +01:00
psalm/stubs/Php81.phpstub

92 lines
2.0 KiB
PHP
Raw Normal View History

<?php
2021-09-04 22:44:06 +02:00
namespace {
interface UnitEnum {
2021-11-22 13:38:08 +01:00
/** @var non-empty-string $name */
public readonly string $name;
/**
* @psalm-pure
* @return list<static>
*/
2021-09-04 22:44:06 +02:00
public static function cases(): array;
}
2022-02-22 23:52:53 +01:00
interface BackedEnum extends UnitEnum
{
public readonly int|string $value;
/**
* @psalm-pure
*/
public static function from(string|int $value): static;
/**
* @psalm-pure
*/
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
{
/**
* @psalm-pure
*/
public function getEnum(): ReflectionEnum;
/**
* @psalm-pure
*/
public function getValue(): UnitEnum;
}
class ReflectionEnumBackedCase extends ReflectionEnumUnitCase implements Reflector
{
/**
* @psalm-pure
*/
public function getBackingValue(): int|string;
}
2022-02-09 19:32:17 +01:00
class ReflectionIntersectionType extends ReflectionType {
/**
* @return non-empty-list<ReflectionType>
*/
public function getTypes() {}
}
2021-09-04 22:44:06 +02:00
}
2021-09-04 22:44:06 +02:00
namespace FTP {
final class Connection {}
}
namespace IMAP {
final class Connection {}
2021-10-02 19:30:50 +02:00
}
2021-10-03 07:52:16 +02:00
namespace LDAP {
2021-10-02 19:30:50 +02:00
final class Connection {}
final class Result {}
final class ResultEntry {}
2021-10-04 13:41:31 +02:00
}
namespace PgSql {
final class Connection {}
final class Result {}
final class Lob {}
}
2021-10-14 20:38:26 +02:00
namespace PSpell {
final class Config {}
final class Dictionary {}
}