private function gcloudCommand()

in src/TestUtils/GcloudWrapper/CloudFunction.php [240:263]


    private function gcloudCommand(array $args, ?string $channel = null)
    {
        if (!in_array($channel, [null, 'alpha', 'beta'])) {
            $this->errorLog('gcloud channel must use product (null), "alpha" or "beta". Defaulting to production.');

            return false;
        }

        // Append current command arguments to the "permanent" arguments.
        $args = array_merge([
            'gcloud',
            $channel,
            '-q',
            self::GCLOUD_COMPONENT,
        ], $args, [
            '--project', $this->projectId,
            # Region is needed in most commands but is not global to component.
            '--region', $this->region,
        ]);

        // Strip empty values such as null channel.
        $args = array_filter($args);
        return new Process($args, $this->dir);
    }