Add PHP 7.4, fix Psalm issues#113
Conversation
| "require-dev": { | ||
| "phpunit/phpunit": "^6|^7", | ||
| "vimeo/psalm": "^1|^2" | ||
| "vimeo/psalm": "^2|^3" |
There was a problem hiding this comment.
Version 2 has 7.0 as minimum requirement, so v1 is not required anymore
| <MoreSpecificReturnType errorLevel="info" /> | ||
| <InternalMethod> | ||
| <errorLevel type="suppress"> | ||
| <referencedMethod name="ParagonIE_Sodium_Core_Util::store64_le" /> |
There was a problem hiding this comment.
See #111 point [1]: IMHO ParagonIE_Sodium_Core_Util should be a isolated package
| (string) $footer | ||
| ); | ||
| if (!\is_string($message)) { | ||
| throw new PasetoException('Invalid message decryption'); |
There was a problem hiding this comment.
Cannot test this, but needed for proper return type consistency
| SymmetricKey $key, | ||
| string $footer = '' | ||
| ): string { | ||
| ) { |
There was a problem hiding this comment.
The extension function may return false too:
There was a problem hiding this comment.
If that happens, then we need to be stricter.
There was a problem hiding this comment.
| */ | ||
| public static function protocolFromHeaderPart(string $headerPart): ProtocolInterface { | ||
| if (empty(self::$headerLookup)) { | ||
| /** @var ProtocolInterface $protocolClass */ |
There was a problem hiding this comment.
This messes IDEs, but Psalm correctly infers type from @const array<int, class-string<ProtocolInterface>> notation added above
| - php: 7.2 | ||
| - php: 7.3 | ||
| - php: 7.4 | ||
| env: FULL_TEST=1 |
There was a problem hiding this comment.
The error given in the last failing build:
https://travis-ci.org/github/paragonie/paseto/jobs/677231516#L318-L321
is due to Psalm bugs fixed in more recent version, but not in the older ones.
In general, test shall be done on every version, of course, but static analysis is enough only on the latest one.
|
Ping @paragonie-security |
|
would you mind also adding diff --git a/src/Parsing/PasetoMessage.php b/src/Parsing/PasetoMessage.php
index 8fe4839..132775d 100644
--- a/src/Parsing/PasetoMessage.php
+++ b/src/Parsing/PasetoMessage.php
@@ -47,7 +47,6 @@ final class PasetoMessage
* @throws SecurityException
* @throws InvalidVersionException
* @throws InvalidPurposeException
- * @return PasetoMessage
* @throws \TypeError
*/
public static function fromString(string $tainted): self? That fixes another issue with the latest Psalm, since that function has a duplicate |
|
@lhchavez done, thank you |
|
@paragonie-security as soon as this gets merged, I'll add a PR for PHP 8 compatibility |
|
I was looking to see if PHP 8 was on the radar, would be greatly appreciated if that is happening 👍 |
No description provided.