Fix: Merge tools/composer.json into composer.json
1 |
<?php
|
|
2 |
|
|
3 |
declare(strict_types=1); |
|
4 |
|
|
5 |
/**
|
|
6 |
* Copyright (c) 2018-2020 Andreas Möller
|
|
7 |
*
|
|
8 |
* For the full copyright and license information, please view
|
|
9 |
* the LICENSE.md file that was distributed with this source code.
|
|
10 |
*
|
|
11 |
* @see https://github.com/ergebnis/composer-normalize
|
|
12 |
*/
|
|
13 |
|
|
14 |
namespace Ergebnis\Composer\Normalize; |
|
15 |
|
|
16 |
use Composer\Composer; |
|
17 |
use Composer\Factory; |
|
18 |
use Composer\IO; |
|
19 |
use Composer\Plugin; |
|
20 |
use Ergebnis\Json\Normalizer; |
|
21 |
use Ergebnis\Json\Printer; |
|
22 |
use Localheinz\Diff; |
|
23 |
|
|
24 |
final class NormalizePlugin implements Plugin\Capability\CommandProvider, Plugin\Capable, Plugin\PluginInterface |
|
25 |
{
|
|
26 |
public function activate(Composer $composer, IO\IOInterface $io): void |
|
27 |
{
|
|
28 |
}
|
|
29 |
|
|
30 |
public function deactivate(Composer $composer, IO\IOInterface $io): void |
|
31 |
{
|
|
32 |
}
|
|
33 |
|
|
34 |
public function uninstall(Composer $composer, IO\IOInterface $io): void |
|
35 |
{
|
|
36 |
}
|
|
37 |
|
|
38 |
public function getCapabilities(): array |
|
39 |
{
|
|
40 |
return [ |
|
41 |
Plugin\Capability\CommandProvider::class => self::class, |
|
42 |
];
|
|
43 |
}
|
|
44 |
|
|
45 | 1 |
public function getCommands(): array |
46 |
{
|
|
47 |
return [ |
|
48 | 1 |
new Command\NormalizeCommand( |
49 | 1 |
new Factory(), |
50 | 1 |
new Normalizer\Vendor\Composer\ComposerJsonNormalizer(\sprintf( |
51 |
'file://%s', |
|
52 | 1 |
\realpath(__DIR__ . '/../resource/schema.json') |
53 |
)),
|
|
54 | 1 |
new Normalizer\Format\Formatter(new Printer\Printer()), |
55 | 1 |
new Diff\Differ(new Diff\Output\StrictUnifiedDiffOutputBuilder([ |
56 | 1 |
'fromFile' => 'original', |
57 |
'toFile' => 'normalized', |
|
58 |
]))
|
|
59 |
),
|
|
60 |
];
|
|
61 |
}
|
|
62 |
}
|
Read our documentation on viewing source code .