PHPackages                             ulrack/fallback - 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. ulrack/fallback

Abandoned → [grizz-it/fallback](/?search=grizz-it%2Ffallback)ArchivedLibrary[Utility &amp; Helpers](/categories/utility)

ulrack/fallback
===============

Fallback system for Ulrack.

1.0.1(6y ago)12MITPHPPHP ^7.2

Since Jul 16Pushed 6y ago1 watchersCompare

[ Source](https://github.com/ulrack/fallback)[ Packagist](https://packagist.org/packages/ulrack/fallback)[ RSS](/packages/ulrack-fallback/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

DEPRECATION NOTICE: this package has been moved and improved at [grizz-it/fallback](https://github.com/grizz-it/fallback)
=========================================================================================================================

[](#deprecation-notice-this-package-has-been-moved-and-improved-at-grizz-itfallback)

[![Build Status](https://camo.githubusercontent.com/f2b6f4e20d69f35a26f4605ede146fe1502dc548f5d821d75d721740ee8713e4/68747470733a2f2f7472617669732d63692e636f6d2f756c7261636b2f66616c6c6261636b2e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/ulrack/fallback)

Ulrack Fallback
===============

[](#ulrack-fallback)

This package contains an implementation for implementing a fallback system within a PHP application.

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

[](#installation)

To install the package run the following command:

```
composer require ulrack/fallback

```

Usage
-----

[](#usage)

A single fallback consists of one [FallbackStack](src/Component/FallbackStack.php)with multiple [Fallback](src/Component/Fallback.php)s.

### Creating a Fallback

[](#creating-a-fallback)

A fallback can be created by providing it with a callable, a (optional) validator and a (optional) set of parameters. The callable will be executed when it is reached inside the stack. The validator (see package: ulrack/validator) will be used to verify the output of the callable. The parameters are variadic and will override the parameters send by the stack.

An implementation would look like:

```
