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. mteu/docblock-rules

ActivePhpstan-extension

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

A few additional rules for PHPStan

0.4.0(1y ago)022.0k[5 PRs](https://github.com/mteu/docblock-rules/pulls)1GPL-3.0-or-laterPHPPHP ~8.2 || ~8.3 || ~8.4CI passing

Since Apr 12Pushed 1mo 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 1mo ago

READMEChangelog (10)Dependencies (6)Versions (21)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 92% of packages

Maintenance68

Regular maintenance activity

Popularity22

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 78.5% 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 ~56 days

Recently: every ~73 days

Total

12

Last Release

507d 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] (340 commits)")[![mteu](https://avatars.githubusercontent.com/u/2636487?v=4)](https://github.com/mteu "mteu (91 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.4k43.5M5.2k](/packages/larastan-larastan)[phpstan/phpstan-doctrine

Doctrine extensions for PHPStan

66466.6M1.1k](/packages/phpstan-phpstan-doctrine)[drupal/core-dev

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

2021.0M277](/packages/drupal-core-dev)[wp-cli/wp-cli-tests

WP-CLI testing framework

422.7M87](/packages/wp-cli-wp-cli-tests)[ticketswap/phpstan-error-formatter

A minimalistic error formatter for PHPStan

87578.8k35](/packages/ticketswap-phpstan-error-formatter)[calebdw/larastan-livewire

A Larastan / PHPStan extension for Livewire.

43482.4k3](/packages/calebdw-larastan-livewire)

PHPackages © 2026

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