Skip to content

[SPEC-002] Suporte à sintaxe de parâmetro {id} (feat) - #23

Merged
code-cfernandes merged 2 commits into
mainfrom
feat/SPEC-002-brace-params
Oct 9, 2026
Merged

code-cfernandes merged 2 commits into
mainfrom
feat/SPEC-002-brace-params

Conversation

@code-cfernandes

Copy link
Copy Markdown
Member

Resumo

Request::parsePath() passa a extrair parâmetros na sintaxe {id} (e
{id<constraint>}), além da já suportada :id. Junto com o core-routing 1.2.0
(já publicado na SPEC-002), rotas /users/{id} funcionam de ponta a ponta.

Mudanças

  • src/Http/Request.php: parsePath() usa regex unificada [{:](nome)(<constraint>)?}.
  • tests/Http/RequestTest.php: 4 testes novos (brace, brace+constraint, mixed, colon).
  • tests/Integration/Routing/BraceParameterIntegrationTest.php: fluxo end-to-end {id}.
  • docs/technical/routing/SYNTAX_GUIDE.md: documenta as duas sintaxes.
  • docs/releases/FRAMEWORK_OVERVIEW_v2.1.1.md: overview do release (corrige a validação de documentação — commit separado).

Como testar

composer update pivotphp/core-routing
vendor/bin/phpunit --testsuite=CI
vendor/bin/phpunit --testsuite=Integration
composer cs:check
vendor/bin/phpstan analyse src/Http/Request.php --level=9
php scripts/validation/validate_project.php

Versionamento (SemVer)

MINOR → 2.2.0 (agrupado com as demais SPECs do core; CHANGELOG no release).

Documentação

SYNTAX_GUIDE.md + FRAMEWORK_OVERVIEW_v2.1.1.md (gate doc-review aprovado; validação validate_project.php passa).

Instruções de merge

  • Squash and merge para main.
  • A issue pivotphp-core-routing#2 permanece aberta até a fase skeleton (docs) concluída.

- Request::parsePath() now extracts :id and {id} (and {id<constraint>})
  named parameters, using the constraint for the match pattern.
- Update routing syntax docs.

Refs: SPEC-002 (PivotPHP/pivotphp-core-routing#2)
Fixes documentation validation that requires a framework overview for the
current version (2.1.1).
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

🚀 Release Readiness Report - PivotPHP Core v2.1.1

✅ All Checks Passed!

  • Version: 2.1.1
  • PHPStan: Level 9, 0 errors
  • Tests: All tests passing
  • Code Style: PSR-12 compliant
  • PHP Compatibility: 8.1 - 8.4
  • Dependencies: All valid
  • Scripts: Consolidated and optimized

📦 Ready for Publication

The project is ready to be tagged and released!

Next Steps:

  1. Create a new tag: git tag -a v2.1.1 -m 'Release v2.1.1'
  2. Push the tag: git push origin v2.1.1
  3. The release workflow will automatically create a GitHub release
  4. Packagist will be automatically updated

@code-cfernandes
code-cfernandes merged commit 858760a into main Oct 9, 2026
6 checks passed
@code-cfernandes
code-cfernandes deleted the feat/SPEC-002-brace-params branch October 9, 2026 02:05
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.

1 participant