{"record":{"id":"d3dd2cb4c278bb7a","repo":"pestphp/pest","slug":"the-update-shards-option-cannot-be-combined-wi","errorCode":null,"errorMessage":"The [--update-shards] option cannot be combined with [--shard].","messagePattern":"The \\[--update-shards\\] option cannot be combined with \\[--shard\\]\\.","errorType":"exception","errorClass":"InvalidOption","httpStatus":null,"severity":"error","filePath":"src/Plugins/Shard.php","lineNumber":145,"sourceCode":"        if ($testsToRun === []) {\n            return $arguments;\n        }\n\n        $filter = $this->buildFilterArgument($testsToRun);\n\n        $this->ensureFilterLengthIsSafe($filter);\n\n        return [...$arguments, '--filter', $filter];\n    }\n\n    /**\n     * @param  array<int, string>  $arguments\n     * @return array<int, string>\n     */\n    private function handleUpdateShards(array $arguments): array\n    {\n        if ($this->hasArgument('--shard', $arguments)) {\n            throw new InvalidOption('The [--update-shards] option cannot be combined with [--shard].');\n        }\n\n        $arguments = $this->popArgument('--update-shards', $arguments);\n\n        self::$updateShards = true;\n\n        /** @phpstan-ignore-next-line */\n        self::$knownTests = $this->allTests($arguments);\n\n        if ($this->hasArgument('--parallel', $arguments) || $this->hasArgument('-p', $arguments)) {\n            Parallel::setGlobal('UPDATE_SHARDS', true);\n            Parallel::setGlobal('SHARD_RUN_ID', uniqid('pest-shard-', true));\n        } else {\n            Event\\Facade::instance()->registerSubscriber(new EnsureShardTimingStarted);\n            Event\\Facade::instance()->registerSubscriber(new EnsureShardTimingFinished);\n        }\n\n        return $arguments;","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/pestphp/pest/blob/1af74a215c3a89bc7a44fc6f9322e369eaad2423/src/Plugins/Shard.php#L127-L163","documentation":"Error \"The [--update-shards] option cannot be combined with [--shard].\" thrown in pestphp/pest.","triggerScenarios":"Thrown at src/Plugins/Shard.php:145 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1af74a215c3a89bc7a44fc6f9322e369eaad2423","analyzedAt":"2026-08-21T02:16:38.132Z","schemaVersion":2},"datasetVersion":"2026-08-21T03:17:12.404Z"}