PHPackages                             uuf6429/elder-brother - 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. uuf6429/elder-brother

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

uuf6429/elder-brother
=====================

Set up and manage contribution policies for your PHP-based projects.

v1.0.2(9y ago)316[5 issues](https://github.com/uuf6429/elder-brother/issues)[1 PRs](https://github.com/uuf6429/elder-brother/pulls)MITPHPPHP ^5.5.0 || ^7.0

Since Nov 28Pushed 9y ago2 watchersCompare

[ Source](https://github.com/uuf6429/elder-brother)[ Packagist](https://packagist.org/packages/uuf6429/elder-brother)[ Docs](https://github.com/uuf6429/elder-brother)[ RSS](/packages/uuf6429-elder-brother/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (4)Versions (5)Used By (0)

Elder Brother
=============

[](#elder-brother)

[![Build Status](https://camo.githubusercontent.com/9135ec37794365af1d7e3780a4cb6b0709a2c885c1e30a32b6c3ebf8569296c2/68747470733a2f2f7472617669732d63692e6f72672f757566363432392f656c6465722d62726f746865722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/uuf6429/elder-brother)[![Minimum PHP Version](https://camo.githubusercontent.com/98118bf0a3c8b650013ffc8a5d96731efc81154ae06ef7133f378875dedea4f6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230352e352d3838393242462e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://raw.githubusercontent.com/uuf6429/elder-brother/master/LICENSE)[![Coverage](https://camo.githubusercontent.com/625d6127633c79a07c6f4d58a0b6ce3c64dc62dacfc54f811fe5abc50e05b012/68747470733a2f2f636f6465636f762e696f2f67682f757566363432392f656c6465722d62726f746865722f6272616e63682f6d61737465722f67726170682f62616467652e7376673f746f6b656e3d4275326e4b324b713737)](https://codecov.io/github/uuf6429/elder-brother?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/613876a0d6f977316e185ea6f6e0c2b863dce0d5b165c47f15155956a798009b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f757566363432392f656c6465722d62726f746865722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/uuf6429/elder-brother/?branch=master)[![Packagist](https://camo.githubusercontent.com/dc0d98b5e20eac1058e2855a662b73cbf0110f1d2baa5fc41aaf9970525d59bb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f757566363432392f656c6465722d62726f746865722e737667)](https://packagist.org/packages/uuf6429/elder-brother)

Elder Brother automatically regulates contributions before reaching your project.

Using events such as [Git-hooks](http://githooks.com/), one can ease development in various ways, such as:

- ensure code style conformity before committing changes
- run tools whose output should be a part of the commit
- performing roll-backs when checking-out old commits
- compiling sources or performing migrations when checking-out newer commits

This tools makes it easy to set up these tasks, as well as putting such policies under version control.

Table Of Contents
-----------------

[](#table-of-contents)

- [Elder Brother](#elder-brother)
    - [Table Of Contents](#table-of-contents)
    - [Installation](#installation)
    - [Usage](#usage)
    - [Available Actions](#available-actions)
        - [Execute Custom Code (ExecuteCode)](#execute-custom-code-executecode)
        - [Execute External Program (ExecuteProgram)](#execute-external-program-executeprogram)
        - [Disallow Files (ForbiddenFiles)](#disallow-files-forbiddenfiles)
        - [PHP Code Style Fixer (PhpCsFixer)](#php-code-style-fixer-phpcsfixer)
        - [PHP Code Style Fixer (PhpCsFixerOld)](#php-code-style-fixer-phpcsfixerold)
        - [PHP Syntax Check (PhpLinter)](#php-syntax-check-phplinter)
        - [Show Warning For Files (RiskyFiles)](#show-warning-for-files-riskyfiles)
    - [FAQ](#faq)

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

[](#installation)

1. Add the library to your project with [Composer](https://getcomposer.org/):

    ```
    $ composer require neronmoon/scriptsdev
    $ composer require uuf6429/elder-brother "~1.0" --dev
    ```

    **Notes:**

    - in this way, *Elder Brother* will only be installed during development (Composer should be run with `--no-dev` in production).
    - `scriptsdev` package will make installation work during development and not break during production.
    - you may still have to install additional packages (detailed below) to use some particular actions.
2. Add the following entry to your `composer.json`:

    ```
    {
        "scripts-dev": {
            "post-install-cmd": "vendor/bin/elder-brother install",
            "post-update-cmd": "vendor/bin/elder-brother install"
        }
    }
    ```
3. Create a `.brother.php` config file (as described below) and add `.brother.local.php` to your `.gitignore` file (this allows for user-level config).

Usage
-----

[](#usage)

Elder Brother by default reads configuration from two files, `.brother.php` and `.brother.local.php` (which should be ignored by your VCS).

A typical configuration file will be structured like this:

```
