brick / math

Arbitrary-precision arithmetic library for PHP
MIT License
1.78k stars 75 forks source link

New Psalm issues #41

Closed BenMorel closed 3 years ago

BenMorel commented 4 years ago

The latest build highlighted yet another kind of Psalm issue:

ERROR: MoreSpecificReturnType - src/BigNumber.php:159:16 - The declared return type 'Brick\Math\BigNumber&static' for Brick\Math\BigNumber::min is more specific than the inferred return type 'Brick\Math\BigNumber' (see https://psalm.dev/070)

  • @ return static The minimum value. ERROR: LessSpecificReturnStatement - src/BigNumber.php:182:16 - The type 'Brick\Math\BigNumber' is more general than the declared return type 'Brick\Math\BigNumber&static' for Brick\Math\BigNumber::min (see https://psalm.dev/129) return $min; ...

https://travis-ci.org/github/brick/math/jobs/675371330

@alexeyshockov Could you please have a look?

BenMorel commented 4 years ago

@alexeyshockov Do you have time to fix this issue, please?

alexeyshockov commented 4 years ago

Sorry, was busy in personal projects. Could you take a look at the corresponding PR? I added new type annotations and changes Psalm config, all related to the latest changes in the tool.

alexeyshockov commented 3 years ago

@BenMorel, could you take a look at the related PR? I saw you released a new version, so probably you should have a minute or two for that now :)

BenMorel commented 3 years ago

@alexeyshockov Thank you for the PR, and sorry for not replying earlier! I indeed took the time to implement several pending feature requests, and I'll now move on to the build stuff: Psalm/PHPCS/CI in the coming days.

BenMorel commented 3 years ago

Fixed in cbdd9605fcfc593b42f2b82735d39f27fc562bb6.