Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

8 Commits

Repository files navigation

ScaleUpStack/Assert

This library is a tiny wrapper around webmozart/assert, a library that provides "Assertions to validate method input/output with nice error messages". ScaleUpStack/Assert allows you to extend that library easily to throw a project-specific exception in case an assertion is invalid.

The main reason of this library is, that you can extend it in your project without the need to write a unit test to get full code coverage.

The concept how to extend the base class was inspired by beberlei/assert.

Installation

Use Composer to install this library:

$ composer require scaleupstack/assert

Usage

<?phpdeclare(strict_types = 1);
namespaceYour\Namespace;
useScaleUpStack\Assert\AssertasBaseAssert;
finalclass Assert extends BaseAssert
{
protectedstatic$assertionClassName = CustomizedInvalidArgumentException::class;
}

Contribute

Thanks that you want to contribute to ScaleUpStack/Assert.

License

Please check LICENSE.md in the root dir of this package.

Copyright

ScaleUpVentures Gmbh, Germany
Thomas Nunninger thomas.nunninger@scaleupventures.com
www.scaleupventures.com

About

A tiny wrapper around webmozart/assert that is easily extendable to throw project-specific assertions.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages