Skip to content

Mup0c/phalyfusion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Phalyfusion

NOTE: This repository is the development history. See taptima/phalyfusion for the current version.

Phalyfusion is a tool for convenient and effective usage of multiple PHP static code analysers. It runs analysers, combines its outputs and makes a single nice output in various formats:

  • Nice PHPStan-like table console output, groups errors by the file.
  • Checkstyle
  • Json

Currently supported analysers:

Installation

composer require --dev taptima/phalyfusion

Composer will install Phalyfusion’s executable in its bin-dir which defaults to vendor/bin.

Analysers should be installed individually.

Usage

After installing Phalyfusion you need to create phalyfusion.neon configuration file in the project root.

Config sample

plugins:
    usePlugins:
        - phan
        - phpstan
        - psalm
        - phpmd
    runCommands:
        phan:    'bin/phan -k .phan/config.php'
        phpstan:  bin/phpstan analyse -c phpstan.neon --level 7
        psalm:   "bin/psalm -c 'psalm.xml'"
        phpmd:    bin/phpmd src text cleancode

Provide names of analysers (plugins) you want to use in usePlugins. Choose from: phan phpstan psalm phpmd. Provide command lines to run stated analysers. Paths are resolved relative to current working directory (the directory where from you are running Phalyfusion)

  • Note that each analyser should be individually installed and configured.
  • All supported by individual analysers arguments and options can be used in the corresponding command line (runCommands)
  • Output formats of the analysers are overridden. To choose Phalyfusion output format use --format option when running.
  • File\path arguments of analysers are NOT guaranteed to be overridden in case you pass such argument to Phalyfusion.
  • Do not state path/files options/arguments in runCommands, use paths argument of Phalyfusion or configure it in configs.

Running

After configuring the tool and all used analysers run Phalyfusion:
<path_to_bin>/phalyfusion analyse [options] [--] [<files>...]

analyse is a default command, so it is optional to specify it. The simplest run command looks like:
<path_to_bin>/phalyfusion

Type <path_to_bin>/phalyfusion analyse --help to show all available options and arguments.

Contributing

It is easy to add support of other PHP static code analysers. You have to implement PluginRunnerInterface, write functional tests and thats it.

Before you create a pull request to submit your contribution, you must:

  • run tests and be sure everything is ok.

How to run tests

make test

About

Bachelor Graduation Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors