Skip to content

PHPAY-124: verificador de links no gate e a quebra da documentação no changelog - #125

Merged
mariolucasdev merged 3 commits into
developfrom
chore/phpay-124
Oct 22, 2026
Merged

mariolucasdev merged 3 commits into
developfrom
chore/phpay-124

Conversation

@mariolucasdev

Copy link
Copy Markdown
Collaborator

Closes #124.

1. Verificador de links no gate

composer test:links, em .github/scripts/check-links.php, ao lado do smoke.php. Entra no composer test e num passo do job de qualidade do CI.

Para cada link que não é http(s)/mailto/tel: o arquivo (ou pasta) apontado tem que existir, e se o link traz #âncora, algum título daquele arquivo tem que gerar essa âncora pela regra do GitHub.

Título dentro de bloco de código não conta como título. Não é detalhe de implementação: foi exatamente assim que a cerca não fechada no exemplo da Cielo passou meses escondida — o ### Rede virou código e levou dez links do sumário com ele. Um verificador que ignorasse as cercas teria dito que estava tudo bem.

Provei que ele reprova, porque verificador que nunca falha não serve de nada. Com um arquivo temporário contendo um link para arquivo inexistente e outro para âncora inexistente:

30 arquivos, 71 links relativos conferidos

2 quebrado(s):
  docs/__teste-do-verificador.md:3  nao-existe.md  — não existe
  docs/__teste-do-verificador.md:5  capacidades.md#secao-inventada  — nenhum título gera essa âncora em docs/capacidades.md
exit=1

No estado atual do repositório:

29 arquivos, 68 links relativos conferidos
nenhum link quebrado

2. A quebra da documentação no changelog

A seção [Não lançado] tinha o trabalho de CI do #112 mas não o #114, e o #114 é o que quem usa sente: link externo para âncora do README antigo deixou de funcionar. Entrou em Alterado, junto com a coluna de assinatura de webhook que faltava na matriz, e em Corrigido o fence quebrado e o link morto do SUPPORT.md. Mais as definições de link [#113], [#114] e [#124].

Como testar

composer test — agora com quatro etapas:

Tests:    483 passed (1190 assertions)
[OK] No errors
29 arquivos, 68 links relativos conferidos
nenhum link quebrado

composer validate segue dizendo que o composer.json é válido, e o composer.lock não precisou ser tocado: scripts não entra no content-hash.

Os dois commits foram verificados um por um com o gate completo.

Checklist

  • composer test passa (Pint, Pest e PHPStan nível 9)
  • Cobri a mudança com testes, usando HTTP mockado (nenhum teste acessa a rede) — não se aplica: o verificador não faz rede, e a prova de que ele reprova está acima
  • Atualizei README, CLAUDE.md ou UPGRADE.md, se a mudança afeta quem usa a biblioteca
  • Nenhuma credencial, token ou dado pessoal real foi commitado
  • Li e aceito o Contributor License Agreement

Nada em src/. O gate ficou um passo mais longo — o verificador roda em menos de um segundo.

The documentation is 17 files since the README was split, and the links between them are relative. A relative link breaks in silence: markdown does not complain, PHPStan does not look at it, and GitHub only shows the 404 to whoever clicks.

The script checks that every relative link points at something that exists, and that every #anchor matches a heading that really produces it. A heading inside a code block does not count — that is exactly how the unclosed fence in the Cielo example stayed hidden for months, taking ten links of the table of contents with it, and a checker that ignored fences would have said everything was fine.

It runs as composer test:links, inside composer test, and as a step of the quality job. Verified to fail: a file that does not exist and an anchor that does not exist both come back with the file and line, and the exit code is 1.
The Não lançado section had the CI work from PHPAY-111 but not the README split, which is the change a user can feel: an external link to an anchor of the old README stopped working.

Also recorded from the same PR: the capability matrix gaining the webhook signature column it had been missing since v2.3.0, the code fence that made the README render inverted from Rede down to Efí, and the dead link in SUPPORT.md.
CLAUDE.md described composer test as lint + unit + types and did not mention the new script. It is the file an agent reads before touching this repository, so a stale command list there is worse than in the README.
@mariolucasdev

Copy link
Copy Markdown
Collaborator Author

Acrescentei um terceiro commit: o CLAUDE.md descrevia o composer test como "lint + unit + types" e não listava o test:links. É o arquivo que um agente lê antes de mexer no repositório, então lista de comandos desatualizada ali é pior que no README.

@mariolucasdev
mariolucasdev merged commit df05757 into develop Oct 22, 2026
7 checks passed
@mariolucasdev
mariolucasdev deleted the chore/phpay-124 branch October 22, 2026 17:02
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.

Fechar as pendências da documentação: changelog da quebra e verificador de links no gate

1 participant