承接 tonicforhealth/health-checker-check 相关项目开发

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

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

tonicforhealth/health-checker-check

最新稳定版本:v0.2.1

Composer 安装命令:

composer require tonicforhealth/health-checker-check

包简介

Base interface and abstract level of the checker for health-checker

README 文档

README

License Build Status Scrutinizer Code Quality Code Coverage SensioLabsInsight

This is base interface and abstract level of the checker.

Installation using Composer

$ composer require tonicforhealth/health-checker-check

Requirements

  • PHP 5.5 or higher

Usage

<?php

use TonicHealthCheck\Check\AbstractCheck;

class WeekendCheck extends AbstractCheck
{
    const GROUP = 'date';
    const COMPONENT = 'weekend';
    const CHECK = 'weekend-date-check';

    public function __construct($checkNode)
    {
        parent::__construct($checkNode);
    }

    /**
     * @throws giCheckException
     */
    public function performCheck()
    {
        if ($this->isNotWeekend(date())) {
            throw new CheckException('Unfortunately weekend isn\'t today.');
        }
    }

    protected function isNotWeekend($date)
    {
        return date('N', strtotime($date)) >= 6;
    }
}

$WeekendCheckI = new WeekendCheck('testnode');

$result = $WeekendCheckI->check();

if (!$result->isOk()) {
    echo $result->getError()->getMessage();
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-03-09