From 99ccbc72eafbbb95c6bf4ac5ae9530813cca2469 Mon Sep 17 00:00:00 2001 From: nimratcoderabbit Date: Mon, 14 Jul 2025 10:57:01 -0400 Subject: [PATCH 1/4] PHPStan Showcase --- phpstan-example/README.md | 40 ++++++++++++++++++++++++++++++++++++ phpstan-example/phpstan.neon | 9 ++++++++ phpstan-example/test.php | 13 ++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 phpstan-example/README.md create mode 100644 phpstan-example/phpstan.neon create mode 100644 phpstan-example/test.php diff --git a/phpstan-example/README.md b/phpstan-example/README.md new file mode 100644 index 0000000..d1d2712 --- /dev/null +++ b/phpstan-example/README.md @@ -0,0 +1,40 @@ +# PHPStan Integration + +[PHPStan](https://phpstan.org) is a static analysis tool for PHP, designed to catch bugs and enforce code quality standards before runtime. This integration is intended for use with CodeRabbit to automate code review and ensure high-signal diagnostics on PHP projects. + +--- + +## đŸ“Ļ Version + +`PHPSTAN_VERSION: 2.1.17` +Includes performance improvements, stricter type checks, and enhanced support for PHP language features. + +--- + +## 📂 File Support + +PHPStan will automatically analyze files with the `.php` extension. + +--- + +## âš™ī¸ Configuration + +CodeRabbit will not run PHPStan if no supported config file is found. The following config filenames are supported: + +- `phpstan.neon` +- `phpstan.neon.dist` +- `phpstan.dist.neon` + +> â„šī¸ **Note**: CodeRabbit will not run PHPStan if no supported config file is found. + +You can customize your rules and settings using the official configuration reference. + +📄 [Configuration Reference →](https://phpstan.org/config-reference) + +--- + +## 📚 Documentation + +For more details on how PHPStan integrates with CodeRabbit, refer to the official guide: + +🔗 [CodeRabbit PHPStan Docs →](https://docs.coderabbit.ai/tools/phpstan) diff --git a/phpstan-example/phpstan.neon b/phpstan-example/phpstan.neon new file mode 100644 index 0000000..96c5006 --- /dev/null +++ b/phpstan-example/phpstan.neon @@ -0,0 +1,9 @@ +parameters: + level: 5 + paths: + - . + excludePaths: + - vendor/* + - node_modules/* + - .git/* + diff --git a/phpstan-example/test.php b/phpstan-example/test.php new file mode 100644 index 0000000..e7a4a4d --- /dev/null +++ b/phpstan-example/test.php @@ -0,0 +1,13 @@ + Date: Mon, 14 Jul 2025 11:00:11 -0400 Subject: [PATCH 2/4] Fixing documentation --- phpstan-example/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/phpstan-example/README.md b/phpstan-example/README.md index d1d2712..35712b0 100644 --- a/phpstan-example/README.md +++ b/phpstan-example/README.md @@ -7,7 +7,6 @@ ## đŸ“Ļ Version `PHPSTAN_VERSION: 2.1.17` -Includes performance improvements, stricter type checks, and enhanced support for PHP language features. --- From a4287a5983b6059baef73f31205a7b3f7d918a8c Mon Sep 17 00:00:00 2001 From: nimratcoderabbit Date: Mon, 14 Jul 2025 11:04:41 -0400 Subject: [PATCH 3/4] Removed README.md --- phpstan-example/README.md | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 phpstan-example/README.md diff --git a/phpstan-example/README.md b/phpstan-example/README.md deleted file mode 100644 index 35712b0..0000000 --- a/phpstan-example/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# PHPStan Integration - -[PHPStan](https://phpstan.org) is a static analysis tool for PHP, designed to catch bugs and enforce code quality standards before runtime. This integration is intended for use with CodeRabbit to automate code review and ensure high-signal diagnostics on PHP projects. - ---- - -## đŸ“Ļ Version - -`PHPSTAN_VERSION: 2.1.17` - ---- - -## 📂 File Support - -PHPStan will automatically analyze files with the `.php` extension. - ---- - -## âš™ī¸ Configuration - -CodeRabbit will not run PHPStan if no supported config file is found. The following config filenames are supported: - -- `phpstan.neon` -- `phpstan.neon.dist` -- `phpstan.dist.neon` - -> â„šī¸ **Note**: CodeRabbit will not run PHPStan if no supported config file is found. - -You can customize your rules and settings using the official configuration reference. - -📄 [Configuration Reference →](https://phpstan.org/config-reference) - ---- - -## 📚 Documentation - -For more details on how PHPStan integrates with CodeRabbit, refer to the official guide: - -🔗 [CodeRabbit PHPStan Docs →](https://docs.coderabbit.ai/tools/phpstan) From 1523d2b65002271e077513de34178d263c5f78bb Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 16 Jul 2025 12:58:31 -0400 Subject: [PATCH 4/4] fix paths --- phpstan-example/test.php | 13 ------------- phpstan-example/phpstan.neon => phpstan.neon | 2 +- test.php | 9 +++++++++ 3 files changed, 10 insertions(+), 14 deletions(-) delete mode 100644 phpstan-example/test.php rename phpstan-example/phpstan.neon => phpstan.neon (89%) create mode 100644 test.php diff --git a/phpstan-example/test.php b/phpstan-example/test.php deleted file mode 100644 index e7a4a4d..0000000 --- a/phpstan-example/test.php +++ /dev/null @@ -1,13 +0,0 @@ -format('j. n. Y'); + } +}