innmind/type 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

innmind/type

最新稳定版本:1.2.0

Composer 安装命令:

composer require innmind/type

包简介

README 文档

README

Build Status codecov Type Coverage

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

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-07-16