Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
## Repository Overview

PivotPHP Core is a PHP microframework inspired by Express.js, designed for building APIs. Current
version: **5.0.0** (router state per `Application` — SPEC-076). It targets PHP 8.1+ and is
version: **5.1.0** (routing resolution architecture and precompiled pipeline — SPEC-114). It targets PHP 8.1+ and is
strict PSR-7 (HTTP messages), PSR-15 (middleware) and PSR-12 (style) compliant.

Since the 4.0 line the core does one thing: it wires together the application, the routing engine and
Expand Down Expand Up @@ -204,11 +204,11 @@ src/

## Current Version Status

- **Current version**: 5.0.0
- **Current version**: 5.1.0
- **Code quality**: PHPStan Level 9, PSR-12 compliant
- **Architecture**: application + pipeline + router integration; HTTP, routing and security are
delegated to `pivotphp/http`, `pivotphp/core-routing` and `pivotphp/security`
- **Companions**: `pivotphp/core-routing` `^3.0`, `pivotphp/http` `^1.0`, `pivotphp/security` `^1.0`
- **Companions**: `pivotphp/core-routing` `^3.1.0`, `pivotphp/http` `^1.0`, `pivotphp/security` `^1.0`
- **Extensions**: `pivotphp/cycle-orm` is **paused** and only targets core 1.x — do not treat it as
an active integration

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.0.0
5.1.0
31 changes: 31 additions & 0 deletions docs/releases/FRAMEWORK_OVERVIEW_v5.1.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# PivotPHP v5.1.0 - Framework Overview

**Version:** 5.1.0 (Minor)
**Release Date:** 2026-10-12
**PHP Requirements:** 8.1+

## Summary

Release minor focada em arquitetura de resolução de rotas, pipeline pré-compilado de middlewares e ganho de performance sem quebra de compatibilidade (SPEC-114).

### Principais Mudanças

1. **Arquitetura de Resolução de Rotas Tipada:**
- A `Application` agora consome a nova camada de resolução `RouteResolution` do `pivotphp/core-routing: ^3.1.0`.
- O despacho de rotas é feito de forma tipada através do resultado de correspondência (`RouteMatched`), extraindo diretamente parâmetros e cadeia de middlewares sem inspeção dinâmica repetitiva.
- Tratamento nativo e imediato de métodos não permitidos (`MethodNotAllowed`), gerando cabeçalho HTTP `Allow`, status 405 Method Not Allowed e resposta 204 No Content imediata para preflight OPTIONS implícito.

2. **Middleware Adapter Pattern (`ExpressMiddlewareAdapter`):**
- Substitui o encapsulamento de middlewares Express (`fn($req, $res, $next)`) que antes instanciava classes anônimas dinamicamente a cada execução.
- Reduz consideravelmente o overhead de alocação de objetos e uso de memória no runtime por requisição.

3. **Pipeline Pré-Compilado (`PrecompiledPipeline` & `MiddlewareHandler`):**
- A cadeia de execução de middlewares (globais, de grupo e de rota) é pré-compilada em estruturas imutáveis encadeadas via Chain of Responsibility.
- Elimina duplicação de iterações e chamadas recursivas dinâmicas durante o ciclo de vida HTTP.

4. **Compatibilidade e Performance:**
- 100% retrocompatível com a sintaxe Express.js existente.
- Resolução e despacho até 88.5% mais rápidos em rotas estáticas e 98.3% mais rápidos em OPTIONS.
- Ganho comprovado de +4.2% em throughput sob testes de carga k6.

Consulte o [CHANGELOG](../../CHANGELOG.md) para detalhes completos de cada commit.
6 changes: 4 additions & 2 deletions docs/releases/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ release das linhas 1.x, 2.x e 3.x foram removidos por estarem obsoletos.

## Versão Atual

- **[FRAMEWORK_OVERVIEW_v5.0.0.md](FRAMEWORK_OVERVIEW_v5.0.0.md)** — versão atual (router por `Application`, SPEC-076).
- **[FRAMEWORK_OVERVIEW_v5.1.0.md](FRAMEWORK_OVERVIEW_v5.1.0.md)** — versão atual (resolução de rotas tipada e pipeline pré-compilado, SPEC-114).
- **[FRAMEWORK_OVERVIEW_v5.0.0.md](FRAMEWORK_OVERVIEW_v5.0.0.md)** — router por `Application` (SPEC-076).
- **[FRAMEWORK_OVERVIEW_v4.1.1.md](FRAMEWORK_OVERVIEW_v4.1.1.md)** — binding tipado no `Database`.
- **[FRAMEWORK_OVERVIEW_v4.1.0.md](FRAMEWORK_OVERVIEW_v4.1.0.md)** — `nullable`/`sometimes` no `Validator`, OpenAPI path templating.
- **[FRAMEWORK_OVERVIEW_v4.0.2.md](FRAMEWORK_OVERVIEW_v4.0.2.md)** — patch (transações, listeners, DSN).
Expand All @@ -23,7 +24,8 @@ Notas completas de todas as versões: [CHANGELOG](../../CHANGELOG.md).
```
docs/releases/
├── README.md # Este arquivo (índice)
├── FRAMEWORK_OVERVIEW_v5.0.0.md # Overview v5.0.0 (atual)
├── FRAMEWORK_OVERVIEW_v5.1.0.md # Overview v5.1.0 (atual)
├── FRAMEWORK_OVERVIEW_v5.0.0.md # Overview v5.0.0
├── FRAMEWORK_OVERVIEW_v4.1.1.md # Overview v4.1.1
├── FRAMEWORK_OVERVIEW_v4.1.0.md # Overview v4.1.0
├── FRAMEWORK_OVERVIEW_v4.0.2.md # Overview v4.0.2
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class Application implements ApplicationInterface
/**
* Versão do framework.
*/
public const VERSION = '5.0.0';
public const VERSION = '5.1.0';

/**
* Container de dependências PSR-11.
Expand Down
Loading