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
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,38 @@ All notable changes to the PivotPHP Framework will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.2.0] - 2026-10-08 - Route Syntax & DX Edition

> Includes the PSR-7 2.0 compatibility fix documented below under `[2.1.1]`
> (that patch release was never tagged; its changes ship in 2.2.0).

### Added

- **Brace-delimited route parameters** (`{id}` and `{id<constraint>}`) work end-to-end,
equivalent to the colon syntax (`:id`). Requires `pivotphp/core-routing` `^1.2`.
([SPEC-002](https://github.com/PivotPHP/pivotphp-specs/blob/main/SPECS/SPEC-002-brace-params.md))
- **Array callables `[Classe::class, 'métodoDeInstância']`** resolve via the DI container
(falling back to lazy instantiation) instead of throwing `InvalidArgumentException`.
([SPEC-003](https://github.com/PivotPHP/pivotphp-specs/blob/main/SPECS/SPEC-003-array-callable.md))
- **`Request::body()`** method — Express-style accessor returning the parsed body as
`stdClass` (alias of `getBodyAsStdClass()`).
([SPEC-004](https://github.com/PivotPHP/pivotphp-specs/blob/main/SPECS/SPEC-004-request-body.md))
- **SQLite support in `Database::connect()`** (`driver => 'sqlite'`,
`database => '<path>'|':memory:'`).
([SPEC-005](https://github.com/PivotPHP/pivotphp-specs/blob/main/SPECS/SPEC-005-database-sqlite.md))
- **`PivotPHP\Core\Application` backward-compatibility alias** to
`PivotPHP\Core\Core\Application`.
([SPEC-001](https://github.com/PivotPHP/pivotphp-specs/blob/main/SPECS/SPEC-001-application-fqcn.md))

### Fixed

- `getBodyAsStdClass()` no longer discards the body on `DELETE` requests.
([SPEC-006](https://github.com/PivotPHP/pivotphp-specs/blob/main/SPECS/SPEC-006-delete-body.md))

### Changed

- `pivotphp/core-routing` dependency bumped from `^1.0` to `^1.2`.

## [2.1.1] - 2026-07-15 - PSR-7 2.0 Compatibility Fix

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.1
2.2.0
2 changes: 1 addition & 1 deletion docs/API_REFERENCE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PivotPHP Core - API Reference

**Version:** 2.1.1
**Version:** 2.2.0

> ⚠️ **Nota de revisão:** este documento foi originalmente escrito para a v1.1.3/v1.2.0. A
> assinatura do construtor de `Application` e alguns exemplos foram corrigidos para refletir
Expand Down
18 changes: 13 additions & 5 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PivotPHP Core v2.1.1 Documentation
# PivotPHP Core v2.2.0 Documentation

Welcome to the complete documentation for **PivotPHP Core v2.1.1** - a high-performance, lightweight PHP microframework inspired by Express.js, designed for building APIs and web applications with exceptional speed and simplicity.
Welcome to the complete documentation for **PivotPHP Core v2.2.0** - a high-performance, lightweight PHP microframework inspired by Express.js, designed for building APIs and web applications with exceptional speed and simplicity.

## 🚀 Quick Navigation

Expand Down Expand Up @@ -40,7 +40,15 @@ Welcome to the complete documentation for **PivotPHP Core v2.1.1** - a high-perf
3. [Service Providers](technical/providers/README.md) - Dependency injection
4. [Extensions](technical/extensions/README.md) - Framework extensions

## ✨ What's Current (v2.1.x)
## ✨ What's Current (v2.2.x)

### 🎯 **v2.2.0 — Route Syntax & DX Edition**
- Brace-delimited route parameters (`{id}` / `{id<constraint>}`) — equivalent to `:id`.
- Array callables `[Classe::class, 'métodoDeInstância']` resolved via the DI container.
- New `Request::body()` method; `getBodyAsStdClass()` no longer discards `DELETE` bodies.
- SQLite support in `Database::connect()`.
- `PivotPHP\Core\Application` backward-compatibility alias.
- Carries the PSR-7 2.0 compatibility fix (recorded below as `v2.1.1`, never tagged).

### 🩹 **v2.1.1 — PSR-7 2.0 Compatibility Fix**
- Fixed a real incompatibility with `psr/http-message` 2.0 that could fatal-error every
Expand All @@ -62,7 +70,7 @@ See the [CHANGELOG](../CHANGELOG.md) for complete release notes.

## 📜 Previous Versions (Historical)

The v2.1.x line above is current. Earlier releases, most recent first:
The v2.2.x line above is current. Earlier releases, most recent first:
**v2.0.0** (Legacy Cleanup Edition) → **v1.2.0** (Simplicity Edition) → **v1.1.4**
(Developer Experience) → **v1.1.3** (Performance Breakthrough) and earlier — see the
[CHANGELOG](../CHANGELOG.md) for the complete history.
Expand Down Expand Up @@ -91,7 +99,7 @@ complete v1.1.4 release documentation suite.

## 🔧 Framework Status

- **Current Version**: v2.1.1 (PSR-7 2.0 Compatibility Fix)
- **Current Version**: v2.2.0 (Route Syntax & DX Edition)
- **PHP Requirements**: 8.1+ with strict typing
- **Production Ready**: Enterprise-grade quality with type safety
- **Community**: [GitHub](https://github.com/PivotPHP)
Expand Down
8 changes: 4 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ Bem-vindo ao guia completo do PivotPHP! Esta documentação foi criada para ser

Todas as entradas abaixo linkam para o registro oficial da versão — um documento
`FRAMEWORK_OVERVIEW` dedicado quando existe um, ou a entrada correspondente no
[CHANGELOG](../CHANGELOG.md) quando não existe (ainda não foi escrito um overview
técnico para v2.1.1/v2.1.0, releases pequenas/patch):
[CHANGELOG](../CHANGELOG.md) quando não existe:

- [**v2.1.1 (Atual)**](../CHANGELOG.md) - PSR-7 2.0 Compatibility Fix
- [**v2.2.0 (Atual)**](releases/FRAMEWORK_OVERVIEW_v2.2.0.md) - Route Syntax & DX Edition
- [**v2.1.1**](../CHANGELOG.md) - PSR-7 2.0 Compatibility Fix (nunca taggeada; incluída na v2.2.0)
- [**v2.1.0**](../CHANGELOG.md) - Response Emission, Pool Safety & Deprecation Cycle
- [**v2.0.0**](releases/FRAMEWORK_OVERVIEW_v2.0.0.md) - Modular Routing & Legacy Cleanup Edition
- [**v1.2.0**](releases/FRAMEWORK_OVERVIEW_v1.2.0.md) - Simplicity Edition: Arquitetura simplificada
Expand Down Expand Up @@ -109,4 +109,4 @@ técnico para v2.1.1/v2.1.0, releases pequenas/patch):

---

*📖 Documentação atualizada em: 15 de julho de 2026 - v2.1.1*
*📖 Documentação atualizada em: 08 de outubro de 2026 - v2.2.0*
4 changes: 2 additions & 2 deletions docs/quick-start.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Quick Start Guide

Get up and running with PivotPHP Core v2.1.1 in under 5 minutes! This guide will walk you through installation, basic setup, and creating your first API endpoints.
Get up and running with PivotPHP Core v2.2.0 in under 5 minutes! This guide will walk you through installation, basic setup, and creating your first API endpoints.

## 🚀 Installation

Expand Down Expand Up @@ -274,4 +274,4 @@ $app->use(new CorsMiddleware(['allowed_origins' => ['*']]));

---

**Parabéns!** Agora você tem uma base sólida para criar provas de conceito e protótipos com PivotPHP Core v2.1.1. 🎉
**Parabéns!** Agora você tem uma base sólida para criar provas de conceito e protótipos com PivotPHP Core v2.2.0. 🎉
96 changes: 96 additions & 0 deletions docs/releases/FRAMEWORK_OVERVIEW_v2.2.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# PivotPHP v2.2.0 - Framework Overview

**Version:** 2.2.0 (Route Syntax & DX Edition)
**Release Date:** 2026-10-08
**PHP Requirements:** 8.1+

---

## 🎯 Executive Summary

PivotPHP v2.2.0 is a **minor release** focused on developer experience and routing
flexibility. It adds brace-delimited route parameters (`{id}`) as an alternative to the
colon syntax, resolves instance-method array callables through the DI container, introduces
the Express-style `Request::body()` accessor, and adds SQLite support to the `Database`
wrapper — while keeping full backward compatibility.

> This release also ships the PSR-7 2.0 compatibility fix that was previously recorded
> under `[2.1.1]` but never tagged.

### Release Highlights

- ✅ **Brace route parameters** (`{id}` / `{id<constraint>}`) — equivalent to `:id`.
- ✅ **Array callables `[Classe::class, 'métodoDeInstância']`** resolved via DI container.
- ✅ **`Request::body()`** — Express-style body accessor.
- ✅ **SQLite support** in `Database::connect()`.
- ✅ **`PivotPHP\Core\Application`** backward-compatibility alias.
- ✅ **PSR-7 2.0** (`psr/http-message` `^1.1|^2.0`) dual support (carried from 2.1.1).

---

## 🏗️ What Changed

### 1. Route Parameters — `{id}` syntax

Routes now accept both `:id` and `{id}` (with optional constraint `{id<\d+>}`), backed by
the same constraint/shortcut/ReDoS validation in the routing engine. Requires
`pivotphp/core-routing` `^1.2`.

```php
$app->get('/users/:id', fn($req, $res) => $res->json(['id' => $req->param('id')]));
$app->get('/books/{isbn}', fn($req, $res) => $res->json(['isbn' => $req->param('isbn')]));
```

### 2. Array Callables with Instance Methods

`[UserController::class, 'index']` now resolves the instance through the DI container when
registered, and falls back to lazy instantiation otherwise (previously threw
`InvalidArgumentException` for non-static methods).

### 3. Request Body Access

`Request::body()` returns the parsed body as `stdClass` (alias of `getBodyAsStdClass()`).
`getBodyAsStdClass()` no longer discards the body on `DELETE` requests.

### 4. Database SQLite

`Database::connect()` supports `driver => 'sqlite'` (`database` = path or `:memory:`), in
addition to MySQL/MariaDB/PostgreSQL via host/port.

---

## 📊 Technical Metrics

| Metric | v2.2.0 |
|--------|--------|
| **PSR-7** | `psr/http-message` `^1.1\|^2.0` (dual support) |
| **PSR-15** | Compliant |
| **PSR-3** | `Logging\PsrLogger` |
| **PSR-11** | `Providers\Container` |
| **PSR-14** | `Events\EventDispatcher` |
| **PHPStan** | Level 9 |
| **Coding style** | PSR-12 |
| **Tests** | 1092 CI + 34 integration |

### Performance

PivotPHP v2.2.0 maintains the performance characteristics of the v2.x line (object pooling,
JSON optimization, route caching). The new `{id}` syntax compiles to the same regex patterns
as `:id`, so there is no matching-time regression. The array-callable container resolution
happens once at route registration, not per request.

---

## 🔧 Compatibility

- **Backward compatible** with v2.x — `:id` syntax, static array callables, and instance
array callables all keep working.
- `pivotphp/core-routing` bumped from `^1.0` to `^1.2`.

---

## 📚 Related Documentation

- `CHANGELOG.md` — detailed change log.
- `docs/technical/routing/SYNTAX_GUIDE.md` — route handler and parameter syntax.
- `docs/releases/FRAMEWORK_OVERVIEW_v2.1.1.md` — previous (PSR-7 fix) overview.
2 changes: 1 addition & 1 deletion src/Core/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Application implements ApplicationInterface
/**
* Versão do framework.
*/
public const VERSION = '2.1.1';
public const VERSION = '2.2.0';

/**
* Container de dependências PSR-11.
Expand Down
4 changes: 2 additions & 2 deletions tests/Core/ApplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ private function removeDirectory(string $dir): void
public function testApplicationInitialization(): void
{
$this->assertInstanceOf(Application::class, $this->app);
$this->assertEquals('2.1.1', Application::VERSION);
$this->assertEquals('2.1.1', $this->app->version());
$this->assertEquals('2.2.0', Application::VERSION);
$this->assertEquals('2.2.0', $this->app->version());
$this->assertFalse($this->app->isBooted());
}

Expand Down
Loading