承接 artbyrab/integrio 相关项目开发

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

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

artbyrab/integrio

Composer 安装命令:

composer require artbyrab/integrio

包简介

Integrity check interfaces for your PHP library.

README 文档

README

Image

Integrio is a set of interfaces for building integrity checks for your products or features in PHP. Think of Integrio as the base skeleton for you to use as a foundation for your product and feature integrity code checks.

Example

You have customer records that you store in your database. However, there have been occasions where the customer records or their related sub records end up in states you dont expect. How can you solve this? Well before you can think about solving it, it's useful to be able to identify these states where the customer records or their related records have entered an invalid state. Essentially they would not pass an integrity check which is what we will validate.

Therefore we can use Integrio as a foundation to add code class that identify these invalid states which you can then include or call in console commands or cron jobs to check the state of the customer records.

For example you might want to check the customer records integrity by doing things like:

  • Check that customers do not have any enquiries that are in a 'Pending' state older than 7 days
  • Check that customers do not have any enquiries that are in an 'Errored' state

Integrio adds the class and interface framework for this to be easily done in a fairly basic but uniform way. For example we can use:

  • IntegrityCheckInterface.php for the CustomerRecordsIntegrityCheck.php class
  • ScenarioCheckInterface.php for:
    • EnquiriesErroredStateScenarioCheck.php
    • EnquiriesPendingStateScenarioCheck
  • All of the above would return a Result.php object which implements the ResultInterface.php class

An example of the CustomerRecordsIntegrityCheck->run() method as JSON:

{
  "Title": "Customer records integrity check",
  "State": "Fail",
  "Description": "The customer records integrity check failed.",
  "Resolution": "Check the sub result resolutions to resolve any issues.",
  "Sub Results": [
    {
      "Title": "Customer enquiries errored scenario check",
      "State": "Fail",
      "Description": "There should not be customer enquiries in a state of 'Errored' as they should all be processed.",
      "Resolution": "Run the 'updateCustomerEnquiriesState' command to process the customer enquiries with a 'Errored' state or check the resolution of the individual records.",
      "Sub Results": [
        {
          "Title": "A single customer enquiry errored scenario check",
          "State": "Fail",
          "Description": "Customer enquiry with an ID of 6 has an invalid state of 'Errored'",
          "Resolution": "Run the 'updateCustomerEnquiriesState --customerEnquiryID=6' command to try and reprocess this record individually."
        },
        {
          "Title": "A single customer enquiry errored scenario check",
          "State": "Fail",
          "Description": "Customer enquiry with an ID of 12 has an invalid state of 'Errored'",
          "Resolution": "Run the 'updateCustomerEnquiriesState --customerEnquiryID=12' command to try and reprocess this record individually."
        }
      ]
    },
    {
      "Title": "Customer enquiries pending scenario check",
      "State": "Fail",
      "Description": "There should not be customer enquiries in a state of 'Pending' as they should all be processed.",
      "Resolution": "Run the 'updateCustomerEnquiriesState' command to process the customer enquiries with a 'Pending' state."
    }
  ]
}

For more detailed information see the usage guide:

Requirements

  • PHP 8+

Features

  • Integrity check interfaces for your PHP library
  • Write code to check your systems and features integrity by implementing Integrio interfaces

Installation

The reccomended way to install is via Composer. Either install in the project via terminal

composer require artbyrab/integrio:~1.0

or add it to your composer.json file

"artbyrab/integrio": "~1.0"

Usage

Follow the usage guide

Resources

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2025-01-11