Skip to content

Commit

Permalink
Enhancement: Use ergebnis/composer-json-normalizer instead of localhe…
Browse files Browse the repository at this point in the history
…inz/composer-json-normalizer
  • Loading branch information
localheinz committed Dec 15, 2019
1 parent 5c4c5a0 commit e1fa491
Show file tree
Hide file tree
Showing 6 changed files with 187 additions and 62 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

For a full diff see [`1.3.1...1.x`][1.3.1...1.x]

## Changed

* Started using `ergebnis/composer-json-normalizer` instead of `localheinz/composer-json-normalizer` ([#261]), by [@localheinz]

### Fixed

* Dropped support for PHP 7.1 ([#235]), by [@localheinz]
Expand Down Expand Up @@ -249,6 +253,7 @@ For a full diff see [`81bc3a8...0.1.0`][81bc3a8...0.1.0].
[#190]: https://github.com/localheinz/composer-normalize/pull/190
[#207]: https://github.com/localheinz/composer-normalize/pull/207
[#235]: https://github.com/localheinz/composer-normalize/pull/235
[#261]: https://github.com/localheinz/composer-normalize/pull/261

[@localheinz]: https://github.com/localheinz
[@svenluijten]: https://github.com/svenluijten
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"require": {
"php": "^7.2",
"composer-plugin-api": "^1.1.0",
"localheinz/composer-json-normalizer": "^1.0.2",
"ergebnis/composer-json-normalizer": "^2.0.0",
"localheinz/diff": "^1.0.0",
"localheinz/json-normalizer": "~0.9.0"
},
Expand Down
226 changes: 172 additions & 54 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions src/Command/NormalizeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@

use Composer\Command;
use Composer\Factory;
use Ergebnis\Json\Normalizer;
use Ergebnis\Json\Printer;
use Localheinz\Diff;
use Localheinz\Json\Normalizer;
use Symfony\Component\Console;

final class NormalizeCommand extends Command\BaseCommand
Expand Down Expand Up @@ -59,7 +60,7 @@ public function __construct(

$this->factory = $factory;
$this->normalizer = $normalizer;
$this->formatter = $formatter ?: new Normalizer\Format\Formatter();
$this->formatter = $formatter ?: new Normalizer\Format\Formatter(new Printer\Printer());

if (null === $differ) {
$differ = new Diff\Differ(new Diff\Output\StrictUnifiedDiffOutputBuilder([
Expand Down
2 changes: 1 addition & 1 deletion src/NormalizePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use Composer\Factory;
use Composer\IO;
use Composer\Plugin;
use Localheinz\Composer\Json\Normalizer;
use Ergebnis\Composer\Json\Normalizer;
use Localheinz\Composer\Normalize\Command\SchemaUriResolver;

final class NormalizePlugin implements Plugin\Capability\CommandProvider, Plugin\Capable, Plugin\PluginInterface
Expand Down
9 changes: 5 additions & 4 deletions test/Integration/Command/NormalizeCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@

use Composer\Console\Application;
use Composer\Factory;
use Ergebnis\Json\Normalizer\Format\Formatter;
use Ergebnis\Json\Normalizer\Json;
use Ergebnis\Json\Normalizer\NormalizerInterface;
use Ergebnis\Json\Printer\Printer;
use Ergebnis\Test\Util\Helper;
use Localheinz\Composer\Normalize\Command\NormalizeCommand;
use Localheinz\Composer\Normalize\NormalizePlugin;
use Localheinz\Composer\Normalize\Test\Util\CommandInvocation;
use Localheinz\Composer\Normalize\Test\Util\Directory;
use Localheinz\Composer\Normalize\Test\Util\Scenario;
use Localheinz\Composer\Normalize\Test\Util\State;
use Localheinz\Json\Normalizer\Format\Formatter;
use Localheinz\Json\Normalizer\Json;
use Localheinz\Json\Normalizer\NormalizerInterface;
use PHPUnit\Framework;
use Symfony\Component\Console;
use Symfony\Component\Filesystem;
Expand Down Expand Up @@ -284,7 +285,7 @@ public function normalize(Json $json): Json
throw new \RuntimeException($this->exceptionMessage);
}
},
new Formatter()
new Formatter(new Printer())
));

$input = new Console\Input\ArrayInput($scenario->consoleParameters());
Expand Down

0 comments on commit e1fa491

Please sign in to comment.