2017 © Pedro Peláez
 

library php-conditional

php conditional

image

dgame/php-conditional

php conditional

  • Sunday, April 9, 2017
  • by Dgame
  • Repository
  • 1 Watchers
  • 1 Stars
  • 1,834 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

php-conditional

Scrutinizer Code Quality, (*1)

Build Status, (*2)

enjoy conditional php-programming

<?php

use function Dgame\Conditional\debug;
use function Dgame\Conditional\version;

require_once 'vendor/autoload.php';

debug('foo')->enable();
debug('foo')->output('Hello, foo');
debug('foo')->then(function(string $label) {
    print 'Debug of ' . $label . ' is enabled' . PHP_EOL;
});

version('7.0.8')->isEqualTo(PHP_VERSION)->output('Hello PHP 7');
version('7')->isLowerOrEqualTo(PHP_VERSION)->then(function(string $version) {
    print 'Version ' . $version . ' is verified' . PHP_EOL;
});

version('7.0.9')->isEqualTo(PHP_VERSION)->output('Production')->otherwise(function(string $version) {
    print $version . ' does not match ' . PHP_VERSION . PHP_EOL;
});

//debug('foo')->output('This is 100% the end')->abort();
//debug('foo')->output('This may be the end')->abortIf(!isset($result));

version('7.1.0alpha2')->isProduction()->output('Production');

class FooBar
{
    public function test(string $label, string $note)
    {
        print __METHOD__ . ' [' . $label . '] : ' . $note . PHP_EOL;
    }
}

$fb = new FooBar();

debug('bar')->enable();
debug('bar')->then([$fb, 'test'], 'yay');

The Versions

09/04 2017

dev-master

9999999-dev https://github.com/php-conditional

php conditional

  Sources   Download

MIT

The Requires

 

The Development Requires

browser version os enviroment identification info conditional

31/01 2017

v0.5.1

0.5.1.0 https://github.com/php-conditional

php conditional

  Sources   Download

MIT

The Requires

 

The Development Requires

browser version os enviroment identification info conditional

23/01 2017

v0.5.0

0.5.0.0 https://github.com/php-conditional

php conditional

  Sources   Download

MIT

The Requires

 

The Development Requires

browser version os enviroment identification info conditional

03/11 2016

v0.4.0

0.4.0.0 https://github.com/php-conditional

php conditional

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

browser version os enviroment identification info conditional

12/10 2016

v0.3.0

0.3.0.0 https://github.com/php-conditional

php conditional

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

browser version os enviroment identification info conditional

18/09 2016

v0.2.0

0.2.0.0 https://github.com/php-conditional

php conditional

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

browser version os enviroment identification info conditional

16/07 2016

v0.1.2

0.1.2.0 https://github.com/php-conditional

php conditional

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

09/06 2016

v0.1.1

0.1.1.0 https://github.com/php-conditional

php conditional

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

09/06 2016

v0.1.0

0.1.0.0 https://github.com/php-conditional

php conditional

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires