2017 © Pedro Peláez
 

library nullfactory

Factory callable that returns null or any other default value

image

germania-kg/nullfactory

Factory callable that returns null or any other default value

  • Wednesday, February 7, 2018
  • by germania-kg
  • Repository
  • 2 Watchers
  • 0 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

GermaniaKG · NullFactory

Packagist PHP version Build Status Scrutinizer Code Quality Code Coverage Build Status, (*1)

Installation with Composer

$ composer require germania-kg/nullfactory

Usage

<?php
use Germania\NullFactory\NullFactory;

$nf = new NullFactory;
$result = $nf( "anything" );
// null

To make NullFactory return something else, pass it to the constructor:, (*2)

<?php
use Germania\NullFactory\NullFactory;

$default_value = array("foo", "bar");

$nf = new NullFactory( $default_value );
$result = $nf( "anything" );
// array("foo", "bar")

The NullFactory also accepts a PSR3-Logger which defaults to NullLogger, (*3)

<?php
use Germania\NullFactory\NullFactory;
use Psr\Log\NullLogger;

$nf = new NullFactory( null, new NullLogger );
$result = $nf( "anything" );

Issues

See full issues list., (*4)

Roadmap

Fill in planned or desired features, (*5)

Development

$ git clone https://github.com/GermaniaKG/NullFactory.git
$ cd NullFactory
$ composer install

Unit tests

Either copy phpunit.xml.dist to phpunit.xml and adapt to your needs, or leave as is. Run PhpUnit test or composer scripts like this:, (*6)

$ composer test
# or
$ vendor/bin/phpunit

The Versions

07/02 2018

dev-master

9999999-dev

Factory callable that returns null or any other default value

  Sources   Download

MIT

The Development Requires

by Carsten Witt

07/02 2018

dev-develop

dev-develop

Factory callable that returns null or any other default value

  Sources   Download

MIT

The Development Requires

by Carsten Witt

07/02 2018

1.0.0

1.0.0.0

Factory callable that returns null or any other default value

  Sources   Download

MIT

The Development Requires

by Carsten Witt