PHPackages                             mteu/docblock-rules - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. mteu/docblock-rules

AbandonedArchivedPhpstan-extension[Testing &amp; Quality](/categories/testing)

mteu/docblock-rules
===================

A few additional rules for PHPStan

0.4.0(1y ago)022.0k1GPL-3.0-or-laterPHPPHP ~8.2 || ~8.3 || ~8.4CI passing

Since Apr 12Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/mteu/docblock-rules)[ Packagist](https://packagist.org/packages/mteu/docblock-rules)[ RSS](/packages/mteu-docblock-rules/feed)WikiDiscussions main Synced yesterday

READMEChangelog (10)Dependencies (6)Versions (22)Used By (1)

[![CGL](https://github.com/mteu/docblock-rules/actions/workflows/cgl.yaml/badge.svg)](https://github.com/mteu/docblock-rules/actions/workflows/cgl.yaml)[![Tests](https://github.com/mteu/docblock-rules/actions/workflows/tests.yaml/badge.svg)](https://github.com/mteu/docblock-rules/actions/workflows/tests.yaml)

DocBlock Rules
==============

[](#docblock-rules)

**DocBlock Rules** is simple [PHPStan](https://github.com/phpstan/phpstan) rules extension to verify whether the PHP files contain certain pre-defined strings.

⚡ Usage
-------

[](#-usage)

Require this package and make sure to configure PHPStan according to your needs by putting a configuration file in your project (e.g. as `phpstan.neon` file in your package root.)

```
composer require --dev mteu/docblock-rules
```

If you're using the [`phpstan/extension-installer`](https://github.com/phpstan/extension-installer) you're good to go.

Configuration
-------------

[](#configuration)

This package ships custom rules that need additional configuration:

- [`RequireCopyrightInformationInFirstCommentRule`](#RequireCopyrightInformationInFirstCommentRule)
- [`RequireLicenseInformationInFirstCommentRule`](#RequireLicenseInformationInFirstCommentRule)

### [`RequireCopyrightInformationInFirstCommentRule`](src/Rules/RequireCopyrightInformationInFirstCommentRule.php)

[](#requirecopyrightinformationinfirstcommentrule)

This rule checks whether there is a PHPDoc comment block present that contains copyright information identified by a needle string in the PHPStan configuration.

#### Sample configuration:

[](#sample-configuration)

```
# phpstan.neon

parameters:
    docblock:
        copyrightIdentifier: 'Copyright (C) 2023'
```

### [`RequireLicenseInformationInFirstCommentRule`](src/Rules/RequireLicenseInformationInFirstCommentRule.php)

[](#requirelicenseinformationinfirstcommentrule)

This rule checks whether there is a PHPDoc comment block present that contains license information. You can use pre-defined license checks values or define a custom string that is being looked for.

#### Sample configuration:

[](#sample-configuration-1)

```
# phpstan.neon

parameters:
    docblock:
        # Pre-configured checks when applying 'GPL-2.0' or 'GPL-3.0' as value.
        # Alternatively, use a custom string to look for in the file.
        requiredLicenseIdentifier: 'GPL-3.0'
```

💛 Acknowledgement
-----------------

[](#-acknowledgement)

I'm very grateful for the good people that created, maintain and sponsor [PHPStan](https://github.com/phpstan/phpstan). Děkuji, [Ondřej](https://github.com/ondrejmirtes)and everyone who has contributed!

⭐ License
---------

[](#-license)

This project is licensed under [GNU General Public License 3.0 (or later)](LICENSE).

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance64

Regular maintenance activity

Popularity23

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 78.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~52 days

Recently: every ~73 days

Total

13

Last Release

554d ago

PHP version history (4 changes)0.1.0PHP ^8.1

0.2PHP ~8.2 || ~8.3

0.3.0PHP ~8.1 || ~8.2 || ~8.3

0.4.0PHP ~8.2 || ~8.3 || ~8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/876091a683280d445656ba977b7923a3824059a2808749a851e104ba14ac85bd?d=identicon)[mteu](/maintainers/mteu)

---

Top Contributors

[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (342 commits)")[![mteu](https://avatars.githubusercontent.com/u/2636487?v=4)](https://github.com/mteu "mteu (93 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![eliashaeussler](https://avatars.githubusercontent.com/u/16313625?v=4)](https://github.com/eliashaeussler "eliashaeussler (1 commits)")

---

Tags

phpstanphpstan-extension

###  Code Quality

TestsPHPUnit

Static AnalysisRector

### Embed Badge

![Health badge](/badges/mteu-docblock-rules/health.svg)

```
[![Health](https://phpackages.com/badges/mteu-docblock-rules/health.svg)](https://phpackages.com/packages/mteu-docblock-rules)
```

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.5k55.4M8.5k](/packages/larastan-larastan)[drupal/core-dev

require-dev dependencies from drupal/drupal; use in addition to drupal/core-recommended to run tests from drupal/core.

2022.6M343](/packages/drupal-core-dev)[wp-cli/wp-cli-tests

WP-CLI testing framework

423.1M142](/packages/wp-cli-wp-cli-tests)[phpstan/phpstan-symfony

Symfony Framework extensions and rules for PHPStan

79475.7M2.2k](/packages/phpstan-phpstan-symfony)[phpstan/phpstan-doctrine

Doctrine extensions for PHPStan

67272.8M1.4k](/packages/phpstan-phpstan-doctrine)[shipmonk/dead-code-detector

Dead code detector to find unused PHP code via PHPStan extension. Can automatically remove dead PHP code. Supports libraries like Symfony, Doctrine, PHPUnit etc. Detects dead cycles. Can detect dead code that is tested.

4853.5M91](/packages/shipmonk-dead-code-detector)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
