承接 dealnews/constraints 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

dealnews/constraints

最新稳定版本:v3.0.0

Composer 安装命令:

composer require dealnews/constraints

包简介

Type constraint checking library

README 文档

README

A library for testing primitive and abstract data types in PHP with type juggling.

Supported Primitive Types

  • Integer
  • String
  • Array
  • Double (aka float)
  • Boolean
  • Any defined PHP class

Supported Abstract Types

  • Bytes
  • US Currency
  • Date
  • DateTime
  • Length
  • Range
  • Time
  • URL
  • URL Path
  • Year

Extendable

The base Constraint class can be extended to add new abstract types.

Example

// A very simple example $constraint = \DealNews\Constraints\Constraint::init(); $value = "1"; try { $value = $constraint->check($value, ["type" => "integer"]); // $value will now be integer 1 } catch (\DealNews\Constraints\ConstraintException $e) { echo $e->getMessage(); }

统计信息

  • 总下载量: 10.61k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 7
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固