Skip to content

Commit 62c1647

Browse files
committed
refactor(!): remove 'package' annotation from DocBlock examples and update package description in composer.json
1 parent ba41a5a commit 62c1647

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/.php-cs-fixer.cache
44
/.phpunit.result.cache
55
/.build
6+
/coverage-report
67
/php-cs-fixer.xml
78
/phpstan.xml
89
/site

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ class MyClass
3636
* MyClass.
3737
*
3838
* @author Your Name <your@email.org>
39-
* @package MyPackage
4039
*/
4140
class MyClass
4241
{
@@ -58,6 +57,9 @@ composer require --dev konradmichalik/php-doc-block-header-fixer
5857

5958
Add the PHP-CS-Fixer rule in your `.php-cs-fixer.php` file:
6059

60+
> [!NOTE]
61+
> This fixer is compatible with standard PHP-CS-Fixer rules. It avoids adding annotations that conflict with rules like `phpdoc_no_package` and follows spacing conventions compatible with `phpdoc_separation`.
62+
6163
```php
6264
<?php
6365
// ...
@@ -71,7 +73,6 @@ return (new PhpCsFixer\Config())
7173
'annotations' => [
7274
'author' => 'Konrad Michalik <hej@konradmichalik.dev>',
7375
'license' => 'GPL-3.0-or-later',
74-
'package' => 'PhpDocBlockHeaderFixer',
7576
],
7677
'preserve_existing' => true,
7778
'separate' => 'none',
@@ -96,7 +97,6 @@ return (new PhpCsFixer\Config())
9697
[
9798
'author' => 'Konrad Michalik <hej@konradmichalik.dev>',
9899
'license' => 'GPL-3.0-or-later',
99-
'package' => 'PhpDocBlockHeaderFixer',
100100
],
101101
preserveExisting: true,
102102
separate: \KonradMichalik\PhpDocBlockHeaderFixer\Enum\Separate::None,

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "konradmichalik/php-doc-block-header-fixer",
3-
"description": "",
3+
"description": "This packages contains a PHP-CS-Fixer rule to automatically fix the class header regarding PHP DocBlocks.",
44
"license": "GPL-3.0-or-later",
55
"type": "library",
66
"authors": [

tests/src/Generators/DocBlockHeaderTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ public function testValidateAnnotationsWithValidKeys(): void
125125
'license' => 'MIT',
126126
'version' => '1.0.0',
127127
'since' => '1.0.0',
128-
'package' => 'MyPackage',
129128
'subpackage' => 'SubPackage',
130129
'see' => 'https://example.com',
131130
'link' => 'https://example.com',

tests/src/Rules/DocBlockHeaderFixerTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,9 @@ public function testBuildDocBlockWithMultipleAnnotations(): void
9797
$result = $method->invoke($this->fixer, [
9898
'author' => 'John Doe <john@example.com>',
9999
'license' => 'MIT',
100-
'package' => 'MyPackage',
101100
], '');
102101

103-
$expected = "/**\n * @author John Doe <john@example.com>\n * @license MIT\n * @package MyPackage\n */";
102+
$expected = "/**\n * @author John Doe <john@example.com>\n * @license MIT\n */";
104103
self::assertSame($expected, $result);
105104
}
106105

0 commit comments

Comments
 (0)