public function __construct()

in src/TestUtils/GcloudWrapper/CloudFunction.php [68:94]


    public function __construct(
        string $projectId,
        string $entryPoint,
        string $functionSignatureType,
        string $region,
        ?string $dir = null
    ) {
        $this->projectId = $projectId;
        $this->entryPoint = $entryPoint;
        $this->functionSignatureType = $functionSignatureType ?: 'http';
        $this->region = $region ?: self::DEFAULT_REGION;

        // Validate properties.
        foreach (['projectId', 'entryPoint', 'functionSignatureType', 'region'] as $required) {
            if (empty($this->$required)) {
                throw new \InvalidArgumentException('Missing required property: ' . $required);
            }
        }
        $typeOptions = ['http', 'cloudevent'];
        if (!in_array($this->functionSignatureType, $typeOptions)) {
            throw new \InvalidArgumentException('Function Signature Type must be one of: ' . join(', ', $typeOptions));
        }

        // Initialize derived and internal state properties.
        $this->functionName = $this->getFunctionName();
        $this->setDefaultVars($projectId, $dir);
    }