PHPackages                             leanphp/common-dev - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. leanphp/common-dev

ActiveLibrary[Testing &amp; Quality](/categories/testing)

leanphp/common-dev
==================

A set of modern PHP Development Tools and Libraries

v7.2.0(8y ago)135081[1 issues](https://github.com/leanphp/common-dev/issues)MITPHPPHP ^7.1

Since Sep 9Pushed 8y ago1 watchersCompare

[ Source](https://github.com/leanphp/common-dev)[ Packagist](https://packagist.org/packages/leanphp/common-dev)[ Docs](https://github.com/leanphp/common-dev)[ RSS](/packages/leanphp-common-dev/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (24)Versions (51)Used By (0)

common-dev
==========

[](#common-dev)

[![License](https://camo.githubusercontent.com/d30e398dfc1e22875aa1c5b2a7020859f8f48ff0049f4e0380d4eb976d36896e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c65616e7068702f636f6d6d6f6e2d6465762e7376673f7374796c653d666c61742d737175617265)](#License)[![Latest Stable Version](https://camo.githubusercontent.com/e4866d08e0ac671832991059f73bd6bb4ceb401ef502d787665c0903ba65c1c7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c65616e7068702f636f6d6d6f6e2d6465762e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/leanphp/common-dev)[![Total Downloads](https://camo.githubusercontent.com/2161aeda6346bbcb3205cf0f11bcd7916f6ab8249700273f60d982bfde8185fc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c65616e7068702f636f6d6d6f6e2d6465762e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/leanphp/common-dev)[![Travis](https://camo.githubusercontent.com/6633eea78d173cb8ec42767edc9f1d03cadf76f8385d479ab7291501e80b90b0/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6c65616e7068702f636f6d6d6f6e2d6465762e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/leanphp/common-dev)[![Pre Release](https://camo.githubusercontent.com/9913b24ba6264322283534b86acce1a92a7ae60eedfcb6f319063fd05bd90197/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f767072652f6c65616e7068702f636f6d6d6f6e2d6465762e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/leanphp/common-dev)

[leanphp/common-dev](https://packagist.org/packages/leanphp/common-dev) is a set of modern **PHP 7+** development tools and libraries, which help you write PHP packages and libraries that comply with [PHP-FIG](http://www.php-fig.org) standards and adhere to best PHP practices defined in [PHP - The Right Way](http://www.phptherightway.com) guidelines.

**Note!** These tools help you write **well-tested** functional &amp; **OOP** code ([TDD](https://en.wikipedia.org/wiki/Test-driven_development), [BDD](https://en.wikipedia.org/wiki/Behavior-driven_development), [SOLID](https://en.wikipedia.org/wiki/SOLID_(object-oriented_design))). This meta-package should serve more as an example set of development tools that one can use. This package helps when you want to hack something quick, however for serious projects you are advised to compile a custom list of development dependencies in `composer.json` of your project, instead of depending on this package directly.

See [Packages](#Packages) for a list of packages that this meta-package provides. [Usage](#Usage) section covers information regarding various tools and libraries. Additionally, we provide [example configuration files](#Configuration) for various tools that this package provides (`config/`directory).

Install
-------

[](#install)

Install this package as a development requirement in your project:

```
$ composer require --dev leanphp/common-dev

```

Packages
--------

[](#packages)

This package will trigger installation of various PHP [Libraries](#Libraries)and \[Development Tools\](#Development Tools).

### Libraries

[](#libraries)

This is a list of PHP Libraries that this package installs:

- [symfony/var-dumper](#var-dumper) **v3** - Advanced Variable Dumper by Symfony project (`dump()` instead of `var_dump()`).
- [Mockery](#Mockery) **v1.0** - a simple yet flexible PHP mock object framework for use in unit testing.
- [Prophecy](#Prophecy) - highly opinionated mocking framework for PHP.
- [Alice](#Alice) - Expressive Fixtures generator based on [Faker](#Faker).
- [Faker](#Faker) - PHP Library to generate fake data for you.
- [vfsStream](#vfsStream) - Virtual file system to mock the real file system in unit tests.
- [PHPUnit](#PHPUnit) **v6** - The PHP Unit Testing framework.
- [PHPSpec](#PHPSpec) **v4** - SpecBDD / BDD Testing framework for PHP with extensions:
    - [phpspec-code-coverage](https://github.com/leanphp/phpspec-code-coverage) - Code Coverage for [PHPSpec](http://www.phpspec.net).
    - [phpspec-typehintedmethods](http://github.com/ciaranmcnulty/phpspec-typehintedmethods) - Generate Typehinted methods
- [behat](#Behat) **v3** - ScenarioBDD / BDD Testing framework for PHP, with extensions:
    - [behat/mink-extension](http://extensions.behat.org/mink) - [Mink](http://mink.behat.org) extension for [behat](http://behat.org).
    - [behat/mink-goutte-driver](https://github.com/minkphp/MinkGoutteDriver) - [Goutte](https://github.com/FriendsOfPHP/Goutte) driver for [Mink](http://mink.behat.org).
    - [behat/mink-browserkit-driver](https://github.com/minkphp/MinkBrowserKitDriver) - Symfony BrowserKit driver for [Mink](http://mink.behat.org).
- [Mink](#Mink) - Browser Emulator / Abstraction framework for PHP.

### Development Tools

[](#development-tools)

This is a list of PHP Development Tools that this package installs:

- [Sami](#Sami) - An API Documentation generator.
- [PHPStan](#PHPStan) - PHP Static Analysis tool.
- [PHPMD](#PHPMD) **v2** - PHP Mess Detector. Optimize your code, reduce complexity, cleanup unused parameters, methods, variables &amp; more.
- \[PHP\_CodeSniffer\](#PHP CodeSniffer) **v3** - PHP Code Sniffer ensures that your code remains clean and consistent. It is a set of scripts to detect and automatically correct violations of a defined coding standard.
- [phpcs-symfony2-standard](https://github.com/leaphub/phpcs-symfony2-standard) - Symfony2 Coding Standard configuration for [PHP\_CodeSniffer](https://pear.php.net/package/PHP_CodeSniffer).
- [phpcpd](#phpcpd) - Copy/Paste Detector (CPD) for PHP code.
- [phploc](#phploc) - a tool that quickly measures the size of your PHP project.
- [composer](https://getcomposer.org) binary is also included in this package (`bin/composer`).

Usage
-----

[](#usage)

**Note!** When executing command we will use `bin/command` as an example. This requires `bin-dir` parameter set in `composer.json` of your project:

```
    "config": {
        "bin-dir": "bin"
    },
```

If `bin-dir` is not set, use `./vendor/bin` prefix when running command line tools.

### Libraries

[](#libraries-1)

#### var-dumper

[](#var-dumper)

[symfony/var-dumper](https://github.com/symfony/var-dumper) is an Advanced Variable Dumper by Symfony project. It provides developer with `dump()` function which is a better alternative to `var_dump()` or `print_r()`. It provides well formatted output, which adapt depending on context (console, browser) and packs nice additional features.

This package add **global function** `dump()`, which can be called from anywhere in your code:

```
