PHPackages                             widgetsburritos/drupal-patch-checker - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. widgetsburritos/drupal-patch-checker

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

widgetsburritos/drupal-patch-checker
====================================

A simple helper script for checking composer dependencies to ensure it's not adding hook\_update\_N() functions via patches.

2.0.3(5y ago)314.2k↑146.7%3[1 PRs](https://github.com/WidgetsBurritos/drupal-patch-checker/pulls)GPL-3.0-or-laterPHPPHP &gt;=7.1

Since Dec 5Pushed 2y ago1 watchersCompare

[ Source](https://github.com/WidgetsBurritos/drupal-patch-checker)[ Packagist](https://packagist.org/packages/widgetsburritos/drupal-patch-checker)[ RSS](/packages/widgetsburritos-drupal-patch-checker/feed)WikiDiscussions master Synced yesterday

READMEChangelog (5)Dependencies (5)Versions (12)Used By (0)

Drupal Patch Checker
====================

[](#drupal-patch-checker)

A simple helper script for checking composer dependencies to ensure it's not adding `hook_update_N()` functions via patches.

Why This Exists
---------------

[](#why-this-exists)

I recently realized that [using patches containing hook\_update\_N() is risky](https://www.widgetsandburritos.com/posts/2018-12-07/patching-production-drupal-sites-hook-update-n-risky). Long story short, it could potentially create conflicts with other module updates, meaning some update hooks may never run at all. This can have some negative effects down the road. This script helps preempt those issues.

First Time Setup
----------------

[](#first-time-setup)

Install this package as a dev dependency:

```
composer require --dev widgetsburritos/drupal-patch-checker
```

Then add the following to your `composer.json` file:

```
    "scripts": {
        "check:patch": [
              "WidgetsBurritos\\DrupalPatchChecker\\DrupalPatchChecker::checkComposerFile"
         ],
    }
```

Checking Patches Manually
-------------------------

[](#checking-patches-manually)

You can check your patches manually by running: `composer run check:patch`

This will produce a result similar to this:

```
$ composer run check:patch
> WidgetsBurritos\DrupalPatchChecker\DrupalPatchChecker::checkComposerFile
Script WidgetsBurritos\DrupalPatchChecker\DrupalPatchChecker::checkComposerFile handling the check:patch event terminated with an exception

  [Exception]
  patches/language_hierarchy/language_hierarchy-limit_views_results-2825851-14.patch contains hook_update_N() on Line 50.
```

Checking Patches Automatically on Package Install/Update
--------------------------------------------------------

[](#checking-patches-automatically-on-package-installupdate)

If you want to prevent patches from getting installed altogether update your `composer.json` file accordingly:

```
    "scripts": {
        "check:patch": [
              "WidgetsBurritos\\DrupalPatchChecker\\DrupalPatchChecker::checkComposerFile"
         ],
         "post-install-cmd": [
              "composer run check:patch"
         ],
         "post-update-cmd": [
              "composer run check:patch"
         ],
    }
```

Then the next time you run `composer install` or `composer update` if your project contains a patch with `hook_update_N()` it will throw an exception.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 87.8% 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 ~127 days

Recently: every ~189 days

Total

7

Last Release

2005d ago

Major Versions

1.0.2 → 2.0.02020-12-18

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5263371?v=4)[David Stinemetze](/maintainers/WidgetsBurritos)[@WidgetsBurritos](https://github.com/WidgetsBurritos)

---

Top Contributors

[![WidgetsBurritos](https://avatars.githubusercontent.com/u/5263371?v=4)](https://github.com/WidgetsBurritos "WidgetsBurritos (36 commits)")[![pobtastic](https://avatars.githubusercontent.com/u/1250035?v=4)](https://github.com/pobtastic "pobtastic (4 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

checkercomposer-plugindrupaldrupal-8patching

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/widgetsburritos-drupal-patch-checker/health.svg)

```
[![Health](https://phpackages.com/badges/widgetsburritos-drupal-patch-checker/health.svg)](https://phpackages.com/packages/widgetsburritos-drupal-patch-checker)
```

###  Alternatives

[symfony/runtime

Enables decoupling PHP applications from global state

74798.8M1.0k](/packages/symfony-runtime)[drupal/core-composer-scaffold

A flexible Composer project scaffold builder.

5344.1M564](/packages/drupal-core-composer-scaffold)[drupal/core-project-message

Adds a message after Composer installation.

2124.7M203](/packages/drupal-core-project-message)[vaimo/composer-patches

Applies a patch from a local or remote file to any package that is part of a given composer project. Patches can be defined both on project and on package level. Optional support for patch versioning, sequencing, custom patch applier configuration and patch command for testing/troubleshooting added patches.

3014.6M26](/packages/vaimo-composer-patches)[sandersander/composer-link

Adds ability to link local packages for development with composer

98457.9k](/packages/sandersander-composer-link)[phpro/grumphp-shim

GrumPHP Phar distribution

294.7M340](/packages/phpro-grumphp-shim)

PHPackages © 2026

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