PHPackages                             villfa/tryagain - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. villfa/tryagain

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

villfa/tryagain
===============

The TryAgain library permits to call a function again if the result is wrong.

1.0.0(13y ago)015MITPHPPHP &gt;=5.3.3

Since Apr 20Pushed 8y ago1 watchersCompare

[ Source](https://github.com/villfa/TryAgain)[ Packagist](https://packagist.org/packages/villfa/tryagain)[ Docs](https://github.com/villfa/TryAgain)[ RSS](/packages/villfa-tryagain/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (1)Versions (1)Used By (0)

TryAgain
========

[](#tryagain)

[![Build Status](https://camo.githubusercontent.com/5b12459dbfed16f51ce69fc32c83d70f3fc90311a2dc77bde06542cd0ccfeeea/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f76696c6c66612f547279416761696e2e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/villfa/TryAgain)

TryAgain is a very light PHP library which permits to call a function again when the result is not satisfying.

The main advantage is that it permits to avoid code duplication by creating reusable validators.

Server Requirements
-------------------

[](#server-requirements)

- PHP version 7.0 or newer

Installation
------------

[](#installation)

TryAgain may be installed using Composer. You can read more about Composer and its main repository at [http://packagist.org](http://packagist.org "Packagist"). To install TryAgain using Composer, first install Composer for your project using the instructions on the Packagist home page. You can then define your development dependency on TryAgain using the suggested parameters below.

```
{
    "require": {
        "villfa/TryAgain": ">=1.0.0"
    }
}

```

To install, you then may call:

```
$ composer.phar install

```

Tests
-----

[](#tests)

To run the test suite, you need [composer](http://getcomposer.org) and [PHPUnit](https://github.com/sebastianbergmann/phpunit).

```
$ cd path/to/TryAgain
$ composer.phar install --dev
$ ./vendor/bin/phpunit

```

Example
-------

[](#example)

Here a minimalist example:

```
