Download the PHP package mixteer/reshi without Composer

On this page you can find all versions of the php package mixteer/reshi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package reshi

Reshi - facilitating assertive programming

"If It Can't Happen, Use Assertions to Ensure That It Won't" -- A. Hunt and D. Thomas in The Pragmatic Programmer.

Reshi is an assertion library that it meant to check constraints you impose on say function input parameters. The idea behind it is that of assertive programming as found in Section 23, Chapter 4 of the book The Pragmatic Programmer.

You use Reshi to make sure that event that you think will never occur doesn't cause damage in case it does occur. See Section 22 Dead programs tell no lies of the same chapter.

Install

The library is available on packagist and installable via composer.

Concepts

The 3 main concepts about the why and how of this library are derived from The Pragmatic Programmer in Chapter 4:

  1. Assertive programming - you use assertions to make sure things that shouldn't normally happen are guarded against just in case they do happen.

  2. Dead programs tell no lies - if an assertion fails, the library triggers a E_USER_ERROR error which ends the program immediately. You'll have an error handler which should log this error as it will contain the details of which assertion failed and details like file name and line number.

  3. Use exceptions for exceptional cases - the library doesn't throw an exception when the assertion fails simply to help avoid someone catching the exception, doing nothing with it and hence the program might continue. Yes, errors can be converted into exceptions but going to all that trouble assumes you have a good idea and fair reason for doing so. Note that while assertions help guard against rare bad events, those are not part of your business logic so use of exceptions here is not a good idea. But when the library methods are given wrong parameters, the will emit exceptions because that's part of their business logic.

Usage

Using the library is fairly simple:

It is very likely that you'll use this method in a class and $this->assertThat will pause a problem since PHP will look for the method assertThat in the current class.
There are a number of ways to go around this problem:

For developers heavily using domain models, the __call method would ideally go on a Layer supertype so as to avoid duplication.

Usage go as this:

Assertions

This is not an exhaustive list of assertions yet but we re adding more in this documentation and in the code as fast as we can.

For now, looking into the Assertion.php file will show all the assertions. Bellow is an undocumented list of the assertions but we'll documenting them slowly.

Each of those static methods has an instance counterpart (which might not have the same "signature" and a negation counterpart as well.

Adding new assertions

Reshi allows you to create new assertions of your own.
To add a new assertion, you just implement the interface ReshiConstraint. Follow the example bellow to see how this is done.

Now you can use MyAssertion instead of Assertion and have access to both your assertions and the existing assertions.

About

Requirements

Reshi has been test on PHP 5.5 but all the features should work from PHP 5.3 - see composer.json. Testing on other platforms is welcome. Email one the authors bellow.

Bugs and feature requests

All bugs and feature requests are tracked on GitHub.

Contributing

Please send us a pull request.

Tests

To run tests:

Authors

Ntwali Bashige - [email protected] - http://twitter.com/nbashige
Armando Sudi - https://github.com/ArmandoSudi

License

Reshi is licensed under MIT, see LICENSE file.

Acknowledgment

The assertions are inspired from PHPUnit.


All versions of reshi with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mixteer/reshi contains the following files

Loading the files please wait ....