承接 ksfraser/validation 相关项目开发

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

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

ksfraser/validation

最新稳定版本:v0.1.0

Composer 安装命令:

composer require ksfraser/validation

包简介

Small validation helpers and traits (PHP 7.3+) for KS Fraser modules migration.

README 文档

README

PHP 7.3+ validation helpers and traits intended to replace legacy Origin-style ad-hoc validation during the library split.

Design goals

  • No framework dependencies.
  • Usable from DTOs, repositories, service classes.
  • Prefer composition/traits over deep inheritance.
  • Throw a consistent exception type (ValidationException).

Usage

Static helper

use Ksfraser\Validation\Assert;

Assert::notEmptyString($bankAccountNumber, 'bankAccountNumber');
Assert::stringMaxLen($bankAccountNumber, 255, 'bankAccountNumber');

Trait (thin wrapper over Assert)

use Ksfraser\Validation\Traits\ValidatesStringTrait;

final class Example
{
    use ValidatesStringTrait;

    public function setCode($code)
    {
        $this->assertNotEmptyString($code, 'code');
        $this->assertStringMaxLen($code, 20, 'code');
    }
}

Relationship to the split

This package was introduced as part of the long-running split of a legacy “ksf_modules_common” folder into multiple Composer packages.

If you are working inside that monorepo/workspace, see the local docs there:

  • LIBRARY_SPLIT_ANALYSIS.md
  • repos/fa_classes/MIGRATION_NOTES.md
  • repos/ksf_ModulesDAO/README.md

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固