GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Test Setup Failed
Push — develop ( c598cf...699529 )
by Alexandre
01:45
created
Helper/Cipher.php 2 patches
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         DirectoryList $directoryList
60 60
     ) {
61 61
         parent::__construct($context);
62
-        $this->directoryList= $directoryList;
62
+        $this->directoryList = $directoryList;
63 63
     }
64 64
 
65 65
     /**
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      * @return boolean
68 68
      */
69 69
     public function isActive() {
70
-        if ( ! isset( $this->cipherActive ) ) {
70
+        if ( ! isset($this->cipherActive)) {
71 71
             $this->cipherActive = $this->scopeConfig->getValue(self::XML_PATH_CUSTOMER_CIPHER_ACTIVE) ? true : false;
72 72
         }
73 73
         return $this->cipherActive;
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      * @return array
78 78
      */
79 79
     private function getKeyAndIv() {
80
-        if ( isset( $this->keyAndIv) ) {
80
+        if (isset($this->keyAndIv)) {
81 81
             return $this->keyAndIv;
82 82
         }
83 83
         $file = $this->directoryList->getPath('var')
@@ -85,10 +85,10 @@  discard block
 block discarded – undo
85 85
             $this->scopeConfig->getValue(self::XML_PATH_CUSTOMER_CIPHER_FILENAME).
86 86
             '.php'
87 87
         ;
88
-        if ( ! is_file($file) ) {
88
+        if ( ! is_file($file)) {
89 89
             return null;
90 90
         }
91
-        $this->keyAndIv= include( $file );
91
+        $this->keyAndIv = include($file);
92 92
         return $this->keyAndIv;
93 93
     }
94 94
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
      * @param string $key
98 98
      * @param string $iv
99 99
      */
100
-    public function setKeyAndIv($key,$iv) {
100
+    public function setKeyAndIv($key, $iv) {
101 101
         $this->keyAndIv = [
102 102
             'key' => (string) $key,
103 103
             'iv' => (string) $iv,
@@ -110,8 +110,8 @@  discard block
 block discarded – undo
110 110
      * @param string $string
111 111
      * @return string
112 112
      */
113
-    public function cipher( $string ) {
114
-        if ( ( $string === null ) || ! is_string( $string ) || ! $this->isActive() ) {
113
+    public function cipher($string) {
114
+        if (($string === null) || ! is_string($string) || ! $this->isActive()) {
115 115
             return $string;
116 116
         }
117 117
         $keyAndIv = $this->getKeyAndIv();
@@ -124,14 +124,14 @@  discard block
 block discarded – undo
124 124
      * @param string $string
125 125
      * @return string
126 126
      */
127
-    public function decipher( $string ) {
128
-        if ( ( $string === null ) || ! is_string($string) || ! preg_match( $this->base64Pattern, $string ) ) {
127
+    public function decipher($string) {
128
+        if (($string === null) || ! is_string($string) || ! preg_match($this->base64Pattern, $string)) {
129 129
             return $string;
130 130
         }
131 131
         $keyAndIv = $this->getKeyAndIv();
132
-        for ( $i = 0 ; $i < 3 ; $i++ ) {
133
-            $clear = openssl_decrypt( $string, self::METHOD, $keyAndIv['key'], 0, $keyAndIv['iv'] );
134
-            if  ( $clear !== false ) {
132
+        for ($i = 0; $i < 3; $i++) {
133
+            $clear = openssl_decrypt($string, self::METHOD, $keyAndIv['key'], 0, $keyAndIv['iv']);
134
+            if ($clear !== false) {
135 135
                 $string = $clear;
136 136
             }
137 137
             else {
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -133,8 +133,7 @@
 block discarded – undo
133 133
             $clear = openssl_decrypt( $string, self::METHOD, $keyAndIv['key'], 0, $keyAndIv['iv'] );
134 134
             if  ( $clear !== false ) {
135 135
                 $string = $clear;
136
-            }
137
-            else {
136
+            } else {
138 137
                 break;
139 138
             }
140 139
         }
Please login to merge, or discard this patch.
Controller/Settings/Save.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     ) {
40 40
         $this->formKeyValidator = $formKeyValidator;
41 41
         $this->customerRepository = $customerRepository;
42
-        $this->storeManager= $storeManager;
42
+        $this->storeManager = $storeManager;
43 43
         parent::__construct($context, $customerSession);
44 44
     }
45 45
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     public function execute()
52 52
     {
53 53
         $request = $this->getRequest();
54
-        if (!$this->formKeyValidator->validate($request)) {
54
+        if ( ! $this->formKeyValidator->validate($request)) {
55 55
             return $this->_redirect('privacy/settings/');
56 56
         }
57 57
         $customerId = $this->_customerSession->getCustomerId();
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
                 /* @var $customer \Magento\Customer\Model\Data\Customer */
64 64
                 $storeId = $this->storeManager->getStore()->getId();
65 65
                 $customer->setStoreId($storeId);
66
-                $customer->setCustomAttribute('personnalized_suggestions', $request->getParam('personnalized_suggestions', 0 ) ? 1 : 0 );
67
-                $customer->setCustomAttribute('third_party', $request->getParam('third_party', 0 ) ? 1 : 0 );
66
+                $customer->setCustomAttribute('personnalized_suggestions', $request->getParam('personnalized_suggestions', 0) ? 1 : 0);
67
+                $customer->setCustomAttribute('third_party', $request->getParam('third_party', 0) ? 1 : 0);
68 68
                 $this->customerRepository->save($customer);
69 69
             } catch (\Exception $e) {
70 70
                 $this->messageManager->addError(__('Something went wrong while saving your privacy settings.'));
Please login to merge, or discard this patch.
Controller/Privacy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
      */
40 40
     public function dispatch(RequestInterface $request)
41 41
     {
42
-        if (!$this->_customerSession->authenticate()) {
42
+        if ( ! $this->_customerSession->authenticate()) {
43 43
             $this->_actionFlag->set('', 'no-dispatch', true);
44 44
         }
45 45
         return parent::dispatch($request);
Please login to merge, or discard this patch.
Test/Unit/CipherTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     {
37 37
         $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
38 38
         $this->cipherHelper = $objectManager->getObject('Adfab\Gdpr\Helper\Cipher');
39
-        $this->cipherHelper->setKeyAndIv($this->key, base64_decode( $this->initialisationVector ) );
39
+        $this->cipherHelper->setKeyAndIv($this->key, base64_decode($this->initialisationVector));
40 40
     }
41 41
 
42 42
     /**
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
      */
45 45
     public function testCrypt()
46 46
     {
47
-        $this->assertEquals($this->cryptedMessage, $this->cipherHelper->cipher( $this->clearMessage ));
47
+        $this->assertEquals($this->cryptedMessage, $this->cipherHelper->cipher($this->clearMessage));
48 48
     }
49 49
 
50 50
     /**
@@ -52,6 +52,6 @@  discard block
 block discarded – undo
52 52
      */
53 53
     public function testDerypt()
54 54
     {
55
-        $this->assertEquals($this->clearMessage, $this->cipherHelper->decipher( $this->cryptedMessage));
55
+        $this->assertEquals($this->clearMessage, $this->cipherHelper->decipher($this->cryptedMessage));
56 56
     }
57 57
 }
58 58
\ No newline at end of file
Please login to merge, or discard this patch.
Block/Settings.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,8 +56,8 @@
 block discarded – undo
56 56
         $customerId = $this->customerSession->getCustomerId();
57 57
         $customer = $this->customerRepository->getById($customerId);
58 58
         /* @var $customer \Magento\Customer\Model\Data\Customer */
59
-        $block->setThirdParty( $customer->getCustomAttribute('third_party')->getValue() );
60
-        $block->setPersonnalizedSuggestions( $customer->getCustomAttribute('personnalized_suggestions')->getValue() );
59
+        $block->setThirdParty($customer->getCustomAttribute('third_party')->getValue());
60
+        $block->setPersonnalizedSuggestions($customer->getCustomAttribute('personnalized_suggestions')->getValue());
61 61
         return parent::_prepareLayout();
62 62
     }
63 63
 
Please login to merge, or discard this patch.
Setup/InstallData.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -77,9 +77,9 @@  discard block
 block discarded – undo
77 77
         Config $eavConfig
78 78
     ) {
79 79
         $this->scopeConfig = $scopeConfig;
80
-        $this->configWriter= $configWriter;
80
+        $this->configWriter = $configWriter;
81 81
         $this->cacheTypeList = $cacheTypeList;
82
-        $this->directoryList= $directoryList;
82
+        $this->directoryList = $directoryList;
83 83
         $this->eavSetupFactory = $eavSetupFactory;
84 84
         $this->eavConfig = $eavConfig;
85 85
     }
@@ -94,9 +94,9 @@  discard block
 block discarded – undo
94 94
     {
95 95
         $setup->startSetup();
96 96
         $dir = $this->directoryList->getPath('var').'/keys';
97
-        if ( ! is_dir( $dir ) ) {
98
-            mkdir( $dir, 0700, true );
99
-            file_put_contents($dir.'/.htaccess','<IfModule !mod_authz_core.c>
97
+        if ( ! is_dir($dir)) {
98
+            mkdir($dir, 0700, true);
99
+            file_put_contents($dir.'/.htaccess', '<IfModule !mod_authz_core.c>
100 100
     Order deny,allow
101 101
     Deny from all
102 102
 </IfModule>
@@ -104,28 +104,28 @@  discard block
 block discarded – undo
104 104
     Require all denied
105 105
 </IfModule>');
106 106
         }
107
-        $fileName = $this->scopeConfig->getValue( Cipher::XML_PATH_CUSTOMER_CIPHER_FILENAME );
108
-        if ( strlen( $fileName ) == 0 ) {
109
-            $fileName = md5(microtime(true).rand(0,10000));
110
-            $this->configWriter->save( Cipher::XML_PATH_CUSTOMER_CIPHER_FILENAME, $fileName);
107
+        $fileName = $this->scopeConfig->getValue(Cipher::XML_PATH_CUSTOMER_CIPHER_FILENAME);
108
+        if (strlen($fileName) == 0) {
109
+            $fileName = md5(microtime(true).rand(0, 10000));
110
+            $this->configWriter->save(Cipher::XML_PATH_CUSTOMER_CIPHER_FILENAME, $fileName);
111 111
             $this->cacheTypeList->cleanType('config');
112 112
         }
113 113
         $file = $dir.'/'.$fileName.'.php';
114
-        if ( ! is_file( $file ) ) {
114
+        if ( ! is_file($file)) {
115 115
             $isCryptoStrong = false;
116
-            $password = openssl_random_pseudo_bytes( 64, $isCryptoStrong );
117
-            $ivlen = openssl_cipher_iv_length( Cipher::METHOD );
116
+            $password = openssl_random_pseudo_bytes(64, $isCryptoStrong);
117
+            $ivlen = openssl_cipher_iv_length(Cipher::METHOD);
118 118
             $isCryptoStrong = false;
119
-            $iv = openssl_random_pseudo_bytes( $ivlen, $isCryptoStrong );
120
-            if( ! $isCryptoStrong ) {
119
+            $iv = openssl_random_pseudo_bytes($ivlen, $isCryptoStrong);
120
+            if ( ! $isCryptoStrong) {
121 121
                 throw new Exception('Non-cryptographically strong algorithm used for iv generation. This IV is not safe to use.');
122 122
             }
123
-            file_put_contents( $file, '<?php return [\'key\'=>\''.md5($password).'\', \'iv\'=>\''.strtr($iv,['\''=>'\\\'']).'\'];' );
123
+            file_put_contents($file, '<?php return [\'key\'=>\''.md5($password).'\', \'iv\'=>\''.strtr($iv, ['\''=>'\\\'']).'\'];');
124 124
             chmod($file, 0700);
125 125
         }
126 126
         $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
127 127
         /* @var $eavSetup \Magento\Eav\Setup\EavSetup */
128
-        foreach( $this->customerFields as $field => $label ) {
128
+        foreach ($this->customerFields as $field => $label) {
129 129
             $eavSetup->addAttribute(
130 130
                 \Magento\Customer\Model\Customer::ENTITY,
131 131
                 $field,
Please login to merge, or discard this patch.
Setup/Uninstall.php 1 patch
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,6 @@
 block discarded – undo
15 15
 
16 16
 DELETE FROM `eav_attribute` WHERE `eav_attribute`.`attribute_code` IN('personnalized_suggestions','third_party');
17 17
 DELETE FROM `setup_module` WHERE `setup_module`.`module` = 'Adfab_Gdpr';
18
-
19 18
      */
20 19
     public function uninstall(SchemaSetupInterface $setup, ModuleContextInterface $context)
21 20
     {
Please login to merge, or discard this patch.
Setup/InstallSchema.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,9 +40,9 @@
 block discarded – undo
40 40
     public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
41 41
     {
42 42
         $setup->startSetup();
43
-        foreach( $this->tables as $table => $columns ) {
43
+        foreach ($this->tables as $table => $columns) {
44 44
             $tableName = $setup->getTable($table);
45
-            foreach( $columns as $column ) {
45
+            foreach ($columns as $column) {
46 46
                 $setup->getConnection()->changeColumn(
47 47
                     $tableName,
48 48
                     $column,
Please login to merge, or discard this patch.
Model/ModelPlugin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
      * @param callable $proceed
15 15
      * @return unknown
16 16
      */
17
-    public function aroundReindex( AbstractModel $object, callable $proceed ) {
17
+    public function aroundReindex(AbstractModel $object, callable $proceed) {
18 18
         $this->cipher($object);
19 19
         $this->cipher->setIsIndexing(true);
20 20
         $return = $proceed();
Please login to merge, or discard this patch.