定制 haeckel/generics 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

haeckel/generics

最新稳定版本:0.2.0

Composer 安装命令:

composer require haeckel/generics

包简介

Support for generic classes

README 文档

README

codecov ci Static Badge Static Badge Packagist License

haeckel/php-generics

haeckel/generics is a php Library for dealing with generic data structures. It aims for simplicity and being fully typesafe at runtime, so unit tests will make errors visible. Uses PHPStan's generic syntax for type documentation and static analysis.

Features

  • Types classes that denote php types for usage, where the native type system cannot be used, e.g. in terms of generics for parameters, because they violate the LSP rules. All type classes can be used to type check at runtime and you can get a string representation that matches the native php notation.
  • Filters the filter interfaces enforce callable signatures, by specifying the __invoke() method signature. These are used to filter generic data structures (e.g. find a subset of a collection) or to remove specific elements.
  • Struct contains standard data structures that support generic usage. There is always an interface and an abstract base class for these structures.

PHPStan

This project uses the max level of PHPStan and phpstan/phpstan-strict-rules to ensure the code follows a good standard. Here are the places, where @phpstan-ignore is used to step around a check (cf. unsafe mode in rust or go, where you can opt out of compiler guarantees).

Installation

composer require haeckel/generics

Usage

See the tests Folder for runnable implementations.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Source Code

Support

Let us know if you have issues.

Issue Tracker

License

LGPL-3.0-or-later

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: LGPL-3.0-or-later
  • 更新时间: 2025-09-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固