diff --git a/src/Symfony/Component/Yaml/bin/lint b/src/Symfony/Component/Yaml/bin/lint new file mode 100755 index 0000000000000..e38e162422170 --- /dev/null +++ b/src/Symfony/Component/Yaml/bin/lint @@ -0,0 +1,28 @@ +#!/usr/bin/env php + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once __DIR__.'/vendor/autoload.php'; + +use Symfony\Component\Console\Application; +use Symfony\Component\Yaml\Command\LintCommand; + +if (!class_exists(Application::class)) { + fwrite(STDERR, 'The "symfony/console" package must be installed.'.PHP_EOL); + + exit(1); +} + +(new Application('symfony/yaml')) + ->add(new LintCommand()) + ->getApplication() + ->setDefaultCommand('lint:yaml', true) + ->run(); diff --git a/src/Symfony/Component/Yaml/composer.json b/src/Symfony/Component/Yaml/composer.json index 9c92bebcf2e00..78b3b805f697f 100644 --- a/src/Symfony/Component/Yaml/composer.json +++ b/src/Symfony/Component/Yaml/composer.json @@ -24,12 +24,18 @@ "suggest": { "symfony/console": "For validating YAML files using the lint command" }, + "conflict": { + "symfony/console": "<3.2" + }, "autoload": { "psr-4": { "Symfony\\Component\\Yaml\\": "" }, "exclude-from-classmap": [ "/Tests/" ] }, + "bin": [ + "bin/lint" + ], "minimum-stability": "dev", "extra": { "branch-alias": {