-
Notifications
You must be signed in to change notification settings - Fork 0
refactor(!): remove 'package' annotation from DocBlock examples #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…pdate package description in composer.json
|
Caution Review failedThe pull request is closed. WalkthroughAdded Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Test as Tests / Caller
participant Fixer as DocBlockHeaderFixer
participant Config as Configuration
participant Tokens as TokenStream
Note over Test,Fixer: Request to build/insert docblock
Test->>Fixer: buildDocBlock()/insertNewDocBlock()
Fixer->>Config: read `separate` option (default: none)
alt separate == none
Fixer->>Tokens: build docblock without extra bottom separation
else separate == bottom or both
Fixer->>Tokens: check for existing trailing whitespace after class declaration
alt trailing whitespace exists
Fixer->>Tokens: do not insert extra newline (avoid conflict)
else trailing whitespace absent
Fixer->>Tokens: insert bottom separation newline
end
end
Fixer-->>Test: return updated tokens/docblock
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (2)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
… DocBlock spacing compatibility
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
README.md (1)
12-12: Fix grammar in intro sentenceSingular “package”.
-This packages contains a [PHP-CS-Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) rule to automatically fix the class header regarding PHP DocBlocks. +This package contains a [PHP-CS-Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) rule to automatically fix the class header regarding PHP DocBlocks.
🧹 Nitpick comments (2)
.gitignore (1)
6-6: Optionally ignore other common coverage outputsIf you generate Clover/XML or default HTML outputs, consider ignoring these too.
/.build +/coverage /coverage-report +clover.xml /php-cs-fixer.xmltests/src/Rules/DocBlockHeaderFixerTest.php (1)
92-104: Add a negative test to ensure@packageis not emittedTo lock behavior, add a test that passes a
packagekey and asserts it’s omitted from the output (or rejected, depending on intended validation).public function testBuildDocBlockDoesNotIncludePackage(): void { $method = new ReflectionMethod($this->fixer, 'buildDocBlock'); $method->setAccessible(true); $result = $method->invoke( $this->fixer, ['author' => 'John', 'package' => 'Foo'], // should be ignored or invalid '' ); // If ignored: $this->assertSame("/**\n * @author John\n */", $result); // If invalid, assert exception instead: // $this->expectException(\InvalidArgumentException::class); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (5)
.gitignore(1 hunks)README.md(1 hunks)composer.json(1 hunks)tests/src/Generators/DocBlockHeaderTest.php(0 hunks)tests/src/Rules/DocBlockHeaderFixerTest.php(1 hunks)
💤 Files with no reviewable changes (1)
- tests/src/Generators/DocBlockHeaderTest.php
🧰 Additional context used
🪛 LanguageTool
README.md
[style] ~60-~60: Using many exclamation marks might seem excessive (in this case: 4 exclamation marks for a text that’s 1384 characters long)
Context: ...e in your .php-cs-fixer.php file: > [!NOTE] > This fixer is compatible with st...
(EN_EXCESSIVE_EXCLAMATION)
🔇 Additional comments (3)
.gitignore (1)
6-6: LGTM: ignore coverage artifactsAdding
/coverage-reportat repo root is fine.tests/src/Rules/DocBlockHeaderFixerTest.php (1)
92-104: Updated expectation without @Package looks correctThe multiple-annotations case now aligns with the decision to drop
@packagefrom examples.README.md (1)
60-62: Good note about compatibility with phpdoc_no_packageNice clarification on rule compatibility and spacing conventions.
Pull Request Test Coverage Report for Build 17473287021Details
💛 - Coveralls |
Summary by CodeRabbit
Documentation
Tests
Bug Fixes
Chores