google-api-php-client-services icon indicating copy to clipboard operation
google-api-php-client-services copied to clipboard

fix(phpdoc): annotation type of score LighthouseCategoryV5

Open Tofandel opened this issue 1 year ago • 4 comments

The score of a category is a double between 0 and 1. Not an array

Tofandel avatar Feb 04 '25 18:02 Tofandel

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Feb 04 '25 18:02 google-cla[bot]

This PR cannot be accepted, those files are automatically generated and cannot be changed manually.

See here the source where this comes from: discoveries/pagespeedonline.v5.json#L492

razvanphp avatar Mar 12 '25 04:03 razvanphp

I'd be interested to know how they are generated, as the phpdoc for setters is not a valid phpdoc syntax and thus the params are not properly inferred in ide or phpstan

Tofandel avatar Mar 12 '25 07:03 Tofandel

I’ve fixed that in #6295

razvanphp avatar Mar 12 '25 07:03 razvanphp

Closing in favor of https://github.com/googleapis/google-api-php-client-services/pull/6295

bshaffer avatar Sep 11 '25 21:09 bshaffer

@bshaffer You misunderstood as that PR does not fix the issue this PR was trying to solve, the comment was a reference to this

the phpdoc for setters is not a valid phpdoc syntax

I’ve fixed that in https://github.com/googleapis/google-api-php-client-services/pull/6295

So apparently the type comes from https://github.com/googleapis/discovery-artifact-manager/blob/755317aaaa2f967c057b621a4ec59bb6599730ca/discoveries/pagespeedonline.v5.json#L450 but if it is any there, why does it become array here? Ideally it should be a double

Tofandel avatar Sep 12 '25 07:09 Tofandel

An any type would be mixed, not a double

bshaffer avatar Sep 12 '25 07:09 bshaffer

Which is why I don't understand why it's array in this repo, it's always been any in the other one

Tofandel avatar Sep 12 '25 07:09 Tofandel