Smart/Static Analyzer(sis) for PHP :bowtie::neckbeard:
Clone or download
Latest commit 3c2b8e6 Apr 10, 2018
Permalink
Failed to load latest commit information.
.github [Docs] Update rebase and testing sections Nov 24, 2016
bin Setup xdebug.max_nesting_level to 3k Sep 14, 2015
docs Var duplicate in Closure use statement Nov 19, 2017
fixtures
plugins/codeclimate [CodeClimate] Dockerfile - install git/unzip for composer and after p… Jan 5, 2017
sandbox
src Missing variable Apr 11, 2018
tests Remove test from CompileTest Apr 11, 2018
.codeclimate.yml Minimize Codeclimate Engine Dec 25, 2016
.editorconfig
.gitignore Ignore compiled phar Aug 21, 2015
.pharcc.yml [Pharcc] Ignore yml May 25, 2016
.phpsa.yml config update Apr 11, 2018
.scrutinizer.yml Let scrutinizer ignore analyzer fixtures Sep 28, 2016
.travis.yml Remove hhvm testing Feb 9, 2018
LICENSE [Docs] Contributing guide (#140) Sep 26, 2016
Makefile Fixed Makefile(Remove command option for phpcs) (#320) Feb 4, 2017
README.md Update required version in readme Feb 13, 2018
composer.json Update dependencies Feb 9, 2018
phpcs.xml.dist Added phpcs.xml Jan 30, 2017
phpmd.xml.dist Move folder - unit-tests -> tests Jul 5, 2015
phpunit.xml.dist Use autoload-dev instead of a bootstrap file for phpunit. Sep 12, 2016

README.md

Logo

PHPSA - Smart Analyzer for PHP

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version License

PHPSA is a development tool aimed at bringing complex analysis for PHP applications and libraries.

P.S This software is currently in early alpha state, any contributions/stars will be awesome.

Components

  • Core - Component containing definitions and other core files
  • Compiler - Component to compile expression(s) and statement(s) from an abstract syntax tree
  • Analyzer - Component doing various checks on your files
  • ControlFlow - Component for ControlFlow (WIP)

Installation (more)

The recommended way to install phpsa is via Composer.

Run php composer.phar require ovr/phpsa or add a new requirement in your composer.json.

{
  "require": {
    "ovr/phpsa": "*"
  }
}

How to use (more)

$ ./bin/phpsa check fixtures/

Syntax error:  Syntax error, unexpected T_RETURN on line 11 in fixtures/simple/syntax/Error2.php 

    $b = $a + 1; 123123

Notice:  Constant BBBB does not exist in self scope in fixtures/simple/undefined/Const.php on 29 [undefined-const]

    return self::BBBB; 

Notice:  You are trying to cast 'string' to 'string' in fixtures/simple/code-smell/StandardFunctionCall.php on 16 [stupid.cast]

    return (string) json_encode(array(

Notice:  Missing docblock for callStaticMethodBySelf() method in fixtures/Compiling/Expression/StaticCall.php on 18 [missing-docblock]

    public static function callStaticMethodBySelf()

Requirements

PHP >= 7.0, but you can check files that use PHP >= 5.2 with this.

Documentation

See our documentation in case you need more information on some topic.

Contributing

Check our Contributing Guide to see how you can help.

Sponsors

Thanks to our sponsors and supporters:

JetBrains

LICENSE

This project is open-sourced software licensed under the MIT License.

See the LICENSE file for more information.