承接 20steps/commons-ensure-bundle 相关项目开发

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

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

20steps/commons-ensure-bundle

Composer 安装命令:

composer require 20steps/commons-ensure-bundle

包简介

Symfony bundle with static helper functions for checking coding pre-/post-conditions

README 文档

README

Build Status Tested PHP Versions Dependency Status Packagist version

About

The 20steps Commons Ensure Bundle contains static helper functions for checking coding pre-/post-conditions. The check helps to fail early with a EnsureException in the case of missmatched assertions with a meaningful sprintf format message. In comparison to PHP's assert() command, the ensure checks are always enabled.

The 20steps Commons Ensure Bundle is licensed under the LGPL license version 3.0 (http://www.gnu.org/licenses/lgpl-3.0.html).

Installation

  1. Add the bundle to your composer.json and download a matching version by calling
composer require 20steps/common-ensure-bundle

Prerequisite: Install Composer, the dependency manager used by modern PHP applications.

Usage

The following code shows some simple method call using the Ensure Bundle.

<?php

use twentysteps\Commons\EnsureBundle\Ensure;

class Foo {

    private $name;

    public function bar($entityName, $num) {
        $this->name = Ensure::isNotEmpty($entityName, 'entityName must not be empty');
        Ensure::isGreaterThan(0, $num, 'num must be positive for entityName [%s]', $entityName);
        // do some stuff...
    }
}

Authors

Sponsored by

20steps - Digital Full Service Boutique

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: LGPL-3.0
  • 更新时间: 2014-06-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固