|
| 1 | +PHPQA |
| 2 | +============================================= |
| 3 | +PHPQA Analyzer CLI tool |
| 4 | + |
1 | 5 | <!-- START doctoc generated TOC please keep comment here to allow auto update --> |
2 | 6 | <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> |
3 | 7 |
|
4 | | -- [PHPQA](#phpqa) |
5 | | - - [Based on:](#based-on) |
6 | | - - [Install Stand Alone](#install-stand-alone) |
7 | | - - [Clone project](#clone-project) |
8 | | - - [Install dependencies](#install-dependencies) |
9 | | - - [Create symbolink link](#create-symbolink-link) |
10 | | - - [Include in your project](#include-in-your-project) |
11 | | - - [How to run this project](#how-to-run-this-project) |
| 8 | +- [Overview](#overview) |
| 9 | +- [Install Stand Alone](#install-stand-alone) |
| 10 | + - [Clone project](#clone-project) |
| 11 | + - [Install dependencies](#install-dependencies) |
| 12 | + - [Create symbolink link](#create-symbolink-link) |
| 13 | +- [Include in your project](#include-in-your-project) |
| 14 | +- [How to run this project](#how-to-run-this-project) |
12 | 15 |
|
13 | 16 | <!-- END doctoc generated TOC please keep comment here to allow auto update --> |
14 | 17 |
|
15 | | -PHPQA |
16 | | -============================================= |
17 | | -PHPQA Analyzer CLI tool |
| 18 | +## Overview |
| 19 | +This project aims to serve as a CLI tool to unify the use of different PHP tools related to Quality Assurance and code analysis in PHP. |
18 | 20 |
|
19 | | -## Based on: |
20 | | -http://carlosbuenosvinos.com/write-your-git-hooks-in-php-and-keep-them-under-git-control/ |
21 | | -http://phpqatools.org/ |
| 21 | +Every analyzer tool handles arguments and options using different formats, the goal of this project is to provide and single way to interact with those projects, you can also set options and arguments using the default configuration file the project supports. |
22 | 22 |
|
23 | | -## Install Stand Alone |
| 23 | +> This project was originally developed as part of [Drupal Console](https://github.com/hechoendrupal/DrupalConsole) and based on the blog post [Write your git hooks in PHP and keep them under git control](http://carlosbuenosvinos.com/write-your-git-hooks-in-php-and-keep-them-under-git-control/). |
24 | 24 |
|
25 | | -### Clone project |
| 25 | +## Install |
26 | 26 |
|
27 | | -``` |
| 27 | +### Cloning the project |
| 28 | +```bash |
28 | 29 | $ cd ~ |
29 | 30 | $ git clone git@github.com:jmolivas/phpqa.git |
30 | | -``` |
31 | | - |
32 | | -### Install dependencies |
33 | | - |
34 | | -``` |
35 | 31 | $ cd phpqa |
| 32 | +# download dependencies |
36 | 33 | $ composer install |
| 34 | +# make phpqa globally accessible creating a symlink |
| 35 | +$ ln -s ~/phpqa/bin/phpqa.php /usr/local/bin/phpqa |
37 | 36 | ``` |
38 | 37 |
|
39 | | -### Create symbolink link |
40 | | - |
41 | | -``` |
42 | | -ln -s ~/phpqa/bin/phpqa.php /usr/local/bin/phpqa |
| 38 | +## Using Composer |
| 39 | +```bash |
| 40 | +$ composer global require jmolivas/phpqa |
| 41 | +# Make sure you add ~/.composer/vendor/bin/ to your PATH. |
43 | 42 | ``` |
44 | 43 |
|
45 | | -## Include in your project |
46 | | -``` |
47 | | -$ composer require jmolivas/phpqa |
48 | | -``` |
| 44 | +## Usage |
49 | 45 |
|
50 | | -## How to run this project |
| 46 | +### Copy configuration files to user home directory |
51 | 47 | ``` |
52 | | -# Make sure you run this command the first time |
53 | 48 | $ phpqa init |
| 49 | +``` |
54 | 50 |
|
55 | | -# Run this command to test your project code |
56 | | -$ phpqa analyze --project=php --files=src/ |
| 51 | +### Analyze a project |
| 52 | +``` |
| 53 | +$ cd to/project/path |
| 54 | +$ phpqa analyze --project=PROJECT --files[=FILES] |
57 | 55 | ``` |
58 | 56 |
|
59 | | -> Note: This project is a work-in-progress need some love related to code clean up and testing coverage. |
| 57 | +**Options:** |
| 58 | + |
| 59 | +| Option | Description | |
| 60 | +| ------- | ----------------------------- | |
| 61 | +| project | Available default values php, symfony and drupal | |
| 62 | +| files | If this option is not set then the files added to git index will be scanned. This is useful when setting executing this tool on a git-hook pre-commit. | |
| 63 | + |
| 64 | +> Note: This project is a work-in-progress and need some love related to code clean up and testing coverage. |
0 commit comments