docs: adiciona conteúdos de polimorfismo e encapsulamento#108
docs: adiciona conteúdos de polimorfismo e encapsulamento#108Washington83 wants to merge 4 commits intodanielhe4rt:masterfrom
Conversation
📝 WalkthroughWalkthroughAdded two Portuguese OOP lesson files: Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~4 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
4-Intermediário/10-Encapsulamento.md (1)
7-7: Pequena padronização de Markdown para evitar ruído de lint.Line 7 tem indentação sobrando antes de “Ou seja:”, e as headings nas Lines 48 e 95 usam dois espaços após
##.🧹 Ajuste sugerido
- Ou seja: +Ou seja: ... -## Exemplo com encapsulamento (correto) +## Exemplo com encapsulamento (correto) ... -## Resumão +## ResumãoAlso applies to: 48-48, 95-95
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@4-Intermediário/10-Encapsulamento.md` at line 7, Remove the stray leading indentation before the "Ou seja:" line and normalize the Markdown headings that currently have two spaces after the '##' to use a single space; locate the literal "Ou seja:" string and the headings that start with "## " (two spaces) and edit them so "Ou seja:" has no extra leading spaces and each "##" heading uses exactly one space after the hashes.4-Intermediário/9-Polimorfismo.md (1)
12-12: Padronizar headings ATX com um único espaço após##.As headings nas Lines 12, 33 e 82 usam dois espaços após
##, o que tende a gerar warning de markdownlint (MD019).🧹 Ajuste sugerido
-## Por que usar? +## Por que usar? ... -## Exemplo prático +## Exemplo prático ... -## Outro exemplo (mais real) +## Outro exemplo (mais real)Also applies to: 33-33, 82-82
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@4-Intermediário/9-Polimorfismo.md` at line 12, Fix the ATX heading spacing by replacing double spaces after '##' with a single space for the affected headings (e.g., the "## Por que usar?" heading and the other headings flagged around lines 33 and 82); locate the headings in the "9-Polimorfismo.md" content (search for "## ") and ensure each ATX header uses exactly one space after the hashes (e.g., "## Por que usar?") to satisfy markdownlint MD019.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@4-Intermediário/9-Polimorfismo.md`:
- Around line 76-77: The examples currently concatenate PHP_EOL but do not
output it because the expressions are not echoed; replace the discarded
expressions with proper echo (or print) statements so the newline prints, e.g.
use echo $animal1->emitirSom() . PHP_EOL; and echo $animal2->emitirSom() .
PHP_EOL; and likewise change the expressions around the other example (the block
around lines 125-127) to echo the emitirSom() results with PHP_EOL so the
expected line breaks appear.
---
Nitpick comments:
In `@4-Intermediário/10-Encapsulamento.md`:
- Line 7: Remove the stray leading indentation before the "Ou seja:" line and
normalize the Markdown headings that currently have two spaces after the '##' to
use a single space; locate the literal "Ou seja:" string and the headings that
start with "## " (two spaces) and edit them so "Ou seja:" has no extra leading
spaces and each "##" heading uses exactly one space after the hashes.
In `@4-Intermediário/9-Polimorfismo.md`:
- Line 12: Fix the ATX heading spacing by replacing double spaces after '##'
with a single space for the affected headings (e.g., the "## Por que usar?"
heading and the other headings flagged around lines 33 and 82); locate the
headings in the "9-Polimorfismo.md" content (search for "## ") and ensure each
ATX header uses exactly one space after the hashes (e.g., "## Por que usar?") to
satisfy markdownlint MD019.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 5b39f718-ebd8-4c3d-8665-e0cb753c0fb4
📒 Files selected for processing (2)
4-Intermediário/10-Encapsulamento.md4-Intermediário/9-Polimorfismo.md
4-Intermediário/9-Polimorfismo.md
Outdated
| $animal1->emitirSom() . PHP_EOL; // Au au | ||
| $animal2->emitirSom() . PHP_EOL; // Miau |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verifica ocorrências do padrão que não imprime newline
rg -nP '\->\w+\(.*\)\s*\.\s*PHP_EOL;' --type mdRepository: danielhe4rt/php4noobs
Length of output: 580
Corrigir exemplo de saída: concatenação com PHP_EOL não imprime nada sozinha.
Nas linhas 76-77 e 126, a expressão ... . PHP_EOL; é descartada—ela não gera quebra de linha no output. Isso é confuso para quem está aprendendo.
Sugestão de ajuste (linhas 76-77)
-$animal1->emitirSom() . PHP_EOL; // Au au
-$animal2->emitirSom() . PHP_EOL; // Miau
+echo $animal1->emitirSom() . PHP_EOL; // Au au
+echo $animal2->emitirSom() . PHP_EOL; // MiauSugestão de ajuste (linhas 125-127)
foreach ($pagamentos as $pagamento) {
- $pagamento->pagar(100) . PHP_EOL;
+ echo $pagamento->pagar(100) . PHP_EOL;
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| $animal1->emitirSom() . PHP_EOL; // Au au | |
| $animal2->emitirSom() . PHP_EOL; // Miau | |
| echo $animal1->emitirSom() . PHP_EOL; // Au au | |
| echo $animal2->emitirSom() . PHP_EOL; // Miau |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@4-Intermediário/9-Polimorfismo.md` around lines 76 - 77, The examples
currently concatenate PHP_EOL but do not output it because the expressions are
not echoed; replace the discarded expressions with proper echo (or print)
statements so the newline prints, e.g. use echo $animal1->emitirSom() . PHP_EOL;
and echo $animal2->emitirSom() . PHP_EOL; and likewise change the expressions
around the other example (the block around lines 125-127) to echo the
emitirSom() results with PHP_EOL so the expected line breaks appear.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@4-Intermediário/9-Polimorfismo.md`:
- Line 12: Headings use double spaces after the ATX marker causing MD019
violations; locate the headings like "## Por que usar?" (and the other ATX
headings at the same file that have two spaces after the hashes) and remove the
extra space so they read "## Por que usar?" (and similarly for the other
headings) to conform to the no-multiple-space-atx rule.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 7195b8c5-ad04-4fbc-a875-a7f3a63bfae0
📒 Files selected for processing (1)
4-Intermediário/9-Polimorfismo.md
4-Intermediário/9-Polimorfismo.md
Outdated
|
|
||
| --- | ||
|
|
||
| ## Por que usar? |
There was a problem hiding this comment.
Padronize os headings ATX para remover espaço duplo após ##.
As linhas 12, 33 e 82 violam a regra MD019 (no-multiple-space-atx).
💡 Ajuste sugerido
-## Por que usar?
+## Por que usar?
-## Exemplo prático
+## Exemplo prático
-## Outro exemplo (mais real)
+## Outro exemplo (mais real)Also applies to: 33-33, 82-82
🧰 Tools
🪛 markdownlint-cli2 (0.21.0)
[warning] 12-12: Multiple spaces after hash on atx style heading
(MD019, no-multiple-space-atx)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@4-Intermediário/9-Polimorfismo.md` at line 12, Headings use double spaces
after the ATX marker causing MD019 violations; locate the headings like "## Por
que usar?" (and the other ATX headings at the same file that have two spaces
after the hashes) and remove the extra space so they read "## Por que usar?"
(and similarly for the other headings) to conform to the no-multiple-space-atx
rule.
There was a problem hiding this comment.
♻️ Duplicate comments (2)
4-Intermediário/9-Polimorfismo.md (2)
125-127:⚠️ Potential issue | 🟡 Minor
PHP_EOLestá sendo descartado no loop de pagamentos.Na Line 126, a expressão concatena
PHP_EOL, mas semechoo newline não é impresso.Diff sugerido
foreach ($pagamentos as $pagamento) { - $pagamento->pagar(100) . PHP_EOL; + echo $pagamento->pagar(100) . PHP_EOL; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@4-Intermediário/9-Polimorfismo.md` around lines 125 - 127, The loop is calling $pagamento->pagar(100) and concatenating PHP_EOL but never printing it; change the loop so the result is output (e.g., use echo or print) — locate the foreach over $pagamentos and update the body to output the return of pagar(100) with PHP_EOL (for example: echo $pagamento->pagar(100) . PHP_EOL) so newlines are actually printed.
33-33:⚠️ Potential issue | 🟡 MinorCorrija o espaçamento duplo nos headings ATX (MD019).
Nas Lines 33 e 82 há dois espaços após
##, o que violano-multiple-space-atx.Diff sugerido
-## Exemplo prático +## Exemplo prático ... -## Outro exemplo (mais real) +## Outro exemplo (mais real)Also applies to: 82-82
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@4-Intermediário/9-Polimorfismo.md` at line 33, O heading ATX "## Exemplo prático" (e outro similar na mesma seção) tem dois espaços após o marcador "##", violando a regra no-multiple-space-atx; corrija retirando o espaço extra para usar um único espaço após "##" (por exemplo "## Exemplo prático") em ambas ocorrências mencionadas para normalizar todos os headings ATX no arquivo 4-Intermediário/9-Polimorfismo.md.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@4-Intermediário/9-Polimorfismo.md`:
- Around line 125-127: The loop is calling $pagamento->pagar(100) and
concatenating PHP_EOL but never printing it; change the loop so the result is
output (e.g., use echo or print) — locate the foreach over $pagamentos and
update the body to output the return of pagar(100) with PHP_EOL (for example:
echo $pagamento->pagar(100) . PHP_EOL) so newlines are actually printed.
- Line 33: O heading ATX "## Exemplo prático" (e outro similar na mesma seção)
tem dois espaços após o marcador "##", violando a regra no-multiple-space-atx;
corrija retirando o espaço extra para usar um único espaço após "##" (por
exemplo "## Exemplo prático") em ambas ocorrências mencionadas para normalizar
todos os headings ATX no arquivo 4-Intermediário/9-Polimorfismo.md.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f10899de-ef7c-4797-9764-f8f82e253255
📒 Files selected for processing (1)
4-Intermediário/9-Polimorfismo.md
📚 Descrição
Adicionei conteúdos de polimorfismo e encapsulamento em PHP para melhorar a documentação do projeto.
🧠 Conteúdos adicionados
🎯 Objetivo
Facilitar o entendimento de POO para iniciantes.
Summary by CodeRabbit