Skip to content

Commit

Permalink
Skip schema validation when running completion for increased bootstra…
Browse files Browse the repository at this point in the history
…p performance
  • Loading branch information
Seldaek committed May 12, 2022
1 parent 3f848cd commit 6be071f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Composer/Factory.php
Expand Up @@ -704,6 +704,10 @@ private static function getUserDir(): string
*/
private static function validateJsonSchema(?IOInterface $io, $fileOrData, int $schema = JsonFile::LAX_SCHEMA, ?string $source = null): void
{
if (!Platform::isInputCompletionProcess()) {
return;
}

try {
if ($fileOrData instanceof JsonFile) {
$fileOrData->validateSchema($schema);
Expand Down

0 comments on commit 6be071f

Please sign in to comment.