PHP Static Analysis

Open-source PHP projects categorized as Static Analysis

Top 23 PHP Static Analysis Projects

  • PHP Parser

    A PHP parser written in PHP

    Project mention: Diff Speeding - Rector and sebastian/diff speed improvements through profiling | /r/PHP | 2023-05-06

    Interesting. One of the reasons I stopped considering Rector is because of how memory, CPU, and time intensive it is for a non-trivial project. Instead I've been using Nikita's PHP Parser directly and getting much better results even though it isn't multi-threaded out of the box.

  • PHPStan

    PHP Static Analysis Tool - discover bugs in your code without running it!

    Project mention: Laravel code-quality tools | dev.to | 2024-02-08

    PHPStan is a static analysis tool for PHP. Larastan is a package built on top of PHPStan to make it easier to integrate with Laravel projects. PHPStan works by "sniffing" the code using the various rulesets applied to it and determine if it follows the standards. However, Larastan doesn't fully follow the definition of "static analysis" since it has to boot the application's container and resolve the types that can only be computed at runtime. This is why Larastan is called a "code analysis" tool rather than a "static analysis" tool.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

  • PHP CS Fixer

    A tool to automatically fix PHP Coding Standards issues

    Project mention: Avoiding empty() in PHP | /r/PHP | 2023-05-11

    friendsofphp/php-cs-fixer

  • PHP Code Sniffer

    PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.

    Project mention: The Future of PHP_CodeSniffer | news.ycombinator.com | 2024-02-17
  • phan

    Phan is a static analyzer for PHP. Phan prefers to avoid false-positives and attempts to prove incorrectness rather than correctness.

    Project mention: 7.4 to 8.x upgrade help | /r/PHP | 2023-04-29

    Besides what others have already advised, you can also get Phan to scan your project. Set the target to 8.1 and let it run its analysis. Check GitHub repo and docs there for more verbose instructions: https://github.com/phan/phan/

  • Psalm

    A static analysis tool for finding errors in PHP applications

    Project mention: Laravel code-quality tools | dev.to | 2024-02-08

    Psalm is a static analysis tool for PHP. Much like PHPStan is to Larastan, Psalm has a plugin called Laravel Psalm that allows you to easily use it in Laravel projects.

  • Deptrac

    Keep your architecture clean.

    Project mention: Microservices aren't the problem. Incompetent people are | news.ycombinator.com | 2023-11-09
  • WorkOS

    The modern API for authentication & user identity. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

  • PHP Mess Detector

    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.

    Project mention: PHP libraries and tools | dev.to | 2023-10-18

    PHPMD - PHP Mess Detector: 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.

  • PHPCompatibility

    PHP Compatibility check for PHP_CodeSniffer

    Project mention: Update php? | /r/PHPhelp | 2023-03-26
  • php-language-server

    PHP Implementation of the VS Code Language Server Protocol 🆚↔🖥

  • PHP Architecture Tester

    PHP Architecture Tester - Easy to use architectural testing tool for PHP :heavy_check_mark:

    Project mention: Enforce architecture rules with Deptrac | dev.to | 2023-10-31

    PHP Architecture Tester (as a PHPStan plugin)

  • enlightn

    Your performance & security consultant, an artisan command away.

    Project mention: Laravel code-quality tools | dev.to | 2024-02-08

    Enlightn scans your code to check whether it follows best practices in performance, security, and reliability. It's a paid tool, but it also has free checks you can use. At the time of writing, it has 64 checks in the free version and 128 checks in the paid version. For the purposes of this article, we'll only be using the free version.

  • BackwardCompatibilityCheck

    :ab: Tool to compare two revisions of a class API to check for BC breaks

    Project mention: Some thoughts on the Interface Default Methods RFC | /r/PHP | 2023-06-28

    It's also not a big risk because if it does fail it will fail every time you just load the class that implements the interface so probably your while site will error. If you do cursory testing of the new version before you deploy it you can find the problem quickly before it becomes a problem. You can also do static analysis checks on your code to make sure its compatible with the libraries you use including when you upgrade them. And library maintainers can run Roave/BackwardCompatibilityCheck/ to make sure they don't accidentally introduce a new interface method without declaring a new major version.

  • phpmnd

    PHP Magic Number Detector

    Project mention: PHP libraries and tools | dev.to | 2023-10-18

    PHP Magic Number Detector: a tool that aims to help you to detect magic numbers in your PHP code.

  • phpstan-strict-rules

    Extra strict and opinionated rules for PHPStan

  • unused-scanner

    Detect unused composer dependencies

  • Exakat

    The Exakat Engine : smart static analysis for PHP

  • phpstan-deprecation-rules

    PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.

  • psalm-plugin-laravel

    A Psalm plugin for Laravel

    Project mention: Laravel code-quality tools | dev.to | 2024-02-08

    Psalm is a static analysis tool for PHP. Much like PHPStan is to Larastan, Psalm has a plugin called Laravel Psalm that allows you to easily use it in Laravel projects.

  • phpstan-dba

    PHPStan based SQL static analysis and type inference for the database access layer

  • phpstan-wordpress

    WordPress extensions for PHPStan ⛏️

  • phpstan-disallowed-calls

    PHPStan rules to detect disallowed method & function calls, constant, namespace, attribute & superglobal usages

    Project mention: Microservices aren't the problem. Incompetent people are | news.ycombinator.com | 2023-11-09
  • functional

    PHP Functional Programming library. Monads, common use functions and generic collections.

    Project mention: Experimenting around FP in PHP | dev.to | 2023-12-18
  • LearnThisRepo.com

    Learn 300+ open source libraries for free using AI. LearnThisRepo lets you learn 300+ open source repos including Postgres, Langchain, VS Code, and more by chatting with them using AI!

NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020). The latest post mention was on 2024-02-17.

PHP Static Analysis related posts

Index

What are some of the best open-source Static Analysis projects in PHP? This list will help you:

Project Stars
1 PHP Parser 16,491
2 PHPStan 12,439
3 PHP CS Fixer 12,393
4 PHP Code Sniffer 10,571
5 phan 5,490
6 Psalm 5,396
7 Deptrac 2,487
8 PHP Mess Detector 2,269
9 PHPCompatibility 2,096
10 php-language-server 1,140
11 PHP Architecture Tester 975
12 enlightn 853
13 BackwardCompatibilityCheck 557
14 phpmnd 541
15 phpstan-strict-rules 541
16 unused-scanner 432
17 Exakat 376
18 phpstan-deprecation-rules 340
19 psalm-plugin-laravel 277
20 phpstan-dba 243
21 phpstan-wordpress 235
22 phpstan-disallowed-calls 191
23 functional 187
Learn 300+ open source libraries for free using AI.
LearnThisRepo lets you learn 300+ open source repos including Postgres, Langchain, VS Code, and more by chatting with them using AI!
learnthisrepo.com