|
3 | 3 | declare(strict_types=1); |
4 | 4 |
|
5 | 5 | /* |
6 | | - * This file is part of the Composer package "php-doc-block-header-fixer". |
| 6 | + * This file is part of the "php-doc-block-header-fixer" Composer package. |
7 | 7 | * |
8 | | - * Copyright (C) 2025 Konrad Michalik <hej@konradmichalik.dev> |
| 8 | + * (c) Konrad Michalik <hej@konradmichalik.dev> |
9 | 9 | * |
10 | | - * This program is free software: you can redistribute it and/or modify |
11 | | - * it under the terms of the GNU General Public License as published by |
12 | | - * the Free Software Foundation, either version 3 of the License, or |
13 | | - * (at your option) any later version. |
14 | | - * |
15 | | - * This program is distributed in the hope that it will be useful, |
16 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
18 | | - * GNU General Public License for more details. |
19 | | - * |
20 | | - * You should have received a copy of the GNU General Public License |
21 | | - * along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 10 | + * For the full copyright and license information, please view the LICENSE |
| 11 | + * file that was distributed with this source code. |
22 | 12 | */ |
23 | 13 |
|
24 | | -use EliasHaeussler\PhpCsFixerConfig\Config; |
25 | | -use EliasHaeussler\PhpCsFixerConfig\Package; |
26 | | -use EliasHaeussler\PhpCsFixerConfig\Rules; |
27 | | -use Symfony\Component\Finder; |
28 | | - |
29 | | -$header = Rules\Header::create( |
30 | | - 'php-doc-block-header-fixer', |
31 | | - Package\Type::ComposerPackage, |
32 | | - Package\Author::create('Konrad Michalik', 'hej@konradmichalik.dev'), |
33 | | - Package\CopyrightRange::from(2025), |
34 | | - Package\License::GPL3OrLater, |
35 | | -); |
| 14 | +use KonradMichalik\PhpCsFixerPreset\Config; |
| 15 | +use KonradMichalik\PhpCsFixerPreset\Rules\Header; |
| 16 | +use KonradMichalik\PhpCsFixerPreset\Rules\Set\Set; |
| 17 | +use KonradMichalik\PhpDocBlockHeaderFixer\Generators\DocBlockHeader; |
| 18 | +use KonradMichalik\PhpDocBlockHeaderFixer\Rules\DocBlockHeaderFixer; |
| 19 | +use Symfony\Component\Finder\Finder; |
36 | 20 |
|
37 | 21 | return Config::create() |
38 | | - ->withRule($header) |
39 | | -// ->withRule( |
40 | | -// RuleSet::fromArray( |
41 | | -// DocBlockHeader::create( |
42 | | -// [ |
43 | | -// 'author' => 'Konrad Michalik <hej@konradmichalik.dev>', |
44 | | -// 'license' => 'GPL-3.0-or-later', |
45 | | -// 'package' => 'PhpDocBlockHeaderFixer', |
46 | | -// ] |
47 | | -// )->__toArray() |
48 | | -// ) |
49 | | -// ) |
50 | | -// ->registerCustomFixers([new KonradMichalik\PhpDocBlockHeaderFixer\Rules\DocBlockHeaderFixer()]) // Temporarily disabled |
51 | | - ->withFinder(static fn (Finder\Finder $finder) => $finder |
52 | | - ->in(__DIR__) |
53 | | - ->exclude('vendor'), |
| 22 | + ->registerCustomFixers([ |
| 23 | + new DocBlockHeaderFixer(), |
| 24 | + ]) |
| 25 | + ->withRule( |
| 26 | + Header::fromComposer(), |
| 27 | + ) |
| 28 | + ->withRule( |
| 29 | + Set::fromArray( |
| 30 | + DocBlockHeader::fromComposer()->__toArray(), |
| 31 | + ), |
54 | 32 | ) |
| 33 | + ->withFinder(static fn (Finder $finder) => $finder->in(__DIR__)) |
55 | 34 | ; |
0 commit comments