RobDWaller / ReallySimpleJWT

Compare 15a1ff8 ... +7 ... 1e9b8af

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.


@@ -67,6 +67,8 @@
Loading
67 67
     * Check the validity of the JWT's audience claim. The audience claim
68 68
     * defines the recipient or recipients allowed to process the token. This
69 69
     * claim can either be a StringOrURI or an array of StringOrURIs.
70 +
     *
71 +
     * @param string|string[] $audience
70 72
     */
71 73
    public function audience($audience, string $check): bool
72 74
    {
@@ -91,6 +93,8 @@
Loading
91 93
     * Check the alg claim is in the list of valid algorithms. These are the
92 94
     * valid digital signatures, MAC algorithms or "none" as
93 95
     * defined in RFC 7518.
96 +
     *
97 +
     * @param string[] $additional
94 98
     */
95 99
    public function algorithm(string $algorithm, array $additional): bool
96 100
    {

@@ -39,14 +39,14 @@
Loading
39 39
    /**
40 40
     * Holds the JWT header claims
41 41
     *
42 -
     * @var array
42 +
     * @var mixed[]
43 43
     */
44 44
    private $header = [];
45 45
46 46
    /**
47 47
     * Holds the JWT payload claims.
48 48
     *
49 -
     * @var array
49 +
     * @var mixed[]
50 50
     */
51 51
    private $payload = [];
52 52
@@ -66,6 +66,8 @@
Loading
66 66
67 67
    /**
68 68
     * Validate token signature secret.
69 +
     *
70 +
     * @var Interfaces\Secret
69 71
     */
70 72
    private $secretValidator;
71 73
@@ -128,7 +130,7 @@
Loading
128 130
     * the defined header claims. The JWT algorithm and typ are added
129 131
     * by default.
130 132
     *
131 -
     * @return array
133 +
     * @return mixed[]
132 134
     */
133 135
    public function getHeader(): array
134 136
    {
@@ -288,7 +290,7 @@
Loading
288 290
     * Get the JWT payload. This will return an array of registered claims and
289 291
     * private claims which make up the JWT payload.
290 292
     *
291 -
     * @return array
293 +
     * @return mixed[]
292 294
     */
293 295
    public function getPayload(): array
294 296
    {

@@ -13,7 +13,7 @@
Loading
13 13
     * Consumes an associative array of data and returns a json string. Will
14 14
     * return the string 'false' if it fails to encode.
15 15
     *
16 -
     * @param array $jsonArray
16 +
     * @param mixed[] $jsonArray
17 17
     * @return string
18 18
     */
19 19
    public function jsonEncode(array $jsonArray): string
@@ -26,7 +26,7 @@
Loading
26 26
     * associative array.
27 27
     *
28 28
     * @param string $json
29 -
     * @return array
29 +
     * @return mixed[]
30 30
     */
31 31
    public function jsonDecode(string $json): array
32 32
    {

@@ -189,7 +189,7 @@
Loading
189 189
     * Split the JWT into it's component parts, the header, payload and
190 190
     * signature are all separated by a dot.
191 191
     *
192 -
     * @return array
192 +
     * @return string[]
193 193
     */
194 194
    private function splitToken(): array
195 195
    {
@@ -262,7 +262,7 @@
Loading
262 262
    /**
263 263
     * Retrieve the audience claim from the JWT.
264 264
     *
265 -
     * @return string|array
265 +
     * @return string|string[]
266 266
     * @throws ValidateException
267 267
     */
268 268
    private function getAudience()
@@ -292,7 +292,7 @@
Loading
292 292
    /**
293 293
     * Decode the JWT header string to an associative array.
294 294
     *
295 -
     * @return array
295 +
     * @return mixed[]
296 296
     */
297 297
    private function decodeHeader(): array
298 298
    {
@@ -304,7 +304,7 @@
Loading
304 304
    /**
305 305
     * Decode the JWT payload string to an associative array.
306 306
     *
307 -
     * @return array
307 +
     * @return mixed[]
308 308
     */
309 309
    private function decodePayload(): array
310 310
    {

@@ -53,7 +53,7 @@
Loading
53 53
     * Create a JSON Web Token with a custom payload built from a key
54 54
     * value array.
55 55
     *
56 -
     * @param array $payload
56 +
     * @param mixed[] $payload
57 57
     *
58 58
     * @return string
59 59
     */
@@ -104,7 +104,7 @@
Loading
104 104
     *
105 105
     * @param string $token
106 106
     *
107 -
     * @return array
107 +
     * @return mixed[]
108 108
     */
109 109
    public static function getHeader(string $token, string $secret): array
110 110
    {
@@ -119,7 +119,7 @@
Loading
119 119
     *
120 120
     * @param string $token
121 121
     *
122 -
     * @return array
122 +
     * @return mixed[]
123 123
     */
124 124
    public static function getPayload(string $token, string $secret): array
125 125
    {

Click to load this diff.
Loading diff...

Learn more Showing 3 files with coverage changes found.

Changes in src/Validate.php
-1
Loading file...
Changes in src/Secret.php
-1
Loading file...
Changes in src/Encode.php
-1
Loading file...
Files Complexity Coverage
src ø 100.00%
Project Totals (9 files) 110 100.00%
Loading