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.3(2mo ago)27241.1k↓24.3%12[102 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 ^8

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

READMEChangelog (10)Dependencies (30)Versions (173)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

58

—

FairBetter than 98% of packages

Maintenance68

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 ~22 days

Recently: every ~12 days

Total

144

Last Release

63d 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 (3673 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

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[coenjacobs/mozart

Composes all dependencies as a package inside a WordPress plugin

4723.6M20](/packages/coenjacobs-mozart)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[illuminate/session

The Illuminate Session package.

9937.4M753](/packages/illuminate-session)[yireo/magento2-extensionchecker

Scan the code of a Magento module

96151.6k3](/packages/yireo-magento2-extensionchecker)[hyperf/di

A DI for Hyperf.

182.8M594](/packages/hyperf-di)

PHPackages © 2026

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