Completed
Branch master (3d883f)
by Milos
04:23
created
src/JoseJwt/Jwe/AesKeyWrapAlgorithm.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
      * @param string|resource $kek
44 44
      * @param array           $header
45 45
      *
46
-     * @return array [cek, encryptedCek]
46
+     * @return string[] [cek, encryptedCek]
47 47
      */
48 48
     public function wrapNewKey($cekSizeBits, $kek, array $header)
49 49
     {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -48,10 +48,10 @@  discard block
 block discarded – undo
48 48
     public function wrapNewKey($cekSizeBits, $kek, array $header)
49 49
     {
50 50
         $kekLen = strlen($kek);
51
-        if ($kekLen * 8 != $this->kekLengthBits) {
51
+        if ($kekLen*8 != $this->kekLengthBits) {
52 52
             throw new JoseJwtException(sprintf('AesKeyWrap management algorithm expected key of size %s bits, but was given %s bits', $this->kekLengthBits, $kekLen*8));
53 53
         }
54
-        if ($cekSizeBits % 8 != 0) {
54
+        if ($cekSizeBits%8 != 0) {
55 55
             throw new JoseJwtException('CekSizeBits must be divisible by 8');
56 56
         }
57 57
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     public function unwrap($encryptedCek, $kek, $cekSizeBits, array $header)
74 74
     {
75 75
         $kekLen = strlen($kek);
76
-        if ($kekLen * 8 != $this->kekLengthBits) {
76
+        if ($kekLen*8 != $this->kekLengthBits) {
77 77
             throw new JoseJwtException(sprintf('AesKeyWrap management algorithm expected key of size %s bits, but was given %s bits', $this->kekLengthBits, $kekLen*8));
78 78
         }
79 79
 
Please login to merge, or discard this patch.
src/JoseJwt/Jwe/RsaAlgorithm.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
      * @param string|resource $kek
29 29
      * @param array           $header
30 30
      *
31
-     * @return array [cek, encryptedCek]
31
+     * @return string[] [cek, encryptedCek]
32 32
      */
33 33
     public function wrapNewKey($cekSizeBits, $kek, array $header)
34 34
     {
Please login to merge, or discard this patch.
src/JoseJwt/Jws/RsaUsingSha.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
      * @param string $securedInput
38 38
      * @param string $key
39 39
      *
40
-     * @return bool
40
+     * @return integer
41 41
      */
42 42
     public function verify($signature, $securedInput, $key)
43 43
     {
Please login to merge, or discard this patch.
src/JoseJwt/Jwe/AesCbcHmacEncryption.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -49,10 +49,10 @@  discard block
 block discarded – undo
49 49
     public function encrypt($aad, $plainText, $cek)
50 50
     {
51 51
         $cekLen = strlen($cek);
52
-        if ($cekLen * 8 != $this->keySize) {
52
+        if ($cekLen*8 != $this->keySize) {
53 53
             throw new JoseJwtException(sprintf('AES-CBC with HMAC algorithm expected key of size %s bits, but was given %s bits', $this->keySize, $cekLen*8));
54 54
         }
55
-        if ($cekLen % 2 != 0) {
55
+        if ($cekLen%2 != 0) {
56 56
             throw new JoseJwtException('AES-CBC with HMAC algorithm expected key of even number size');
57 57
         }
58 58
 
@@ -81,10 +81,10 @@  discard block
 block discarded – undo
81 81
     public function decrypt($aad, $cek, $iv, $cipherText, $authTag)
82 82
     {
83 83
         $cekLen = strlen($cek);
84
-        if ($cekLen *8  != $this->keySize) {
84
+        if ($cekLen*8 != $this->keySize) {
85 85
             throw new JoseJwtException(sprintf('AES-CBC with HMAC algorithm expected key of size %s bits, but was given %s bits', $this->keySize, $cekLen*8));
86 86
         }
87
-        if ($cekLen % 2 != 0) {
87
+        if ($cekLen%2 != 0) {
88 88
             throw new JoseJwtException('AES-CBC with HMAC algorithm expected key of even number size');
89 89
         }
90 90
 
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
             $aad,
119 119
             $iv,
120 120
             $cipherText,
121
-            pack('N2', ($aadLen / $max32bit) * 8, ($aadLen % $max32bit) * 8)
121
+            pack('N2', ($aadLen/$max32bit)*8, ($aadLen%$max32bit)*8)
122 122
         ]);
123 123
         $authTag = $this->hashAlgorithm->sign($hmacInput, $hmacKey);
124 124
         $authTagLen = strlen($authTag);
Please login to merge, or discard this patch.
autoload.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // if library is in dev environement with its own vendor, include its autoload
4
-if(file_exists(__DIR__ . '/vendor'))
5
-    require_once __DIR__ . '/vendor/autoload.php';
4
+if (file_exists(__DIR__.'/vendor'))
5
+    require_once __DIR__.'/vendor/autoload.php';
6 6
 // if library is in vendor of another project, include the global autolaod
7 7
 else
8
-    require_once __DIR__ . '/../../autoload.php';
8
+    require_once __DIR__.'/../../autoload.php';
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // if library is in dev environement with its own vendor, include its autoload
4
-if(file_exists(__DIR__ . '/vendor'))
4
+if(file_exists(__DIR__ . '/vendor')) {
5 5
     require_once __DIR__ . '/vendor/autoload.php';
6
+}
6 7
 // if library is in vendor of another project, include the global autolaod
7
-else
8
+else {
8 9
     require_once __DIR__ . '/../../autoload.php';
10
+}
Please login to merge, or discard this patch.