Passed
Push — master ( 8a5191...117726 )
by Damien
07:51
created
src/services/KeyChainService.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
      */
36 36
     public function save(KeyChainRecord $keyChainRecord, $runValidation = true, $attributeNames = null)
37 37
     {
38
-        if (! $runValidation && $keyChainRecord->validate()) {
38
+        if (!$runValidation && $keyChainRecord->validate()) {
39 39
             return false;
40 40
         }
41 41
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     public function decrypt(KeyChainRecord $record)
70 70
     {
71 71
 
72
-        if ($record->isEncrypted && ! $record->isDecrypted) {
72
+        if ($record->isEncrypted && !$record->isDecrypted) {
73 73
             $record->decryptedKey = \Craft::$app->getSecurity()->decryptByKey(
74 74
                 base64_decode($record->key),
75 75
                 \Craft::$app->getConfig()->getGeneral()->securityKey
Please login to merge, or discard this patch.
src/records/KeyChainRecord.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      */
64 64
     public function isKeyCertAPair($attribute, $params, $validator)
65 65
     {
66
-        if (! openssl_x509_check_private_key($this->getDecryptedCertificate(), $this->getDecryptedKey())) {
66
+        if (!openssl_x509_check_private_key($this->getDecryptedCertificate(), $this->getDecryptedKey())) {
67 67
             $this->addError($attribute, 'Key and certificate are not a pair.');
68 68
         }
69 69
     }
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
      */
87 87
     public function getDecryptedKey()
88 88
     {
89
-        if (! $this->decryptedKey) {
89
+        if (!$this->decryptedKey) {
90 90
             KeyChain::getInstance()->getService()->decrypt($this);
91 91
             $this->isDecrypted = true;
92 92
         }
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
      */
101 101
     public function getDecryptedCertificate()
102 102
     {
103
-        if (! $this->decryptedCertificate) {
103
+        if (!$this->decryptedCertificate) {
104 104
             KeyChain::getInstance()->getService()->decrypt($this);
105 105
         }
106 106
 
Please login to merge, or discard this patch.
src/controllers/cp/AbstractController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
         ];
38 38
 
39 39
 
40
-        if (! ($this->getPlugin() instanceof KeyChain)) {
40
+        if (!($this->getPlugin() instanceof KeyChain)) {
41 41
             $variables['crumbs'][] = [
42 42
                 'url'   => UrlHelper::cpUrl($this->getPlugin()->getUniqueId()),
43 43
                 'label' => $this->getPlugin()->name,
Please login to merge, or discard this patch.
src/models/Settings.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
     public $opensslDefaults = [
24 24
         'digestAlgorithm'=>'sha256',
25 25
         'keyBits'=>2048,
26
-        'daysExpiry'=>365*2, //2 years
26
+        'daysExpiry'=>365 * 2, //2 years
27 27
         'description' => 'My Key Pair',
28 28
         'countryName' => 'US',
29 29
         'stateOrProvinceName' => 'Colorado',
Please login to merge, or discard this patch.
src/controllers/AbstractUpsertController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
             return $this->asJson($keyPair->toArray());
158 158
         }
159 159
 
160
-        if (! $keyPair->hasErrors()) {
160
+        if (!$keyPair->hasErrors()) {
161 161
             Craft::$app->getSession()->setNotice(Craft::t('keychain', 'Key pair saved.'));
162 162
         } else {
163 163
             Craft::$app->getSession()->setError(Craft::t('keychain', 'Key pair didn\'t save.'));
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
             'id' => $keypairId,
191 191
         ])->one();
192 192
 
193
-        $keychainRecord->enabled = ! $keychainRecord->enabled;
193
+        $keychainRecord->enabled = !$keychainRecord->enabled;
194 194
 
195 195
         if (KeyChain::getInstance()->getService()->save($keychainRecord)) {
196 196
             Craft::$app->getSession()->setNotice(Craft::t('keychain', 'Key pair saved.'));
Please login to merge, or discard this patch.
src/cli/AbstractOpenSSL.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@
 block discarded – undo
75 75
         $keyPairRecord->isDecrypted = true;
76 76
 
77 77
 
78
-        if (! KeyChain::getInstance()->getService()->save($keyPairRecord)) {
78
+        if (!KeyChain::getInstance()->getService()->save($keyPairRecord)) {
79 79
             $this->stderr(
80 80
                 sprintf('Failed to save new key pair to the database') . PHP_EOL,
81 81
                 Console::FG_RED
Please login to merge, or discard this patch.
src/records/EmberTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
      */
54 54
     public function isEnabled()
55 55
     {
56
-        return (bool)$this->enabled;
56
+        return (bool) $this->enabled;
57 57
     }
58 58
 
59 59
     /**
Please login to merge, or discard this patch.