stellar-php/stellar

View on GitHub
src/Common/Dummy.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php declare(strict_types=1);

namespace Stellar\Common;

/**
 * Simple helper class which returns some empty dummy types. Useful for unit tests or when needing
 * (empty) default values.
 *
 * @see:unit-test \UnitTests\Common\DummyTests
 * @codeCoverageIgnore
 */
final class Dummy extends StaticClass
{
    /**
     * Return an anonymously created empty object.
     *
     * @return object
     */
    public static function anonymousObject()
    {
        return new class
        {
        };
    }

    /**
     * Return an empty Closure.
     */
    public static function closure() : \Closure
    {
        return function () {
        };
    }
}