Skip to content

6 diferenças de tipos request response#9

Merged
CAFernandes merged 9 commits into
mainfrom
6-diferenças-de-tipos-requestresponse
Jul 9, 2025

Hidden character warning

The head ref may contain hidden characters: "6-diferen\u00e7as-de-tipos-requestresponse"
Merged

6 diferenças de tipos request response#9
CAFernandes merged 9 commits into
mainfrom
6-diferenças-de-tipos-requestresponse

Conversation

@CAFernandes
Copy link
Copy Markdown
Member

Pull Request Template

📋 Descrição

Descreva resumidamente as mudanças feitas neste PR.

🎯 Tipo de Mudança

  • 🐛 Bug fix (mudança que corrige um bug)
  • ✨ Nova feature (mudança que adiciona funcionalidade)
  • 💥 Breaking change (mudança que causa incompatibilidade)
  • 📚 Documentação (mudanças apenas na documentação)
  • 🧹 Refactoring (mudanças que não corrigem bug nem adicionam feature)
  • ⚡ Performance (mudanças que melhoram a performance)
  • 🧪 Testes (adição ou correção de testes)

🧪 Como foi testado?

Descreva os testes que você executou para verificar suas mudanças.

  • Testes unitários passando
  • Testes funcionais passando
  • Testado manualmente
  • Exemplos funcionando

📝 Checklist

  • Meu código segue as diretrizes de estilo do projeto
  • Eu fiz uma auto-revisão do meu código
  • Comentei meu código, especialmente em partes difíceis de entender
  • Fiz mudanças correspondentes na documentação
  • Minhas mudanças não geram novos warnings
  • Adicionei testes que provam que minha correção é eficaz ou que minha feature funciona
  • Testes unitários novos e existentes passam localmente com minhas mudanças

🔗 Issues Relacionadas

Fixes #6

…style methods

- Added PSR-7 ResponseInterface implementation for better HTTP response handling.
- Introduced methods for redirecting, setting cookies, and sending error/success responses.
- Enhanced existing methods to maintain compatibility with Express.js style.
- Improved body handling with PSR-7 StreamInterface.
- Added utility methods for streaming and sending various data types.
- Refactored existing methods to utilize the new PSR-7 response structure.
…andling

- Added Psr7Pool class for managing pools of PSR-7 objects (ServerRequest, Response, Uri, Stream).
- Integrated Psr7Pool into Request and Response classes for lazy loading and object reuse.
- Enhanced Request class to cache php://input and manage PSR-7 attributes more efficiently.
- Created basic authentication tests for JWT generation, validation, and middleware functionality.
- Implement V11ComponentsTest for testing high-performance mode, dynamic pool, middleware integration, performance monitoring, memory management, and factory pooling.
- Create HighPerformanceStressTest to evaluate concurrent request handling, pool overflow behavior, circuit breaker functionality, load shedding effectiveness, memory management under pressure, and graceful degradation under resource exhaustion.
- Ensure tests cover various scenarios and edge cases to validate system performance and reliability under stress.
  - Remover adição automática de trailing slash em Request::pathCallable
  - Adicionar método Request::getIp() para suporte ao RateLimiter
  - Corrigir Router::clear() para limpar todos os caches
  - Atualizar testes para refletir novos comportamentos
  - Marcar testes de stress como skipped (dependentes do ambiente)
@CAFernandes CAFernandes self-assigned this Jul 9, 2025
Copilot AI review requested due to automatic review settings July 9, 2025 12:22
@CAFernandes CAFernandes linked an issue Jul 9, 2025 that may be closed by this pull request

This comment was marked as outdated.

…Redis integration

- Added support for distributed object pooling in PivotPHP v1.1.0.
- Implemented NoOpCoordinator for single-instance operation when no external coordination is available.
- Redis coordination moved to an optional extension, with a fallback to NoOpCoordinator if Redis is not available.
- Updated DistributedPoolManager to create coordinators based on configuration.
- Added documentation for distributed pooling extensions and usage examples.
- Enhanced error handling and logging for coordinator initialization failures.
- Updated various classes to ensure compatibility with new pooling strategies and methods.
…no CircuitBreaker e LoadShedder

refactor: Ajustar inicialização de localPool e simplificar acesso a estatísticas no DistributedPoolManager
@CAFernandes CAFernandes requested a review from Copilot July 9, 2025 13:30

This comment was marked as outdated.

@CAFernandes CAFernandes requested a review from Copilot July 9, 2025 13:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates existing route constraint tests, adjusts request pathCallable normalization tests, adds a standalone authentication test script, and introduces a comprehensive suite of stress and integration tests for v1.1.0 performance features.

  • Clarified comments and assertions in RouterGroupConstraintTest.php to emphasize constraint application
  • Standardized pathCallable behavior in RequestTest.php by removing trailing slashes
  • Introduced test/auth_test.php as a manual authentication smoke test (echo-based)
  • Added a new HighPerformanceStressTest.php performance stress suite and V11ComponentsTest.php integration tests
  • Ensured Router::clear() also resets preCompiledRoutes

Reviewed Changes

Copilot reviewed 53 out of 54 changed files in this pull request and generated no comments.

File Description
tests/Unit/Routing/RouterGroupConstraintTest.php Enhanced test comments to explicitly note applied constraints
tests/Services/RequestTest.php Updated expected pathCallable values to drop trailing slash
test/auth_test.php Added manual authentication tests (non-PHPUnit)
src/Routing/Router.php Reset preCompiledRoutes in clear() for consistency
Comments suppressed due to low confidence (1)

test/auth_test.php:1

  • This script uses manual echo-based assertions instead of PHPUnit and won’t be picked up by the automated test suite. Consider converting it into a PHPUnit test case for consistent execution and reporting.
<?php

@CAFernandes CAFernandes merged commit c84c6b5 into main Jul 9, 2025
5 checks passed
@CAFernandes CAFernandes deleted the 6-diferenças-de-tipos-requestresponse branch July 9, 2025 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Diferenças de Tipos Request/Response

2 participants