PHPackages                             maslosoft/hedron - 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. maslosoft/hedron

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

maslosoft/hedron
================

PHP source code class header applier

2.0.2(2y ago)25.7k7AGPL-3.0-onlyPHPPHP &gt;=8.2

Since Jan 6Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Maslosoft/Hedron)[ Packagist](https://packagist.org/packages/maslosoft/hedron)[ Docs](https://maslosoft.com/hedron/)[ RSS](/packages/maslosoft-hedron/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (8)Versions (30)Used By (7)

[![Hedron Logo](https://camo.githubusercontent.com/1534a3add8224fab281272f1fbcfaebbf5a459c690407f37566ecc1248fe7b7e/68747470733a2f2f6d61736c6f736f66742e636f6d2f686564726f6e2f686564726f6e2e737667)](https://maslosoft.com/hedron/) [Maslosoft Hedron](https://maslosoft.com/hedron/)
=====================================================================================================================================================================================================================================================================================

[](#-maslosoft-hedron)

[*PHP source code class header applier*](https://maslosoft.com/hedron/)

[![Latest Stable Version](https://camo.githubusercontent.com/2395d49853bd24e5c45a3cc8a405b191d97f1a6d9318fab001cb899e4b2a2e36/68747470733a2f2f706f7365722e707567782e6f72672f6d61736c6f736f66742f686564726f6e2f762f737461626c652e737667)](https://packagist.org/packages/maslosoft/hedron "Latest Stable Version")[![License](https://camo.githubusercontent.com/c88065a95200cf688f06b962cca18082232ec3e1e4bd78c80893ed2db1eebf6f/68747470733a2f2f706f7365722e707567782e6f72672f6d61736c6f736f66742f686564726f6e2f6c6963656e73652e737667)](https://packagist.org/packages/maslosoft/hedron "License")### Quick Install

[](#quick-install)

```
composer require maslosoft/hedron
```

### Documentation

[](#documentation)

[Full Hedron Documentation](https://maslosoft.com/hedron/docs/)

Keeping class headers consitent
===============================

[](#keeping-class-headers-consitent)

When developing projects, we ofter require that file containing PHP class should have some predefined comment header. This might include package information, licensing, homepage address etc.

### Apply all at once

[](#apply-all-at-once)

This tools provides facility to modify class headers in entire project in a safe way - using PHP Tokenizer, so that it will only modify file if it's 100% safe to change it.

Hedron helps you make your class headers up to date and consistent. It will apply predefined header to all files containing namespaced class definitions.

Instalation
-----------

[](#instalation)

```
composer require maslosoft/hedron --dev

```

Usage
-----

[](#usage)

Preview list of files to apply headers

```
vendor/bin/hedron preview

```

Display rendered template

```
vendor/bin/hedron show

```

Apply header to all class files.

Backup/commit your project before continue.This will write headers to files.

```
vendor/bin/hedron commit

```

Configuration
-------------

[](#configuration)

Configuration can be provided in yaml file `.hedron.yml` in root of your project. Hedron also uses `composer.json` to make your config easier, or even unnessesary.

Here is how config might look like with example values (see `.hedron.example.yml`):

```
# All paths are realtive to your project root
# Root path or paths with sources. If blank will use composer.autoload paths.
sources: ""
# Path to template file, if blank will use vendor/maslosoft/hedron/templates/default.html (no it's not html)
template: ""
# Filter configuration, by default empty. Below is some example filter.
filter:
	whitelist:
		include:
			- app/*
		exclude:
			- app/cache/*
	blacklist:
		include:
			- app/controllers/*
		exclude:
			- app/cache/CacheProvider.php
# Reserved
# This contains composer.json as array
composer: ""
tmp: ""

```

All of this configuration is available in template.

Template
--------

[](#template)

Template uses handlebars as templating engine. It contains all data from `.hedron.yml` and `composer.json`.

Here is example, default template:

```
This software package is licensed under {{composer.license}} license.

@package {{composer.name}}
@licence {{composer.license}}
{{#each composer.authors}}
@copyright Copyright (c) {{name}}
{{/each}}
{{#if composer.homepage}}@link {{composer.homepage}}{{/if}}

```

And after rendering it looks like that:

```
/**
 * This software package is licensed under New BSD license.
 *
 * @package maslosoft/hedron
 * @licence New BSD
 *
 * @copyright Copyright (c) Peter Maselkowski
 *
 * @link http://maslosoft.com/hedron/
 */

```

Replacing
---------

[](#replacing)

This script modifies source files en masse. For safety and robustness it uses native php tokenizer and replaces everything before `namespace` token. Only that. If there is no namespace declaration file will not be modified.

Resources
---------

[](#resources)

- [Project website](https://maslosoft.com/hedron/)
- [Project Page on GitHub](https://github.com/Maslosoft/Hedron)
- [Report a Bug](https://github.com/Maslosoft/Hedron/issues)

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity86

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 100% 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 ~110 days

Recently: every ~421 days

Total

29

Last Release

1066d ago

Major Versions

1.1.21 → 2.0.02022-09-15

PHP version history (2 changes)2.0.0PHP &gt;=7.4

2.0.2PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/c0c790d4fc70028f2628e8dfd67b12a75eb8cc7c9e9db8c8347b5660c336f21c?d=identicon)[pmaselkowski](/maintainers/pmaselkowski)

---

Top Contributors

[![pmaselkowski](https://avatars.githubusercontent.com/u/520283?v=4)](https://github.com/pmaselkowski "pmaselkowski (103 commits)")

### Embed Badge

![Health badge](/badges/maslosoft-hedron/health.svg)

```
[![Health](https://phpackages.com/badges/maslosoft-hedron/health.svg)](https://phpackages.com/packages/maslosoft-hedron)
```

###  Alternatives

[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5205.3M82](/packages/symplify-monorepo-builder)[coenjacobs/mozart

Composes all dependencies as a package inside a WordPress plugin

4723.6M20](/packages/coenjacobs-mozart)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

96374.6k23](/packages/friendsoftypo3-content-blocks)[shyim/danger-php

Port of danger to PHP

8544.9k](/packages/shyim-danger-php)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)

PHPackages © 2026

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