PHPStan Error in google/cloud-recaptcha-enterprise
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
Research direction
Start with RecaptchaEnterpriseServiceClient, Assessment::getRiskAnalysis(), and RiskAnalysis::getReasons(), then compare the returned RepeatedField behavior with the referenced protobuf-php change. Reproduce the PHPStan error using the shown request flow and determine the compatibility boundary. Done means the reported undefined-method error has an agreed, verified resolution for this deprecated package.
Written by the indexing model from the issue text.
Description
Since the package is deprecated, I was unsure which issue type would be appropriate, but I am submitting this as a Bug 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
use Google\Cloud\RecaptchaEnterprise\V1\Assessment;
use Google\Cloud\RecaptchaEnterprise\V1\Client\RecaptchaEnterpriseServiceClient;
use Google\Cloud\RecaptchaEnterprise\V1\CreateAssessmentRequest;
// Credentials are actually passed when creating the client
$client = new RecaptchaEnterpriseServiceClient();
// Omitted: building the Assessment instance
$assessment = new Assessment();
$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.
- Dominant language
- PHP
- Stars
- 1.2k
- Forks
- 464
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 103
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from googleapis/google-cloud-php
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
googleapis/google-cloud-php#9730 ·
-
type: feature request
Difficulty 1/5 Under an hour Newbie friendliness 75/100
googleapis/google-cloud-php#9716 · 11 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
googleapis/google-cloud-php#9725 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
googleapis/google-cloud-php#9675 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
googleapis/google-cloud-php#9674 · 1 comment ·
All issues in googleapis/google-cloud-php
Similar issues
-
tooling
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
UX
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
ProfessionalWiki/NeoWiki#1525 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
bug customer-reported
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
MagnaCapax/PMSS#949 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Automattic/static-site-importer#1829 ·