PHPackages                             drupal-code-builder/drupal-code-builder - 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. drupal-code-builder/drupal-code-builder

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

drupal-code-builder/drupal-code-builder
=======================================

Code generator for Drupal

4.6.6(1w ago)27253.3k↓47.1%12[118 issues](https://github.com/drupal-code-builder/drupal-code-builder/issues)[2 PRs](https://github.com/drupal-code-builder/drupal-code-builder/pulls)1GPL-2.0+PHPPHP ^8CI failing

Since Apr 21Pushed 1w ago1 watchersCompare

[ Source](https://github.com/drupal-code-builder/drupal-code-builder)[ Packagist](https://packagist.org/packages/drupal-code-builder/drupal-code-builder)[ RSS](/packages/drupal-code-builder-drupal-code-builder/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (75)Versions (177)Used By (1)

Drupal Code Builder is a system for generating scaffold code for Drupal modules (and other components).

This is a library, and has no UI of its own. It can be used in several ways:

- with the [Drupal Module Builder project](https://www.drupal.org/project/module_builder), which provides a UI within Drupal. (The Drupal Code Builder library was formerly part of the Module Builder module.)
- with the [Drush command extension](https://github.com/drupal-code-builder/drupal-code-builder-drush).

Drupal Code Builder can be used for any current version of Drupal. Older versions are unsupported, but it should produce code for versions going far back as Drupal 5.

Tests powered by PHPUnit ensure that the generated PHP code passes PHP linting, and adheres to Drupal Coding Standards, as enforced by PHP CodeSniffer.

What Drupal Code Builder can do
-------------------------------

[](#what-drupal-code-builder-can-do)

Drupal Code Builder can generate the following for a module:

- code files, containing hook implementations
- info.yml file (.info file on Drupal 7 and older)
- README file
- PHPUnit test case classes, with presets for different types
- Simpletest test case classes
- annotated class plugins
- YAML file plugins
- services, with presets for tagged service types
- content entity types, with bundle entity and base fields
- config entity types, with properties
- plugin types
- theme hooks

Definitions of hooks, plugin types, and tagged service types are obtained by analyzing the current Drupal codebase of the site where the library is used. This means that Drupal Code Builder automatically knows about all hooks and plugin types from contrib and custom modules as well as those in Drupal core.

Furthermore, complex subcomponents can generate multiple code elements:

- an admin settings form adds form builder functions and an admin permission
- router paths add menu/router items
- permission names add the scaffold for the permission definition

Installation
------------

[](#installation)

Follow the instructions given in the component that requests Drupal Coder Builder (e.g., Module Builder, Drush command).

Additionally, if [Plugin module](https://www.drupal.org/project/plugin) is present, plugin type definitions will be enhanced with its data.

###  Health Score

61

—

FairBetter than 98% of packages

Maintenance78

Regular maintenance activity

Popularity46

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 98.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 ~23 days

Total

147

Last Release

10d ago

Major Versions

3.3.19 → 4.0.02020-08-31

3.3.20 → 4.1.92021-06-06

PHP version history (6 changes)3.2.17PHP ^7.0

4.1.4PHP ^7.1

4.1.9PHP ^7.3

4.1.11PHP ^7.4

4.1.13PHP ^7.4 || ^8

4.2.5PHP ^8

### Community

Maintainers

![](https://www.gravatar.com/avatar/21043d4af2cb62a3e316647f63749d05fcbab1c9bd5e67ffa2079b0117e8f65a?d=identicon)[joachim-n](/maintainers/joachim-n)

---

Top Contributors

[![joachim-n](https://avatars.githubusercontent.com/u/105262?v=4)](https://github.com/joachim-n "joachim-n (3689 commits)")[![webchick](https://avatars.githubusercontent.com/u/332535?v=4)](https://github.com/webchick "webchick (34 commits)")[![jedihe](https://avatars.githubusercontent.com/u/5003035?v=4)](https://github.com/jedihe "jedihe (7 commits)")[![dww](https://avatars.githubusercontent.com/u/203658?v=4)](https://github.com/dww "dww (1 commits)")[![alvar0hurtad0](https://avatars.githubusercontent.com/u/1130114?v=4)](https://github.com/alvar0hurtad0 "alvar0hurtad0 (1 commits)")[![RobLoach](https://avatars.githubusercontent.com/u/25086?v=4)](https://github.com/RobLoach "RobLoach (1 commits)")[![wturrell](https://avatars.githubusercontent.com/u/848021?v=4)](https://github.com/wturrell "wturrell (1 commits)")

---

Tags

code-generationdrupal

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/drupal-code-builder-drupal-code-builder/health.svg)

```
[![Health](https://phpackages.com/badges/drupal-code-builder-drupal-code-builder/health.svg)](https://phpackages.com/packages/drupal-code-builder-drupal-code-builder)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[coenjacobs/mozart

Composes all dependencies as a package inside a WordPress plugin

4814.0M25](/packages/coenjacobs-mozart)[brianhenryie/strauss

Prefixes dependencies namespaces so they are unique to your plugin

190438.1k36](/packages/brianhenryie-strauss)[phlak/directory-lister

PHP directory lister

2.5k1.4k](/packages/phlak-directory-lister)[typo3/cms-install

TYPO3 CMS Install Tool - The Install Tool is used for installation, upgrade, system administration and setup tasks.

1812.3M495](/packages/typo3-cms-install)[jolicode/castor

A lightweight and modern task runner. Automate everything. In PHP.

54743.1k4](/packages/jolicode-castor)

PHPackages © 2026

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