PHPackages                             1d98/framework - 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. [Framework](/categories/framework)
4. /
5. 1d98/framework

ActiveLibrary[Framework](/categories/framework)

1d98/framework
==============

Universal zero-dependency PHP 8.5 framework skeleton

v0.7.2(3w ago)01MITPHPPHP ^8.5

Since Jun 10Pushed 3w agoCompare

[ Source](https://github.com/1d98/Framework)[ Packagist](https://packagist.org/packages/1d98/framework)[ Docs](https://github.com/1d98/framework)[ RSS](/packages/1d98-framework/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (5)Dependencies (2)Versions (6)Used By (0)

Framework
=========

[](#framework)

A universal **zero-dependency** PHP 8.5 framework skeleton. Immutability by default, strict types everywhere, and PHPStan max from day one.

Why?
----

[](#why)

Most PHP frameworks drag in a hundred transitive dependencies and lock you into abstractions. This one is the opposite: a thin, opinionated core with **no runtime dependencies**, written for the modern PHP 8.5 feature set.

- **Zero runtime deps.** Only `phpunit` and `phpstan` for dev.
- **Final readonly value objects** — no setters, no surprises.
- **PSR-4 autoloading** under the `Framework\` namespace.
- **PHPStan level max** passes on the entire codebase.
- **Immutable Config** with `with()` for safe overrides.
- **DI Container** with autowiring via reflection.
- **HTTP stack** with a tiny router, middleware pipeline, RFC 7807 errors, and exception-aware kernel.
- **Production-safe by default** — generic exception messages are hidden, opt in to debug mode to expose them. Test count is tracked by CI.

[![CI](https://github.com/1d98/framework/actions/workflows/ci.yml/badge.svg)](https://github.com/1d98/framework/actions/workflows/ci.yml)[![Latest release](https://camo.githubusercontent.com/d72fc0b7a0dd6ec54c801711c35e225a02911a65f24216750987dab1791f86a2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f316439382f6672616d65776f726b3f696e636c7564655f70726572656c6561736573266c6162656c3d72656c65617365)](https://github.com/1d98/framework/releases)

See [the CI workflow](https://github.com/1d98/framework/actions/workflows/ci.yml) for the current number.

Requirements
------------

[](#requirements)

- **PHP 8.5** or higher
- **Composer 2.x**

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

[](#installation)

```
composer install
```

Quick start (CLI)
-----------------

[](#quick-start-cli)

```
php bin/framework
```

Quick start (Web)
-----------------

[](#quick-start-web)

```
php -S localhost:8000 -t public
```

Set `APP_DEBUG=1` to enable debug mode (exposes exception messages and traces).

Then open . Try:

URLWhat it does`/`HTML landing page`/json`JSON response echoing the request`/hello/{name}`Path parameter — try `/hello/world``/api/v1/users`Grouped route (JSON list)`/api/v1/echo` (POST)JSON body parser — send `{"hello":"world"}``/api/v1/form` (POST)Form body parser — send `name=Alice&age=30``/boom`Throws `NotFoundHttpException` → 404 problem details`/missing`404 problem detailsHello, World
------------

[](#hello-world)

```
use Framework\Http\Request\Request;
use Framework\Http\Response\Response;
use Framework\Http\Router\Router;

$router = new Router();
$router->get('/hello/{name}', static fn(Request $r, array $p): Response
    => Response::text("Hello, {$p['name']}!"));
```

The router sorts routes by specificity (static beats `{param}`), and patterns are compiled on `Route` construction.

Streaming responses
-------------------

[](#streaming-responses)

For bodies too large or too long-lived to buffer in memory — Server-Sent Events, NDJSON exports, large-file downloads — return a `StreamedResponse` from the handler. The body is produced at `send()` time by a `Closure(resource): void` emitter; `Transfer-Encoding: chunked` is handled automatically. Static helpers cover the common wire formats:

```
use Framework\Http\Request\Request;
use Framework\Http\Response\ResponseInterface;
use Framework\Http\Response\Sse;
use Framework\Http\Response\StreamedResponse;

$router->get('/events', static fn(Request $r): ResponseInterface
    => StreamedResponse::sse(static function ($stream): void {
        Sse::event($stream, json_encode(['n' => 0]), event: 'tick');
    }));
```

See [docs/streaming-response.md](docs/streaming-response.md) for the SSE / NDJSON / large-file-download recipes, deployment gotchas (PHP-FPM `output_buffering = Off`, nginx `X-Accel-Buffering: no`, Apache `mod_buffer`), and PHPUnit testing patterns.

Project structure
-----------------

[](#project-structure)

```
.
├── bin/framework                 # CLI entry point
├── public/index.php              # Web entry point with demo routes
├── examples/full-app.php         # Echo + JSON example (minimal wiring)
├── examples/auth-app.php         # Login/CSRF/signed-cookie/DTO example (realistic)
├── src/                          # Framework source (Framework\ namespace)
├── tests/                        # PHPUnit tests (Unit + Integration)
├── var/tmp/                      # Project-local tmp dir (gitignored)
├── docs/                         # Reference documentation
├── .github/workflows/ci.yml      # GitHub Actions CI
├── composer.json
├── phpunit.xml
├── phpstan.neon
├── CONTRIBUTING.md
├── LICENSE
└── README.md

```

For the full module layout, see [docs/README.md](docs/README.md).

Documentation
-------------

[](#documentation)

See [docs/README.md](docs/README.md) for the full index.

Development
-----------

[](#development)

```
composer test    # run all tests
composer stan    # PHPStan level max
composer check   # both
```

Contributing
------------

[](#contributing)

See [CONTRIBUTING.md](CONTRIBUTING.md).

License
-------

[](#license)

[MIT](LICENSE)

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance94

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

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

Total

5

Last Release

25d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/205b7fb76f5a85974f550bae09f090737e2545f1f884323a64adf4d02700b56b?d=identicon)[1d98](/maintainers/1d98)

---

Top Contributors

[![1d98](https://avatars.githubusercontent.com/u/290872652?v=4)](https://github.com/1d98 "1d98 (7 commits)")

---

Tags

frameworkSkeletonimmutablephp85zero-dependency

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/1d98-framework/health.svg)

```
[![Health](https://phpackages.com/badges/1d98-framework/health.svg)](https://phpackages.com/packages/1d98-framework)
```

PHPackages © 2026

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