-
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
196 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -622,59 +622,6 @@ | |
}, | ||
"install-path": "../mustache/mustache" | ||
}, | ||
{ | ||
"name": "mustangostang/spyc", | ||
"version": "0.6.3", | ||
"version_normalized": "0.6.3.0", | ||
"source": { | ||
"type": "git", | ||
"url": "[email protected]:mustangostang/spyc.git", | ||
"reference": "4627c838b16550b666d15aeae1e5289dd5b77da0" | ||
}, | ||
"dist": { | ||
"type": "zip", | ||
"url": "https://api.github.com/repos/mustangostang/spyc/zipball/4627c838b16550b666d15aeae1e5289dd5b77da0", | ||
"reference": "4627c838b16550b666d15aeae1e5289dd5b77da0", | ||
"shasum": "" | ||
}, | ||
"require": { | ||
"php": ">=5.3.1" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "4.3.*@dev" | ||
}, | ||
"time": "2019-09-10T13:16:29+00:00", | ||
"type": "library", | ||
"extra": { | ||
"branch-alias": { | ||
"dev-master": "0.5.x-dev" | ||
} | ||
}, | ||
"installation-source": "dist", | ||
"autoload": { | ||
"files": [ | ||
"Spyc.php" | ||
] | ||
}, | ||
"notification-url": "https://packagist.org/downloads/", | ||
"license": [ | ||
"MIT" | ||
], | ||
"authors": [ | ||
{ | ||
"name": "mustangostang", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"description": "A simple YAML loader/dumper class for PHP", | ||
"homepage": "https://github.com/mustangostang/spyc/", | ||
"keywords": [ | ||
"spyc", | ||
"yaml", | ||
"yml" | ||
], | ||
"install-path": "../mustangostang/spyc" | ||
}, | ||
{ | ||
"name": "myclabs/deep-copy", | ||
"version": "1.10.2", | ||
|
@@ -4175,33 +4122,34 @@ | |
}, | ||
{ | ||
"name": "symfony/yaml", | ||
"version": "v6.0.2", | ||
"version_normalized": "6.0.2.0", | ||
"version": "v5.4.2", | ||
"version_normalized": "5.4.2.0", | ||
"source": { | ||
"type": "git", | ||
"url": "https://github.com/symfony/yaml.git", | ||
"reference": "ed602f38b8636a2ea21af760d2578f3d2f92fc60" | ||
"reference": "b9eb163846a61bb32dfc147f7859e274fab38b58" | ||
}, | ||
"dist": { | ||
"type": "zip", | ||
"url": "https://api.github.com/repos/symfony/yaml/zipball/ed602f38b8636a2ea21af760d2578f3d2f92fc60", | ||
"reference": "ed602f38b8636a2ea21af760d2578f3d2f92fc60", | ||
"url": "https://api.github.com/repos/symfony/yaml/zipball/b9eb163846a61bb32dfc147f7859e274fab38b58", | ||
"reference": "b9eb163846a61bb32dfc147f7859e274fab38b58", | ||
"shasum": "" | ||
}, | ||
"require": { | ||
"php": ">=8.0.2", | ||
"php": ">=7.2.5", | ||
"symfony/deprecation-contracts": "^2.1|^3", | ||
"symfony/polyfill-ctype": "^1.8" | ||
}, | ||
"conflict": { | ||
"symfony/console": "<5.4" | ||
"symfony/console": "<5.3" | ||
}, | ||
"require-dev": { | ||
"symfony/console": "^5.4|^6.0" | ||
"symfony/console": "^5.3|^6.0" | ||
}, | ||
"suggest": { | ||
"symfony/console": "For validating YAML files using the lint command" | ||
}, | ||
"time": "2021-12-16T22:13:01+00:00", | ||
"time": "2021-12-16T21:58:21+00:00", | ||
"bin": [ | ||
"Resources/bin/yaml-lint" | ||
], | ||
|
@@ -4232,7 +4180,7 @@ | |
"description": "Loads and dumps YAML files", | ||
"homepage": "https://symfony.com", | ||
"support": { | ||
"source": "https://github.com/symfony/yaml/tree/v6.0.2" | ||
"source": "https://github.com/symfony/yaml/tree/v5.4.2" | ||
}, | ||
"funding": [ | ||
{ | ||
|
@@ -4717,7 +4665,6 @@ | |
"squizlabs/php_codesniffer", | ||
"symfony/config", | ||
"symfony/console", | ||
"symfony/deprecation-contracts", | ||
"symfony/filesystem", | ||
"symfony/finder", | ||
"symfony/polyfill-intl-grapheme", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,6 @@ | |
|
||
namespace Symfony\Component\Yaml\Command; | ||
|
||
use Symfony\Component\Console\Attribute\AsCommand; | ||
use Symfony\Component\Console\CI\GithubActionReporter; | ||
use Symfony\Component\Console\Command\Command; | ||
use Symfony\Component\Console\Completion\CompletionInput; | ||
|
@@ -33,21 +32,23 @@ | |
* @author Grégoire Pineau <[email protected]> | ||
* @author Robin Chalas <[email protected]> | ||
*/ | ||
#[AsCommand(name: 'lint:yaml', description: 'Lint a YAML file and outputs encountered errors')] | ||
class LintCommand extends Command | ||
{ | ||
protected static $defaultName = 'lint:yaml'; | ||
protected static $defaultDescription = 'Lint a YAML file and outputs encountered errors'; | ||
|
||
private $parser; | ||
private ?string $format = null; | ||
private bool $displayCorrectFiles; | ||
private ?\Closure $directoryIteratorProvider; | ||
private ?\Closure $isReadableProvider; | ||
private $format; | ||
private $displayCorrectFiles; | ||
private $directoryIteratorProvider; | ||
private $isReadableProvider; | ||
|
||
public function __construct(string $name = null, callable $directoryIteratorProvider = null, callable $isReadableProvider = null) | ||
{ | ||
parent::__construct($name); | ||
|
||
$this->directoryIteratorProvider = null === $directoryIteratorProvider || $directoryIteratorProvider instanceof \Closure ? $directoryIteratorProvider : \Closure::fromCallable($directoryIteratorProvider); | ||
$this->isReadableProvider = null === $isReadableProvider || $isReadableProvider instanceof \Closure ? $isReadableProvider : \Closure::fromCallable($isReadableProvider); | ||
$this->directoryIteratorProvider = $directoryIteratorProvider; | ||
$this->isReadableProvider = $isReadableProvider; | ||
} | ||
|
||
/** | ||
|
@@ -56,6 +57,7 @@ public function __construct(string $name = null, callable $directoryIteratorProv | |
protected function configure() | ||
{ | ||
$this | ||
->setDescription(self::$defaultDescription) | ||
->addArgument('filename', InputArgument::IS_ARRAY, 'A file, a directory or "-" for reading from STDIN') | ||
->addOption('format', null, InputOption::VALUE_REQUIRED, 'The output format') | ||
->addOption('exclude', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Path(s) to exclude') | ||
|
@@ -86,7 +88,7 @@ protected function configure() | |
; | ||
} | ||
|
||
protected function execute(InputInterface $input, OutputInterface $output): int | ||
protected function execute(InputInterface $input, OutputInterface $output) | ||
{ | ||
$io = new SymfonyStyle($input, $output); | ||
$filenames = (array) $input->getArgument('filename'); | ||
|
@@ -242,7 +244,11 @@ private function getFiles(string $fileOrDirectory): iterable | |
|
||
private function getParser(): Parser | ||
{ | ||
return $this->parser ??= new Parser(); | ||
if (!$this->parser) { | ||
$this->parser = new Parser(); | ||
} | ||
|
||
return $this->parser; | ||
} | ||
|
||
private function getDirectoryIterator(string $directory): iterable | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.