承接 atyagi/specifier 相关项目开发

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

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

atyagi/specifier

最新稳定版本:v1.0.0

Composer 安装命令:

composer require atyagi/specifier

包简介

A library to help implement the specification design pattern

README 文档

README

Build Status Coverage Status Latest Version

Provides a basic set of classes to utilize the specification design pattern.

Usage

The included tests provide common usage of the classes.

Basic Usage

Upon creating your specification classes, simply extend the AbstractSpecification class and implement the isSatisfiedBy method.

Any specifications that you create are flexible enough to take in any arguments in the constructor, such as repositories or services.

In addition, an isNotSatisfiedBy method is provided to provide a logical not if needed.

Composite Usage

When you need to chain multiple specifications on the same object, you can leverage the AbstractSpecification chain methods plus and either.

For example:

(new CustomerIsPremium())
    ->either(new CustomerRegisteredBeforeLastWeek())
    ->isSatisfiedBy($customer);

or

(new CustomerIsPremium())
    ->plus(new CustomerRegisteredBeforeLastWeek())
    ->isSatisfiedBy($customer);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-06-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固