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

92 lines
2.1 KiB
PHP
Raw Normal View History

<?php
2021-09-04 23:44:06 +03: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 23:44:06 +03:00
public static function cases(): array;
}
2022-02-23 00:52:53 +02: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 ReflectionClass implements Reflector {
/** @psalm-pure */
public function isEnum(): bool {}
}
/** @psalm-immutable */
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;
}
/** @psalm-immutable */
class ReflectionEnumUnitCase extends ReflectionClassConstant implements Reflector
{
public function getEnum(): ReflectionEnum;
public function getValue(): UnitEnum;
}
/** @psalm-immutable */
class ReflectionEnumBackedCase extends ReflectionEnumUnitCase implements Reflector
{
public function getBackingValue(): int|string;
}
2022-02-09 19:32:17 +01:00
/** @psalm-immutable */
2022-02-09 19:32:17 +01:00
class ReflectionIntersectionType extends ReflectionType {
/** @return non-empty-list<ReflectionType> */
public function getTypes(): array {}
/** @return false */
public function allowsNull(): bool {}
2022-02-09 19:32:17 +01:00
}
2021-09-04 23:44:06 +03:00
}
2021-09-04 23:44:06 +03: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 {}
}