PHPackages                             wata727/pahout - 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. wata727/pahout

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

wata727/pahout
==============

A pair programming partner for writing better PHP

0.7.0(7y ago)4814.8k2[1 issues](https://github.com/wata727/pahout/issues)[1 PRs](https://github.com/wata727/pahout/pulls)1MITPHPPHP &gt;=7.1.0

Since Aug 21Pushed 6y ago5 watchersCompare

[ Source](https://github.com/wata727/pahout)[ Packagist](https://packagist.org/packages/wata727/pahout)[ RSS](/packages/wata727-pahout/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (6)Versions (11)Used By (1)

Pahout
======

[](#pahout)

[![Build Status](https://camo.githubusercontent.com/fc99a29d4019addce937e1698ff0c327b5ed2c10813639859f64df4a36668a5d/68747470733a2f2f7472617669732d63692e6f72672f776174613732372f7061686f75742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/wata727/pahout)[![Latest Stable Version](https://camo.githubusercontent.com/3b275e3cba4444835835e3f50e3e674f637e6350ca8d46933b80133a2305bddc/68747470733a2f2f706f7365722e707567782e6f72672f776174613732372f7061686f75742f762f737461626c65)](https://packagist.org/packages/wata727/pahout)[![Docker Hub](https://camo.githubusercontent.com/7aa3db3a76815f8fcf908306a6362b4d888fb1666e3ca528782576d6da67b986/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f636b65722d72656164792d626c75652e737667)](https://hub.docker.com/r/wata727/pahout/)[![MIT License](https://camo.githubusercontent.com/db79b92834d905629b1aea42c9aa493da02060189e2af90840b1be5d6bf6ddf7/687474703a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c6174)](LICENSE)

A pair programming partner for writing better PHP. Pahout means PHP mahout 🐘

Motivation
----------

[](#motivation)

PHP has been added various features in the long history. However, due to the length of its history, many old syntax is scattered over the Internet. If a PHPer learned from them, the PHPer cannot know the excellent syntax and functions existing in the latest PHP version. This is a very sad thing.

So, I thought about making a linter like a pair programming partner who tells you a good way. It will help you write better PHP with you.

However, please do not try to fix all existing codes based on the hints of Pahout first. Pahout is a pair programming partner. When pairing programming, you don't check all existing codes, do you? My recommendation is to only check on newly created or modified files. For example, it is a good idea to set pre-commit hook as follows:

```
#!/bin/sh

git diff --name-only | grep .php | xargs vendor/bin/pahout
if ["$?" -ne 0]; then
    exit 1
fi
```

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

[](#installation)

Pahout requires the following environment:

- PHP 7.1 or newer
- [php-ast](https://github.com/nikic/php-ast) v0.1.7 or newer

### Using Composer

[](#using-composer)

You can install with composer.

```
$ composer require --dev wata727/pahout
$ vendor/bin/pahout -V

```

### Using Docker

[](#using-docker)

By using the [Docker image](https://hub.docker.com/r/wata727/pahout/), you can easily try Pahout without affecting the local environment.

```
$ docker run --rm -t -v $(pwd):/workdir wata727/pahout

```

Quick Start
-----------

[](#quick-start)

You are using PHP 7.1.8 in your project. What do you think of the following code?

```
