- Notifications
You must be signed in to change notification settings - Fork451
Open
Description
Since the package is deprecated, I was unsure which issue type would be appropriate, but I am submitting this as aBug Report because a PHPStan error occurs.
Environment details
- OS: Debian GNU/Linux 12 (bookworm)
- PHP version: 8.3.22
- Package name and version:
google/cloud-recaptcha-enterprise:2.1.1,google/protobuf:4.31.1
Steps to reproduce
- Create an instance of
RecaptchaEnterpriseServiceClient. - Create a
CreateAssessmentRequestobject. - Send the request using the client.
- Access the
RiskAnalysisof the returnedAssessmentand callgetReasons(). - Attempt to call
getIterator()on the result ofgetReasons(). - A PHPStan error occurs.
Code example
useGoogle\Cloud\RecaptchaEnterprise\V1\Assessment;useGoogle\Cloud\RecaptchaEnterprise\V1\Client\RecaptchaEnterpriseServiceClient;useGoogle\Cloud\RecaptchaEnterprise\V1\CreateAssessmentRequest;// Credentials are actually passed when creating the client$client =newRecaptchaEnterpriseServiceClient();// Omitted: building the Assessment instance$assessment =newAssessment();$assessmentRequest = CreateAssessmentRequest::build($parent,$assessment);$createdAssessment =$client->createAssessment($assessmentRequest);$createdAssessment->getRiskAnalysis()?->getReasons()->getIterator();// Call to an undefined method Google\Protobuf\Internal\RepeatedField::getIterator().
I’ve been following the protobuf updates and it appears this issue may be due to changes introduced here:
I understand that this package is deprecated and things still function for now, but I wanted to report this for future compatibility and also because this causes a PHPStan error. I’d appreciate it if you could consider addressing it.
Metadata
Metadata
Assignees
Labels
No labels