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)313.7k↓11.1%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 1mo ago

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

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

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

1960d ago

Major Versions

1.0.2 → 2.0.02020-12-18

### Community

Maintainers

![](https://www.gravatar.com/avatar/5a2f8b992f4fed87cf639116571c03e74e16abfde81a8e27f1c721a6e3175a30?d=identicon)[WidgetsBurritos](/maintainers/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

[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.

2994.3M16](/packages/vaimo-composer-patches)[mglaman/composer-drupal-lenient

1317.4M15](/packages/mglaman-composer-drupal-lenient)[drupal/core-composer-scaffold

A flexible Composer project scaffold builder.

5341.9M446](/packages/drupal-core-composer-scaffold)[drupal/core-project-message

Adds a message after Composer installation.

2122.6M172](/packages/drupal-core-project-message)[olvlvl/composer-attribute-collector

A convenient and near zero-cost way to retrieve targets of PHP 8 attributes

184108.8k8](/packages/olvlvl-composer-attribute-collector)[lullabot/drainpipe

An automated build tool to allow projects to have a set standardized operations scripts.

41716.4k2](/packages/lullabot-drainpipe)

PHPackages © 2026

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