2017 © Pedro Peláez
 

library php-comparison

The most awesome comparison engine created for php

image

phpzendo/php-comparison

The most awesome comparison engine created for php

  • Saturday, June 9, 2018
  • by huliuqing
  • Repository
  • 0 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Build Status , (*1)

About PHP-COMPARISON

The most awesome comparison engine created for php., (*2)

Features

  • Provide uniform empty method.
  • Provide uniform isset method.
  • Provide uniform is null method.
  • Provide the functionality to compare PHP values for great than, less than, great than or equal and less than or equal check.
  • Much more.

Requires

  • PHP version 7.1+.
  • sebastian/comparator component.
  • florianwolters/component-core-comparable component.

Installation

You can add this library as a local, per-project dependency to your project using Composer:, (*3)

composer require phpzendo/php-comparison

If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency:, (*4)

composer require --dev phpzendo/php-comparison

Usage

Verify the given value is empty.

<?php

use PhpZendo\Comparison\Compare;

$comparator = Compare::getInstance();
$comparator->empty(null);

Verify the given value is null.

<?php

use PhpZendo\Comparison\Compare;

$comparator = Compare::getInstance();
$comparator->isNull(null);

Verify the given value is set.

<?php

use PhpZendo\Comparison\Compare;

$comparator = Compare::getInstance();
$comparator->isset(null);

Compare two values.

<?php

use PhpZendo\Comparison\Compare;

$comparator = Compare::getInstance();

$comparator->gt($expected = 2, $actual = 1);// Check $expected great than $actual.
$comparator->gte($expected = 1, $actual = 1);// Check $expected great than or equal $actual.
$comparator->lt($expected = 1, $actual = 2);// Check $expected less than $actual.
$comparator->lte($expected = 2, $actual = 2);// Check $expected less than or equal $actual.

Change Log

2018-06-04 17:05

Established!, (*5)

2018-06-09 22:36

Add compare helper functions., (*6)

The Versions

09/06 2018

dev-master

9999999-dev

The most awesome comparison engine created for php

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar huliuqing

08/06 2018

v1.0.1

1.0.1.0

The most awesome comparison engine created for php

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar huliuqing

04/06 2018

v1.0.0

1.0.0.0

The most awesome comparison engine created for php

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar huliuqing