PHPackages                             struggle-for-php/sfp-deptrac-builtin - 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. struggle-for-php/sfp-deptrac-builtin

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

struggle-for-php/sfp-deptrac-builtin
====================================

Deptrac extension to enforce application on framework rule.

0.2.1(2y ago)12.1k↓37.1%1MITPHPPHP ~8.1.0 || ~8.2.0 || ~8.3.0

Since Mar 18Pushed 2y ago1 watchersCompare

[ Source](https://github.com/struggle-for-php/sfp-deptrac-builtin)[ Packagist](https://packagist.org/packages/struggle-for-php/sfp-deptrac-builtin)[ RSS](/packages/struggle-for-php-sfp-deptrac-builtin/feed)WikiDiscussions 0.3.x Synced 2d ago

READMEChangelog (3)Dependencies (8)Versions (9)Used By (0)

Deptrac extension to enforce application on framework rule.
===========================================================

[](#deptrac-extension-to-enforce-application-on-framework-rule)

PHP Web application on framework should not use network function like `header()`. But this rule is **Implicit** !. This extension is attempted to find violate such rule.

Example
-------

[](#example)

- examples/src/Action/UserShowAction.php includes

```
    public function handle(ServerRequestInterface $request): ResponseInterface
    {
        \header('Location: http://www.example.com/');
    }

```

```
$ cd examples/
$ ./vendor/bin/deptrac analyse
 107/107 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ----------- ----------------------------------------------------------------------------------
  Reason      Action
 ----------- ----------------------------------------------------------------------------------
  Violation   Foo\Action\UserShowAction must not depend on header() (Sending Raw HTTP)
              /home/sasezaki/dev/sfp-deptrac-builtin/examples/src/Action/UserShowAction.php:20
 ----------- ----------------------------------------------------------------------------------

 -------------------- -----
  Report
 -------------------- -----
  Violations           1
  Skipped violations   0
  Uncovered            24
  Allowed              48
  Warnings             0
  Errors               0
 -------------------- -----

```

Q&amp;A
-------

[](#qa)

- Q. Why not use PHPCS `forbiddenFunctionNames` ?

    - A. IMO, `forbiddenFunctionNames` is only should be used for dangerous function (its own) or alias function. Reason of forbidden `header()` usage in application is layer problem.
- Q. When called `header()` with `'Location: ...`, then should be called `exit()` on same scope, is it not ?

    - A. Maybe..

Inspired
--------

[](#inspired)

This extension is developed inspired from this talk.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

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

Recently: every ~112 days

Total

7

Last Release

756d ago

PHP version history (3 changes)0.1.0PHP ~8.1.0

0.2.0PHP ~8.1.0 || ~8.2.0

0.2.1PHP ~8.1.0 || ~8.2.0 || ~8.3.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/4eed2726ad1fce689a99672d965d8b4a387f030f08290e00708b66e4621139d2?d=identicon)[sasezaki](/maintainers/sasezaki)

---

Top Contributors

[![sasezaki](https://avatars.githubusercontent.com/u/42755?v=4)](https://github.com/sasezaki "sasezaki (39 commits)")

---

Tags

static analysisheaderdeptrac

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/struggle-for-php-sfp-deptrac-builtin/health.svg)

```
[![Health](https://phpackages.com/badges/struggle-for-php-sfp-deptrac-builtin/health.svg)](https://phpackages.com/packages/struggle-for-php-sfp-deptrac-builtin)
```

###  Alternatives

[phpdocumentor/reflection-common

Common reflection classes used by phpdocumentor to reflect the code structure

9.1k736.5M37](/packages/phpdocumentor-reflection-common)[friendsofphp/php-cs-fixer

A tool to automatically fix PHP code style

13.5k251.2M25.3k](/packages/friendsofphp-php-cs-fixer)[willdurand/negotiation

Content Negotiation tools for PHP provided as a standalone library.

1.4k129.0M215](/packages/willdurand-negotiation)[deptrac/deptrac

Deptrac is a static code analysis tool that helps to enforce rules for dependencies between software layers.

3.0k8.8M118](/packages/deptrac-deptrac)[phpstan/extension-installer

Composer plugin for automatic installation of PHPStan extensions

506109.3M11.4k](/packages/phpstan-extension-installer)[icanhazstring/composer-unused

Show unused packages by scanning your code

1.7k7.9M224](/packages/icanhazstring-composer-unused)

PHPackages © 2026

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