scaleupstack / assert
A tiny wrapper around webmozart/assert that is easily extendable to throw project-specific assertions.
Installs: 1 523
Dependents: 4
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=7.2.0
- webmozart/assert: ^1.
Requires (Dev)
- phpunit/phpunit: ^7.
This package is auto-updated.
Last update: 2024-11-07 06:43:43 UTC
README
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
<?php declare(strict_types = 1); namespace Your\Namespace; use ScaleUpStack\Assert\Assert as BaseAssert; final class Assert extends BaseAssert { protected static $assertionClassName = CustomizedInvalidArgumentException::class; }
Contribute
Thanks that you want to contribute to ScaleUpStack/Assert.
-
Report any bugs or issues on the issue tracker.
-
Get the source code from the Git repository.
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