@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * Copyright (c) 2017-present Ganbaro Digital Ltd |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public static function to(string $message, string $hashAlgo, string $key) : string |
72 | 72 | { |
73 | - $sig = CalculateHmac::for($message, $hashAlgo, $key); |
|
73 | + $sig = CalculateHmac::for ($message, $hashAlgo, $key); |
|
74 | 74 | return $sig . Hmac::MARKER . $message; |
75 | 75 | } |
76 | 76 | } |
77 | 77 | \ No newline at end of file |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * Copyright (c) 2017-present Ganbaro Digital Ltd |
@@ -75,10 +75,10 @@ discard block |
||
75 | 75 | * if the HMAC attached to $message doesn't match what we expect |
76 | 76 | * (strongly suggests $message has been tampered with) |
77 | 77 | */ |
78 | - public static function for(string $message, $expectedHmac, string $hashAlgo, string $key) |
|
78 | + public static function for (string $message, $expectedHmac, string $hashAlgo, string $key) |
|
79 | 79 | { |
80 | 80 | // has the message been tampered with? |
81 | - $actualHmac = CalculateHmac::for($message, $hashAlgo, $key); |
|
81 | + $actualHmac = CalculateHmac::for ($message, $hashAlgo, $key); |
|
82 | 82 | if ($expectedHmac !== $actualHmac) { |
83 | 83 | throw HmacVerificationFailed::newFromInputParameter($message, '$message'); |
84 | 84 | } |
@@ -75,8 +75,7 @@ |
||
75 | 75 | * if the HMAC attached to $message doesn't match what we expect |
76 | 76 | * (strongly suggests $message has been tampered with) |
77 | 77 | */ |
78 | - public static function for(string $message, $expectedHmac, string $hashAlgo, string $key) |
|
79 | - { |
|
78 | + public static function for(string $message, $expectedHmac, string $hashAlgo, string $key) { |
|
80 | 79 | // has the message been tampered with? |
81 | 80 | $actualHmac = CalculateHmac::for($message, $hashAlgo, $key); |
82 | 81 | if ($expectedHmac !== $actualHmac) { |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * Copyright (c) 2017-present Ganbaro Digital Ltd |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @throws UnsupportedHmacAlgorithm |
69 | 69 | * if $hashAlgo isn't supported by our PHP runtime |
70 | 70 | */ |
71 | - public static function for(string $message, string $hashAlgo, string $key) : string |
|
71 | + public static function for (string $message, string $hashAlgo, string $key) : string |
|
72 | 72 | { |
73 | 73 | // robustness! |
74 | 74 | RequireValidHmacAlgorithm::apply()->to($hashAlgo); |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * Copyright (c) 2017-present Ganbaro Digital Ltd |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | // |
76 | 76 | // if the HMAC is missing or invalid, it will throw an exception |
77 | 77 | // so that we don't have to |
78 | - Operations\VerifyHmac::for($message, $expectedHmac, $this->hmacType, $this->hmacKey); |
|
78 | + Operations\VerifyHmac::for ($message, $expectedHmac, $this->hmacType, $this->hmacKey); |
|
79 | 79 | |
80 | 80 | // all done |
81 | 81 | return $next->process($message); |