GermaniaKG · NullFactory
, (*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