A PHP code-quality tool

Overview

Github Actions AppVeyor Installs Packagist

Twitter Join the chat at https://gitter.im/phpro/grumphp

GrumPHP

Sick and tired of defending code quality over and over again? GrumPHP will do it for you! This composer plugin will register some git hooks in your package repository. When somebody commits changes, GrumPHP will run some tests on the committed code. If the tests fail, you won't be able to commit your changes. This handy tool will not only improve your codebase, it will also teach your co-workers to write better code following the best practices you've determined as a team.

GrumPHP has a set of common tasks built-in. You will be able to use GrumPHP with a minimum of configuration.

We don't want to bore you with all the details, so quick: install it yourself and unleash the power of GrumPHP!

Demo

demo

Installation

In order for this package to work, you have to make sure following tools are discoverable on the command-line:

  • php
  • composer
  • git

This package is a composer plugin and should be installed to your project's dev dependency using composer:

Install GrumPHP as a phar without dependencies:

composer require --dev phpro/grumphp-shim

Install GrumPHP with dependencies:

composer require --dev phpro/grumphp

Install GrumPHP without dependencies and automated git hooks through phive

phive install grumphp

When the package is installed, GrumPHP will attach itself to the git hooks of your project. You will see following message in the composer logs:

Watch out! GrumPHP is sniffing your commits!

GrumPHP will never push you into using a specific task. You can choose the tasks that fit your needs, and activate or deactivate any task in no time! See the suggest section in composer.json.

Note: GrumPHP will overwrite existing hooks unless you run composer install with --no-plugins or --no-scripts. We do create a backup of your git hook, but it's best to make sure you also have a backup of your custom hooks before you try to install GrumPHP.

Having trouble installing GrumPHP? Find out how to:

Configuration

Some things in GrumPHP can be configured in a grumphp.yml or grumphp.yml.dist file in the root of your project (the directory where you run the grumphp command). You can specify a custom config filename and location in composer.json or in the --config option of the console commands.

# grumphp.yml
grumphp:
    hooks_dir: ~
    hooks_preset: local
    git_hook_variables:
         VAGRANT_HOST_DIR: .
         VAGRANT_PROJECT_DIR: /var/www
         EXEC_GRUMPHP_COMMAND: exec
         ENV: {}
    stop_on_failure: false
    ignore_unstaged_changes: false
    hide_circumvention_tip: false
    process_timeout: 60
    ascii:
        failed: grumphp-grumpy.txt
        succeeded: grumphp-happy.txt
    parallel:
        enabled: true
        max_workers: 32
    fixer:
        enabled: true
        fix_by_default: false
    environment:
        files: []
        variables: {}
        paths: []
    tasks: {}
    testsuites: []
    extensions: []

Details of the configuration are broken down into the following sections.

Commands

Since GrumPHP is just a CLI tool, these commands can be triggered:

Compatibility

GrumPHP works with PHP 5.6 or above.

This package has been tested with following git clients:

  • CLI Unix
  • CLI Mac
  • CLI Windows
  • PhpStorm Git
  • Atlassian SourceTree
  • Syntevo SmartGit

Roadmap

Lots of tasks are already available to make sure your team writes great code. We are always looking to support new tasks. Feel free to log an issue or create a pull request for a task we forgot.

Are you missing a feature or did you find a bug? Log it in the issue tracker! Want to help out? Feel free to contact us!

FAQ

About

Submitting bugs and feature requests

Bugs and feature request are tracked on GitHub. Please take a look at our rules before contributing your code.

License

GrumPHP is licensed under the MIT License.

Comments
  • Pre push testsuites

    Pre push testsuites

    | Q | A | ------------- | --- | Branch | master | Bug fix? | no | New feature? | yes | Tests pass? | yes/no | Documented? | no | Fixed tickets | #252

    It is an experiment to get the #252 working, actually there is the problem that if we have a grumphp.yml like that:

    parameters:
        git_dir: .
        bin_dir: vendor/bin
        ignore_unstaged_changes: false
        tasks: 
            codeception:
                config_file: ~
                fail_fast: false
                suite: ~
                test: ~
        testsuites:
            git_pre_push:
                tasks: 
                    - codeception
    

    It's working but codeception is executed also on commit, and I have no idea how to avoid that.

    New Task Checklist:

    • [x] Is the README.md file updated?
    • [ ] Does the task run in the correct context?
    • [ ] Are all CI services returning green?
    new feature 
    opened by Mte90 28
  • Add Symfony 4 support

    Add Symfony 4 support

    | Q | A | ------------- | --- | Branch | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Documented? | yes | Fixed tickets | #423

    This PR adds support for the newest version of Symfony 4.0.

    Additional information

    #SymfonyConHackday2017 :)

    This PR will depend on the adoption of Symfony v4.0 in some of its dependencies:

    • [x] composer/composer#6788
    • [x] gitonomy/gitlib#122
    • [x] phpspec/phpspec#1166
    enhancement 
    opened by UrGuardian4ngel 25
  • PHP 8.1 compatibility

    PHP 8.1 compatibility

    | Q | A | --------------- | --- | Version | vendor/bin/grumphp -V | Bug? | no | New feature? | no | Question? | no | Documentation? | no | Related tickets |

    We added PHP 8.1 compatibility in #956. However, not all downstream packages are fully compatible yet. Therefore, you might still see some deprecation warnings. The tool itself should be working though!

    Awaiting deps:

    • [x] opis/closure: https://github.com/opis/closure/pull/105
    • [x] opis/closure: https://github.com/opis/closure/issues/59
    • [x] laravel/closure if amphp/parallel-functions wants to use that: https://github.com/amphp/parallel-functions/pull/29

    Awaiting dev deps

    • [x] phpspec: https://github.com/phpspec/phpspec/pull/1397

    Awaiting shim deps (patched locally)

    • [x] humbug/box & scoper: https://github.com/box-project/box/issues/562
    • [x] scoper issue with serializable closure: https://github.com/humbug/php-scoper/issues/642
    • [x] scoper issue with union return types https://github.com/humbug/php-scoper/issues/643
    • [x] New shim build setup : https://github.com/phpro/grumphp-shim/pull/17

    Broken Tests

    • [ ] ~Fix skipped E2E tests~ - currently won't do. They seem buggy edge cases anyways. If there is any need for them to still work, time can be invested
    enhancement wip 
    opened by veewee 23
  • Run grumphp in a docker container

    Run grumphp in a docker container

    | Q | A | | --- | --- | | Branch | master | | Bug? | no | | New feature? | no | | Question? | yes | | Documentation? | no |

    In short: I'm developing php applications in docker containers. It's a lightweight vagrant box with a docker server. The OS X docker client connects with it as it was native.

    This means:

    • Everything related with git is on OS X cli.
    • Everything related with composer and bin executables are on the PHP container.

    I would like to extend grumphp in the way that the pre-commit hook command executes in the docker container.

    Example to run grumphp using docker and docker-compose from OS X cli:

    docker exec -it `docker-compose ps -q php` bash -c "cd /var/www/app && ./vendor/bin/grumphp run";
    

    I can make something like the vagrant pre-commit settings: https://github.com/phpro/grumphp/blob/master/resources/hooks/vagrant/pre-commit

    But I'll need some extra parameters, which container (php) and which docroot (/var/www/app). The git diff can be done on the OS X cli but the run should happen on the container.

    Can I add a docker parameter, with all settings? Hooks can be installed local as default.

    I'm currently using it by hardcoding this in the pre-commit hook.

    # Run GrumPHP
    #(cd "./" && echo "${DIFF}" | exec '/vendor/phpro/grumphp/bin/grumphp' 'git:pre-commit' '--skip-success-output')
    (cd "./" && echo "${DIFF}" | docker exec -i `docker-compose ps -q php` bash -c "cd /var/www/app && ./vendor/bin/grumphp git:pre-commit --ansi --skip-success-output")
    

    A gist: https://gist.github.com/jverdeyen/9c0b247bb8b34c7fae514315db36a23e

    I would like to hear feedback about this :)

    Thanks!

    enhancement help wanted new feature 
    opened by jverdeyen 19
  • Implements blocking task flag

    Implements blocking task flag

    | Q | A | | --- | --- | | Branch | master for features and deprecations | | Bug fix? | no | | New feature? | yes | | BC breaks? | yes | | Deprecations? | no | | Tests pass? | yes | | Documented? | yes | | Fixed tickets | 17 |

    Try to implement #17 but there is a BC break because TaskRunner::run no longer throws FailureException

    The feature is already documented in https://github.com/phpro/grumphp/blob/master/doc/tasks.md#metadata

    opened by aaa2000 19
  • Fail when file is both in staging and not

    Fail when file is both in staging and not

    Hi. First of all - nice tool ! ;)

    Maybe it's a matter of configuration, but please consider the following scenario:

    • configure tool to use PHP CS Fixer, init git hooks
    • create foo.php file with CS violations
    • git add foo.php, git commit -m "foo" -> fails due to PHP CS Fixer violations
    • fix violations without adding the file (so git status will show unfixed-files in stage and fixed one in non-stage)
    • git commit -m "foo" will proceed, even if the file we are commiting is not valid

    Please, could you help?

    enhancement 
    opened by keradus 18
  • Add whitelist_patterns option to Phpcs task

    Add whitelist_patterns option to Phpcs task

    | Q | A | | --- | --- | | Branch | master for features and deprecations | | Bug fix? | no | | New feature? | yes | | BC breaks? | no | | Deprecations? | no | | Tests pass? | yes/no | | Documented? | yes | | Fixed tickets | #158 |

    This PR add a new whitelist_patternsoption to Phpcs task. It will be used to filter files to be validated.

    Example for a Symfony, validate PHP files only in src/ directory

    phpcs:
        standard: "./vendor/leaphub/phpcs-symfony2-standard/leaphub/phpcs/Symfony2/"
        show_warnings: true
        whitelist_patterns: ["^src/(.*)"]
        triggered_by: [php]
    
    enhancement 
    opened by mgeoffray 17
  • #615, Support other PHP executable

    #615, Support other PHP executable

    | Q | A | ------------- | --- | Branch | master for features and deprecations | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Documented? | yes | Fixed tickets | #615

    See #615 - support running grumphp on multiple locally installed PHP versions.

    enhancement 
    opened by rotemreiss 16
  • Added vagrant_dir and vagrant_project_dir parameters

    Added vagrant_dir and vagrant_project_dir parameters

    …hooks templates

    | Q | A | ------------- | --- | Branch | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Documented? | yes | Fixed tickets | none

    This feature allow users to specify 2 new config parameters :

    vagrant_dir

    The hook templates assume that the VagrantBox is at the root project dir, but if it isn't there (for example d:/VagrantBoxes/...) users were obliged to edit the hook after doing a grumphp git:init command

    vagrant_project_dir

    The documentation of the parameter hooks_preset describe how to make the vagrant box switching directly to the root project dir, to avoid any problems when launching the git hooks

    I think it's a better idea to allow users configure it inside the GrumPHP configuration file. It's better when working with a team in my opinion, instead of having to update each on our own our vagrant .bashrc file

    All is documented and have default values that should not create problems with existing configurations

    new feature 
    opened by bastos71 16
  • Fatal error on first composer install

    Fatal error on first composer install

    | Q | A | --------------- | --- | Version | 0.14 | Bug? | yes | New feature? | no | Question? | no | Documentation? | no | Related tickets | comma-separated list of related tickets

    When running composer install in a clean repository (no vendor folder exists yet), I'm getting this error:

    Fatal error: Class 'Doctrine\Common\Collections\ArrayCollection' not found in /Users/rasta/DEV/BetterSerializer/vendor/phpro/grumphp/src/Collection/ProcessArgumentsCollection.php on line 8
    

    This happens when running the GrumPHP\\Composer\\DevelopmentIntegrator::integrate composer post install command for the first time. When running composer install for the second time, the error isn't there anymore. Which is kind of ok, but this thing breaks my Travis build.

    I'm using the composer --no-scripts flag as a workaround for now.

    My configuration

    parameters:
        git_dir: .
        bin_dir: vendor/bin
        process_timeout: 600
        tasks:
          phpcs:
            standard: PSR2
            tab_width: 4
            whitelist_patterns: []
            encoding: ~
            ignore_patterns: []
            sniffs: []
            triggered_by: [php]
          phpcsfixer2:
            allow_risky: true
            cache_file: .php_cs.cache
            config: .php_cs
            using_cache: true
            config_contains_finder: false
            verbose: true
            diff: false
            triggered_by: [php]
          phplint: ~
          phpmd:
            exclude: []
            ruleset: ['dev/phpmd.ruleset.xml']
            triggered_by: [php]
          phpparser: ~
          phpstan:
            autoload_file: ~
            configuration: dev/phpstan.neon
            level: 7
            triggered_by: [php]
          phpunit: ~
          infection:
            threads: 2
            test_framework: phpunit
            only_covered: true
            configuration: infection.json
            min_msi: ~
            min_covered_msi: ~
            mutators: []
            triggered_by: [php]
          phpversion: ~
          securitychecker: ~
          shell: ~
    
    

    My composer.json file (minimised to the bare minimum to reproduced the error):

    {
        "name": "whatever/whatever",
        "description": "whatever",
        "type": "library",
        "license": "MIT",
        "minimum-stability": "dev",
        "require": {
            "php": "^7.2"
        },
        "require-dev": {
            "doctrine/collections": "^1.5",
            "phpro/grumphp": "^v0.14"
        },
    
        "autoload": {
            "psr-4": {
                "BetterSerializer\\": "src/BetterSerializer/"
            }
        },
    
        "autoload-dev": {
            "psr-4": {
                "BetterSerializer\\": "tests/BetterSerializer/",
                "Integration\\": "tests/Integration/"
            }
        },
    
        "config": {
            "platform": {
                "php": "7.2"
            },
            "sort-packages": true
        }
    }
    
    

    Steps to reproduce:

    # Generate empty folder
    git clone https://github.com/better-serializer/better-serializer.git
    cd better-serializer
    git checkout faster_than_reflection
    composer install -o --no-interaction  
    
    

    Result:

    Writing lock file
    Generating optimized autoload files
    
    Fatal error: Class 'Doctrine\Common\Collections\ArrayCollection' not found in /Users/rasta/DEV/BetterSerializer/vendor/phpro/grumphp/src/Collection/ProcessArgumentsCollection.php on line 8
    
    bug 
    opened by Rastusik 16
  • Bug in pre-commit hook (Gitonomy\Git\Exception\RuntimeException, Unable to find)

    Bug in pre-commit hook (Gitonomy\Git\Exception\RuntimeException, Unable to find)

    Hook:

    $ /bin/sh
    $ cat ./.git/hooks/pre-commit
    #!/bin/sh
    
    #
    # Run the hook command.
    # Note: this will be replaced by the real command during copy.
    #
    
    # Fetch the GIT diff and format it as command input:
    DIFF=$(git diff -r -p -m -M --full-index --staged | cat)
    echo $DIFF;
    echo "";
    # Run GrumPHP
    (cd "./" && echo "${DIFF}" | exec 'vendor/phpro/grumphp/bin/grumphp' 'git:pre-commit' '--skip-success-output')
    
    # Validate exit code of above command
    RC=$?
    if [ "$RC" != 0 ]; then
      exit $RC;
    fi
    
    # Clean exit:
    exit 0;
    
    $ ./.git/hooks/pre-commit
    diff --git a/demo/config/processor.php b/demo/config/processor.php index 9c2398bc43d2d5b39e31a4bb6c759848ccbb02ac..a740c15e751cdce83fc9aa20c14be7eeb2dd9ed2 100644 --- a/demo/config/processor.php +++ b/demo/config/processor.php @@ -5,7 +5,7 @@ namespace MailRu\QueueProcessor\Demo
    
    
      [Gitonomy\Git\Exception\RuntimeException]  
      Unable to find "                           
      "                                          
    
    
    git:pre-commit [--skip-success-output] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-c|--config [CONFIG]] [--] <command>
    
    

    It cuts diff:

    $ git diff -r -p -m -M --full-index --staged | cat
    diff --git a/demo/config/processor.php b/demo/config/processor.php
    index 9c2398bc43d2d5b39e31a4bb6c759848ccbb02ac..a740c15e751cdce83fc9aa20c14be7eeb2dd9ed2 100644
    --- a/demo/config/processor.php
    +++ b/demo/config/processor.php
    @@ -5,7 +5,7 @@ namespace MailRu\QueueProcessor\Demo\config;
     return [
         'testPool' => [
             'servers' => [
    -            'mougrim-1215N',
    +            php_uname('n'),
             ],
             'maxWorkersQty' => 2,
             'queues' => [
    diff --git a/demo/shared/logs/.gitignore b/demo/shared/logs/.gitignore
    new file mode 100644
    index 0000000000000000000000000000000000000000..72e8ffc0db8aad71a934dd11e5968bd5109e54b4
    --- /dev/null
    +++ b/demo/shared/logs/.gitignore
    @@ -0,0 +1 @@
    +*
    

    bash output:

    $ bash -c 'echo $(git diff -r -p -m -M --full-index --staged | cat); echo "" '
    diff --git a/demo/config/processor.php b/demo/config/processor.php index 9c2398bc43d2d5b39e31a4bb6c759848ccbb02ac..a740c15e751cdce83fc9aa20c14be7eeb2dd9ed2 100644 --- a/demo/config/processor.php +++ b/demo/config/processor.php @@ -5,7 +5,7 @@ namespace MailRu\QueueProcessor\Demo\config; return [ 'testPool' => [ 'servers' => [ - 'mougrim-1215N', + php_uname('n'), ], 'maxWorkersQty' => 2, 'queues' => [ diff --git a/demo/shared/logs/.gitignore b/demo/shared/logs/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..72e8ffc0db8aad71a934dd11e5968bd5109e54b4 --- /dev/null +++ b/demo/shared/logs/.gitignore @@ -0,0 +1 @@ +*
    

    sh output:

    $ sh -c 'echo $(git diff -r -p -m -M --full-index --staged | cat); echo "" '
    diff --git a/demo/config/processor.php b/demo/config/processor.php index 9c2398bc43d2d5b39e31a4bb6c759848ccbb02ac..a740c15e751cdce83fc9aa20c14be7eeb2dd9ed2 100644 --- a/demo/config/processor.php +++ b/demo/config/processor.php @@ -5,7 +5,7 @@ namespace MailRu\QueueProcessor\Demo
    

    I think, problem is with "\c":

    $ bash -c 'echo "qwe\cqwe";echo ""'
    qwe\cqwe
    $ sh -c 'echo "qwe\cqwe";echo ""'
    qwe
    

    It's reporoducing in Ubuntu 14.04 for pre-commit and commit-msg hooks in master: https://github.com/phpro/grumphp/blob/master/resources/hooks/local/pre-commit https://github.com/phpro/grumphp/blob/master/resources/hooks/local/commit-msg

    I don't try resources/hooks/vagrant/pre-commit and resources/hooks/vagrant/commit-msg.

    I think fix is change #!/bin/sh to #!/bin/bash

    bug 
    opened by mougrim 16
  • git_branch_name white list validation is not working

    git_branch_name white list validation is not working

    | Q | A | --------------- | --- | Version | 1.5.1 | Bug? | yes | New feature? | no | Question? | no | Documentation? | no

    My configuration

     git_branch_name:
                whitelist:
                    # allowed branch names: 'feature/JIRA-1234', 'bugfix/JIRA-1234', 'hotfix/JIRA-1234', 'hotfix/v1.0.1', 'release/v1.1.10' etc
                    - "/(hotfix|bugfix|feature)\/([JIRA]){4}-([0-9]+){4}$/"
                    - "/(hotfix|release)\/([v])([0-9]+){1,2}.([0-9]){1,2}.([0-9]){1,2}$/"
                    - "main"
    

    Steps to reproduce:

    ./vendor/bin/grumphp run
    

    Result:

    git_branch_name
    ===============
    
    Whitelist rule not matched: /(hotfix|bugfix|feature)/([JIRA]){4}-([0-9]+){4}$/
    Whitelist rule not matched: /(hotfix|release)/([v])([0-9]+){1,2}.([0-9]){1,2}.([0-9]){1,2}$/
    
    

    Here is the regex test: https://regex101.com/r/zlHJL6/1 which is passing the branch names.

    opened by prafullazee 0
  • Fix #912: Ignore deleted files in file_size task

    Fix #912: Ignore deleted files in file_size task

    | Q | A | ------------- | --- | Branch | master for features and deprecations | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Documented? | no | Fixed tickets | #912

    This PR :

    • adds a FilesCollection->ignoreDeleted() method
    • uses this method in FileSize->run() to fix #912

    NB: This dev was made on v1.5.1, due to my local PHP version.

    opened by jmdelehaye 1
  • Add allow-list config option to securitychecker_enlightn

    Add allow-list config option to securitychecker_enlightn

    | Q | A | ------------- | --- | Branch | master for features and deprecations | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Documented? | yes | Fixed tickets | https://github.com/phpro/grumphp/discussions/1037

    Add allow-list config option to be able to ignore given vulns, see https://github.com/enlightn/security-checker#allow-vulnerabilities

    opened by peterjaap 2
  • Using Dotenv in yaml config does not provide value of env var

    Using Dotenv in yaml config does not provide value of env var

    | Q | A | --------------- | --- | Version | 1.13.0 | Bug? | maybe | New feature? | no | Question? | yes | Documentation? | no | Related tickets | #1040

    A new issue to try and resolve my question in the final comment of #1040 as it's likely an unrelated issue.

    As per your suggestion in https://github.com/phpro/grumphp/issues/1040#issuecomment-1228604767 I am trying to inject the value of an environment variable into the GrumPHP yaml configuration file.

    I have encountered a strange issue trying to get this setup. Instead of making the actual value of my GITLAB_TOKEN env var available, I get a strange string which looks like env_e7937a168f382d27_GITLAB_TOKEN_4e06944bcec1f665r4a82bf0125e3f8d.

    # .env.local
    
    GITLAB_TOKEN=XXXXXX
    
    # grumphp.yml
    
    grumphp:
        tasks:
            gitlab_lint:
                api_token: '%env(GITLAB_TOKEN)%'
        environment:
            files:
                - .env.local
    

    Any pointers much appreciated. Thank you.

    bug help wanted 
    opened by benr77 4
  • [BUG?] Return empty trace for phpmd task

    [BUG?] Return empty trace for phpmd task

    | Q | A | --------------- | --- | Version | 1.13.0 | Bug? | yes | New feature? | no | Question? | no | Documentation? | no | Related tickets | comma-separated list of related tickets

    My configuration

    # grumphp.yml
        phpmd:
          ruleset: ['./dev/tests/static/testsuite/Magento/Test/Php/_files/phpmd/ruleset.xml']
          triggered_by: [ 'php' ]
          exclude: ['dev','vendor','generated','var','lib','update','bin','pub','setup','.docker','phpserver','scripts','docker']
          metadata:
            priority: 900
    

    Steps to reproduce:

    ./vendor/bin/grumphp run
    
    

    Result: image

    bug 
    opened by palakaccorin 1
Releases(v1.15.0)
Owner
PHPro
PHPro
A static php code analysis tool using the Graph Theory

Mondrian Ok guyz, you have a master degree in Graph Theory, you follow Law of Demeter and you live on S.O.L.I.D principles ? Let's have some Fun ! (^ω

Florent Genette 391 Nov 30, 2022
Deptrac is a static code analysis tool for PHP that helps you communicate, visualize and enforce architectural decisions in your projects

Deptrac is a static code analysis tool for PHP that helps you communicate, visualize and enforce architectural decisions in your projects. You can freely define your architectural layers over classes and which rules should apply to them.

QOSSMIC GmbH 2.2k Dec 30, 2022
A tool to automatically fix PHP Coding Standards issues by Dragon Code.

A tool to automatically fix PHP Coding Standards issues by Dragon Code.

The Dragon Code 24 Aug 27, 2022
A full-scale PHP sandbox class that utilizes PHP-Parser to prevent sandboxed code from running unsafe code

A full-scale PHP 7.4+ sandbox class that utilizes PHP-Parser to prevent sandboxed code from running unsafe code. It also utilizes FunctionParser to di

Corveda 192 Dec 10, 2022
A full-scale PHP 5.3.2+ sandbox class that utilizes PHPParser to prevent sandboxed code from running unsafe code.

##DEPRECATED: The PHPSandbox project has transfered to Corveda/PHPSandbox and will be actively maintained there. This branch is no longer being active

Elijah Horton 219 Sep 2, 2022
Library for counting the lines of code in PHP source code

sebastian/lines-of-code Library for counting the lines of code in PHP source code. Installation You can add this library as a local, per-project depen

Sebastian Bergmann 715 Jan 5, 2023
PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD. PHPMD can be seen as an user friendly frontend application for the raw metrics stream measured by PHP Depend.

PHPMD PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD. PHPMD can be seen as an user friendly

PHP Mess Detector 2.1k Jan 8, 2023
PHP Architecture Tester - Easy to use architectural testing tool for PHP :heavy_check_mark:

Easy to use architecture testing tool for PHP Introduction ?? PHP Architecture Tester is a static analysis tool to verify architectural requirements.

Carlos A Sastre 765 Dec 30, 2022
A tool to automatically fix PHP Coding Standards issues

PHP Coding Standards Fixer The PHP Coding Standards Fixer (PHP CS Fixer) tool fixes your code to follow standards; whether you want to follow PHP codi

null 11.6k Jan 3, 2023
Beautiful and understandable static analysis tool for PHP

PhpMetrics PhpMetrics provides metrics about PHP project and classes, with beautiful and readable HTML report. Documentation | Twitter | Contributing

PhpMetrics 2.3k Dec 22, 2022
A tool for quickly measuring the size of a PHP project.

PHPLOC phploc is a tool for quickly measuring the size and analyzing the structure of a PHP project. Installation This tool is distributed as a PHP Ar

Sebastian Bergmann 2.3k Jan 4, 2023
A command line refactoring tool for PHP

PHP Refactoring Browser Note: This software is under development and in alpha state. Refactorings do not contain all necessary pre-conditions and migh

QafooLabs 562 Dec 30, 2022
PHPCheckstyle is an open-source tool that helps PHP programmers adhere to certain coding conventions.

PHPCheckstyle Overview PHPCheckstyle is an open-source tool that helps PHP programmers adhere to certain coding conventions. The tools checks the inpu

PHPCheckstyle 157 Dec 5, 2022
PHP completion, refactoring, introspection tool and language server.

Phpactor This project aims to provide heavy-lifting refactoring and introspection tools which can be used standalone or as the backend for a text edit

Phpactor 882 Jan 1, 2023
A static analysis tool for finding errors in PHP applications

Psalm Psalm is a static analysis tool for finding errors in PHP applications. Installation To get started, check out the installation guide. Live Demo

Vimeo 5k Jan 2, 2023
A web tool to explore the ASTs generated by PHP-Parser.

phpast.com A web tool to explore the ASTs generated by PHP-Parser. About This web tool provides a GUI for exploring the AST of your PHP code. You can

Ryan Chandler 23 Nov 29, 2022
Provides functionality that helps writing PHP code that has runtime-specific (PHP / HHVM) execution paths

sebastian/environment This component provides functionality that helps writing PHP code that has runtime-specific (PHP / HHVM) execution paths. Instal

Sebastian Bergmann 6.5k Jan 3, 2023
Search PHP source code for function & method calls, variables, and more from PHP.

Searching PHP source code made easy Search PHP source code for function & method calls, variable assignments, classes and more directly from PHP. Inst

Permafrost Software 22 Nov 24, 2022
Tool helping us to analyze software projects

Qafoo Quality Analyzer This software is a tool to visualize metrics and source code. We use this software for Code Reviews together with our customers

Qafoo GmbH 494 Dec 29, 2022