radebatz/type-info-extras
最新稳定版本:1.0.3
Composer 安装命令:
composer require radebatz/type-info-extras
包简介
Extras for symfony/type-info
README 文档
README
TypeInfoExtras
Library adding some extra features to the Symfony Type Info component.
Based on the type-info:7.3 branch.
Basic Usage
<?php use Radebatz\TypeInfoExtras\TypeResolver\StringTypeResolver as ExtraStringTypeResolver; $resolver = new ExtraStringTypeResolver(); $type = $resolver->resolve('html-escaped-string'); echo get_class($type); // Radebatz\TypeInfoExtras\Type\ExplicitType echo $type->getExplicitType() // "html-escaped-string" $type = $resolver->resolve('class-string<Foo>'); echo get_class($type); // Radebatz\TypeInfoExtras\Type\ClassLikeType echo $type->getExplicitType(); // "class-string" echo get_class($type->getObjectType()); // Symfony\Component\TypeInfo\Type\ObjectType echo $type->getObjectType(); // Foo $type = $resolver->resolve('int<5,20>'); echo get_class($type); // Radebatz\TypeInfoExtras\Type\IntRangeType
If your code is doing instanceof checks on the returned Type, then you will need to add another case and treat
Radebatz\TypeInfoExtras\Tests\Type\ExplicitType same as BuiltinType.
统计信息
- 总下载量: 25.58k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-03-10