Skip to content

Commit 14dcade

Browse files
committed
Remove obsolete test files for AuthMiddleware, CsrfMiddleware, XssMiddleware, OpenApiExporter, HighPerformanceStressTest, and Arr utility functions to streamline the test suite and improve maintainability.
1 parent 6d54486 commit 14dcade

File tree

52 files changed

+2485
-12030
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+2485
-12030
lines changed

CHANGELOG.md

Lines changed: 149 additions & 23 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
- **🛡️ Segurança Integrada**: Middlewares prontos para CSRF, XSS, JWT - protótipos seguros desde o início.
2222
- **🔧 Extensibilidade Simples**: Sistema de plugins e providers para expandir funcionalidades conforme necessário.
2323
- **📊 Performance Adequada**: Throughput de 44,092 ops/sec, footprint de 1.61MB - suficiente para demonstrações.
24-
- **🎨 v1.2.0**: Simplicity Edition - Arquitetura limpa, zero complexidade desnecessária, foco em simplicidade.
24+
- **🎨 v2.0.0**: Legacy Cleanup Edition - 18% code reduction, modern namespaces, routing externalized, zero deprecated code.
2525

2626
---
2727

@@ -34,15 +34,17 @@
3434
- 🔐 **Autenticação Multi-método**
3535
- 🛡️ **Segurança Avançada**
3636
- 📡 **Streaming & SSE**
37-
- 📚 **OpenAPI/Swagger Automático** (v1.2.0+ Middleware)
37+
- 📚 **OpenAPI/Swagger Automático** (v2.0.0 Middleware)
3838
- 🔄 **PSR-7 Híbrido**
3939
- ♻️ **Object Pooling**
40-
- 🚀 **JSON Optimization** (v1.2.0 Intelligent)
41-
- 🎯 **Array Callables** (v1.2.0 Native)
42-
- 🔍 **Enhanced Error Diagnostics** (v1.2.0)
40+
- 🚀 **JSON Optimization** (Intelligent Caching)
41+
- 🎯 **Array Callables** (Native Support)
42+
- 🔍 **Enhanced Error Diagnostics**
4343
-**Performance Extrema**
4444
- 🧪 **Qualidade e Testes**
45-
- 🎯 **Simplicidade sobre Otimização** (v1.2.0)
45+
- 🎯 **Simplicidade sobre Otimização**
46+
- 🧹 **v2.0.0 Legacy Cleanup** (18% code reduction)
47+
- 🔌 **Modular Routing** (External package, pluggable in v2.1.0)
4648

4749
---
4850

@@ -116,7 +118,7 @@ $app->get('/posts/:year<\d{4}>/:month<\d{2}>/:slug<slug>', function($req, $res)
116118
$app->run();
117119
```
118120

119-
### 🛣️ Sintaxes de Roteamento Suportadas (v1.2.0)
121+
### 🛣️ Sintaxes de Roteamento Suportadas
120122

121123
O PivotPHP oferece suporte robusto para múltiplas sintaxes de roteamento:
122124

@@ -160,37 +162,37 @@ $app->get('/users/:id', [Controller::class, 'show']);
160162

161163
namespace App\Controllers;
162164

163-
class UserController
165+
class UserController
164166
{
165167
// ✅ Métodos devem ser PÚBLICOS
166-
public function index($req, $res)
168+
public function index($req, $res)
167169
{
168170
$users = User::paginate($req->query('limit', 10));
169171
return $res->json(['users' => $users]);
170172
}
171-
172-
public function show($req, $res)
173+
174+
public function show($req, $res)
173175
{
174176
$id = $req->param('id');
175177
$user = User::find($id);
176-
178+
177179
if (!$user) {
178180
return $res->status(404)->json(['error' => 'User not found']);
179181
}
180-
182+
181183
return $res->json(['user' => $user]);
182184
}
183-
184-
public function store($req, $res)
185+
186+
public function store($req, $res)
185187
{
186188
$data = $req->body();
187189
$user = User::create($data);
188-
190+
189191
return $res->status(201)->json(['user' => $user]);
190192
}
191193
}
192194

193-
// ✅ Registrar rotas com array callable v1.2.0
195+
// ✅ Registrar rotas com array callable
194196
$app->get('/users', [UserController::class, 'index']);
195197
$app->get('/users/:id<\d+>', [UserController::class, 'show']); // Apenas números
196198
$app->post('/users', [UserController::class, 'store']);
@@ -200,10 +202,10 @@ $app->put('/users/:id', [UserController::class, 'update'])
200202
->middleware($authMiddleware);
201203
```
202204

203-
#### ⚡ Validação Automática (v1.2.0)
205+
#### ⚡ Validação Automática
204206

205207
```php
206-
// O PivotPHP v1.2.0 valida automaticamente array callables:
208+
// O PivotPHP valida automaticamente array callables:
207209

208210
// ✅ Método público - ACEITO
209211
class PublicController {
@@ -265,17 +267,17 @@ $response = OptimizedHttpFactory::createResponse();
265267
-**API Express.js** mantida para produtividade
266268
-**Zero breaking changes** - código existente funciona sem alterações
267269

268-
### 🚀 JSON Optimization (v1.2.0 Intelligent System)
270+
### 🚀 JSON Optimization (Intelligent System)
269271

270-
O PivotPHP v1.2.0 mantém o **threshold inteligente de 256 bytes** no sistema de otimização JSON, eliminando overhead para dados pequenos:
272+
O PivotPHP mantém o **threshold inteligente de 256 bytes** no sistema de otimização JSON, eliminando overhead para dados pequenos:
271273

272274
#### ⚡ Sistema Inteligente Automático
273275

274276
```php
275277
// ✅ OTIMIZAÇÃO AUTOMÁTICA - Zero configuração necessária
276278
$app->get('/api/users', function($req, $res) {
277279
$users = User::all();
278-
280+
279281
// Sistema decide automaticamente:
280282
// • Poucos usuários (<256 bytes): json_encode() direto
281283
// Muitos usuários (≥256 bytes): pooling automático
@@ -288,10 +290,10 @@ $app->get('/api/users', function($req, $res) {
288290
```php
289291
// Dados pequenos (<256 bytes) - json_encode() direto
290292
$smallData = ['status' => 'ok', 'count' => 42];
291-
$json = JsonBufferPool::encodeWithPool($smallData);
293+
$json = JsonBufferPool::encodeWithPool($smallData);
292294
// Performance: 500K+ ops/sec (sem overhead)
293295

294-
// Dados médios (256 bytes - 10KB) - pooling automático
296+
// Dados médios (256 bytes - 10KB) - pooling automático
295297
$mediumData = User::paginate(20);
296298
$json = JsonBufferPool::encodeWithPool($mediumData);
297299
// Performance: 119K+ ops/sec (15-30% ganho)
@@ -327,7 +329,7 @@ echo "Eficiência: {$stats['efficiency']}%\n";
327329
echo "Operações: {$stats['total_operations']}\n";
328330
```
329331

330-
#### ✨ Mantido v1.2.0
332+
#### ✨ Mantido v2.0.0
331333

332334
-**Threshold Inteligente** - Elimina overhead para dados <256 bytes
333335
-**Detecção Automática** - Sistema decide quando usar pooling
@@ -336,7 +338,7 @@ echo "Operações: {$stats['total_operations']}\n";
336338
-**Monitoramento Integrado** - Estatísticas em tempo real
337339
-**Compatibilidade Total** - Drop-in replacement transparente
338340

339-
### 🔍 Enhanced Error Diagnostics (v1.2.0)
341+
### 🔍 Enhanced Error Diagnostics
340342

341343
PivotPHP v1.2.0 mantém **ContextualException** para diagnósticos avançados de erros:
342344

@@ -367,7 +369,7 @@ try {
367369
```php
368370
// Automaticamente detectadas pelo sistema
369371
ContextualException::CATEGORY_ROUTING // Problemas de roteamento
370-
ContextualException::CATEGORY_PARAMETER // Validação de parâmetros
372+
ContextualException::CATEGORY_PARAMETER // Validação de parâmetros
371373
ContextualException::CATEGORY_VALIDATION // Validação de dados
372374
ContextualException::CATEGORY_MIDDLEWARE // Problemas de middleware
373375
ContextualException::CATEGORY_HTTP // Erros HTTP
@@ -402,9 +404,9 @@ ContextualException::configure([
402404
-**Segurança por Ambiente** - Detalhes reduzidos em produção
403405
-**Logging Integrado** - Registro automático para análise posterior
404406

405-
📖 **Documentação completa:**
407+
📖 **Documentação completa:**
406408
- [Array Callable Guide](docs/technical/routing/ARRAY_CALLABLE_GUIDE.md)
407-
- [JsonBufferPool Optimization Guide](docs/technical/json/BUFFER_POOL_OPTIMIZATION.md)
409+
- [JsonBufferPool Optimization Guide](docs/technical/json/BUFFER_POOL_OPTIMIZATION.md)
408410
- [Enhanced Error Diagnostics](docs/technical/error-handling/CONTEXTUAL_EXCEPTION_GUIDE.md)
409411

410412
### 📖 Documentação OpenAPI/Swagger Automática (v1.2.0+)

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.0
1+
2.0.0

docs/MIGRATION_GUIDE.md

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,21 @@
44

55
**For detailed migration instructions, please refer to the official release documentation:**
66

7-
### 🔄 Latest Version: v1.1.4
8-
**[Complete Migration Guide →](releases/v1.1.4/MIGRATION_GUIDE.md)**
7+
### 🔄 Latest Version: v2.0.0 ⚠️ BREAKING RELEASE
8+
**[Complete Migration Guide →](releases/v2.0.0/MIGRATION_GUIDE_v2.0.0.md)**
99

1010
**Migration highlights:**
11-
- **🔧 Infrastructure Consolidation**: 40% script reduction (25 → 15)
12-
- **📦 Automatic Version Management**: VERSION file requirement with strict validation
13-
- **🚀 GitHub Actions Optimization**: 25% workflow reduction (4 → 3)
14-
- **✅ Zero Breaking Changes**: 100% backward compatibility maintained
11+
- **🗑️ Legacy Cleanup**: 18% code reduction (11,871 lines removed)
12+
- **📦 Namespace Modernization**: 110 legacy aliases removed
13+
- **🚀 Performance**: 59% fewer aliases to autoload
14+
- **⚠️ Breaking Changes**: Required namespace updates for middleware
15+
- **✅ Zero Regressions**: All 5,548 tests passing (100%)
1516

1617
### 📚 Version-Specific Migration Guides
1718

1819
| From Version | Migration Guide | Effort Level |
1920
|--------------|----------------|--------------|
21+
| **v1.x → v2.0.0** | [v2.0.0 Migration Guide](releases/v2.0.0/MIGRATION_GUIDE_v2.0.0.md) | **Medium** ⚠️ BREAKING |
2022
| **v1.1.3** | [v1.1.4 Migration Guide](releases/v1.1.4/MIGRATION_GUIDE.md) | **Low** (mostly optional) |
2123
| **v1.1.2** | [v1.1.4 Migration Guide](releases/v1.1.4/MIGRATION_GUIDE.md) | **Low** (infrastructure only) |
2224
| **v1.1.1** | [v1.1.4 Migration Guide](releases/v1.1.4/MIGRATION_GUIDE.md) | **Low** (backward compatible) |
@@ -25,15 +27,19 @@
2527

2628
### 🎯 Quick Migration Checklist
2729

28-
#### ⚠️ Required Actions (v1.1.4):
29-
- [ ] **Create VERSION file** in project root: `echo "1.1.4" > VERSION`
30-
- [ ] **Update script references** in custom CI/CD (if any)
31-
- [ ] **Test consolidated scripts** work correctly
30+
#### ⚠️ Required Actions (v2.0.0) - BREAKING CHANGES:
31+
- [ ] **Update PSR-15 middleware imports** (8 classes - see migration guide)
32+
- [ ] **Remove "Simple*" prefixes** (7 classes - PerformanceMode, LoadShedder, etc.)
33+
- [ ] **Replace OpenApiExporter** with ApiDocumentationMiddleware
34+
- [ ] **Update DynamicPoolManager** → PoolManager
35+
- [ ] **Run tests**: `composer test`
36+
- [ ] **Regenerate autoloader**: `composer dump-autoload`
3237

33-
#### ✅ Recommended Actions:
34-
- [ ] **Use consolidated scripts** (`scripts/quality/quality-check.sh`)
35-
- [ ] **Adopt automatic versioning** (`scripts/release/version-bump.sh`)
36-
- [ ] **Read versioning guide** ([docs/VERSIONING_GUIDE.md](VERSIONING_GUIDE.md))
38+
#### ✅ Recommended Actions (v2.0.0):
39+
- [ ] **Use migration script** (provided in v2.0.0 migration guide)
40+
- [ ] **Review cleanup analysis** ([docs/v2.0.0-cleanup-analysis.md](v2.0.0-cleanup-analysis.md))
41+
- [ ] **Update IDE configuration** for new namespaces
42+
- [ ] **Review updated examples** in `examples/` directory
3743

3844
### 📖 Additional Resources
3945

@@ -54,4 +60,4 @@ If you encounter migration issues:
5460

5561
---
5662

57-
**Note**: This general migration guide has been replaced by version-specific documentation for better accuracy and detail. Please use the appropriate version-specific guide above.
63+
**Note**: This general migration guide has been replaced by version-specific documentation for better accuracy and detail. Please use the appropriate version-specific guide above.

docs/releases/FRAMEWORK_OVERVIEW_v1.2.0.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,7 @@ src/
5151
└── Utils/ # Helper utilities
5252
```
5353

54-
### **Deprecated/Legacy**
55-
```
56-
src/Legacy/
57-
├── Performance/ # HighPerformanceMode (deprecated)
58-
├── Middleware/ # Complex middleware (deprecated)
59-
└── Utils/ # Legacy utilities
60-
```
54+
**Nota**: O diretório `src/Legacy/` foi removido na v2.0.0. Classes legacy foram completamente eliminadas em favor de implementações simplificadas.
6155

6256
## 🔧 Performance Mode (Simplified)
6357

@@ -184,4 +178,4 @@ Se você precisa de um framework com equipe dedicada e suporte empresarial, cons
184178

185179
---
186180

187-
**PivotPHP Core v1.2.0** - Simplicity in Action 🚀
181+
**PivotPHP Core v1.2.0** - Simplicity in Action 🚀

0 commit comments

Comments
 (0)