2017 © Pedro Peláez
 

symfony-bundle commons-ensure-bundle

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

image

20steps/commons-ensure-bundle

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

  • Monday, May 7, 2018
  • by marc-ewert
  • Repository
  • 2 Watchers
  • 0 Stars
  • 1,134 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

20steps/commons-ensure-bundle (twentystepsCommonsEnsureBundle)

Build Status Tested PHP Versions Dependency Status Packagist version, (*1)

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., (*2)

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

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., (*4)

Usage

The following code shows some simple method call using the Ensure Bundle., (*5)

<?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

20steps - Digital Full Service Boutique, (*6)

The Versions

07/05 2018

dev-master

9999999-dev https://github.com/20steps/commons-ensure-bundle

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

  Sources   Download

LGPL-3.0+

The Requires

 

symfony2 sf2 sf3 symfony3 20steps symfony assert ensure defensive coding

07/05 2018

1.0.2

1.0.2.0 https://github.com/20steps/commons-ensure-bundle

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

  Sources   Download

LGPL-3.0+

The Requires

 

symfony2 sf2 sf3 symfony3 20steps symfony assert ensure defensive coding

16/12 2016

v1.0.1

1.0.1.0 https://github.com/20steps/commons-ensure-bundle

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

  Sources   Download

LGPL-3.0+

The Requires

 

symfony2 sf2 sf3 symfony3 20steps symfony assert ensure defensive coding

14/12 2016

v1.0.0

1.0.0.0 https://github.com/20steps/commons-ensure-bundle

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

  Sources   Download

LGPL-3.0+

The Requires

 

symfony2 sf2 sf3 symfony3 20steps symfony assert ensure defensive coding