innmind/type
最新稳定版本:1.2.0
Composer 安装命令:
composer require innmind/type
包简介
README 文档
README
This package allows to describe types as objects to check if a given type can accept a value or if it is compatible with another type.
Installation
composer require innmind/type
Usage
use Innmind\Type\{ Build, Primitive, }; final class Example { private int $id; } $type = Build::fromReflection((new \ReflectionProperty(Example::class, 'id'))->getType()); $type->allows(42); // true $type->allows('some-uuid'); // false $type->accepts(Primitive::int()); // true $type->accepts(Primitive::string()); // false
统计信息
- 总下载量: 14.89k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-07-16