registration: Validate no duplicate keys exist in extension.json
authorFlorian Schmidt <florian.schmidt.stargatewissen@gmail.com>
Sun, 22 Jan 2017 15:36:22 +0000 (16:36 +0100)
committerLegoktm <legoktm@member.fsf.org>
Wed, 18 Jul 2018 09:29:43 +0000 (09:29 +0000)
commit45cebbe9f66245e16136e63baf79b0cb472088dc
tree181453aae795daaf6ebfa297024ad4981da54482
parent76527cd0979589ec11143d6ecd1bb86f96121153
registration: Validate no duplicate keys exist in extension.json

The JSON specification permits duplicate keys, but doing so is almost
always nearly a mistake.

We can use the JSON lint library (added as
dev-requirement to composer), which is now also used to decode the
JSON (as it's the same step as validating the JSON).

Bug: T153507
Change-Id: Ia713a1906169333c1aa2aebdc0ed060d26428d72
composer.json
includes/registration/ExtensionJsonValidator.php
tests/phpunit/data/registration/duplicate_keys.json [new file with mode: 0644]
tests/phpunit/includes/registration/ExtensionJsonValidatorTest.php