Passed
Pull Request — master (#18)
by Matt
02:29
created
src/Extensions/LDAPMemberExtension.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -106,14 +106,14 @@  discard block
 block discarded – undo
106 106
             'IsExpired',
107 107
             $ldapMetadata[] = ReadonlyField::create(
108 108
                 'IsExpired',
109
-                _t(__CLASS__ . '.ISEXPIRED', 'Has user\'s LDAP/AD login expired?')
109
+                _t(__CLASS__.'.ISEXPIRED', 'Has user\'s LDAP/AD login expired?')
110 110
             )
111 111
         );
112 112
         $fields->replaceField(
113 113
             'LastSynced',
114 114
             $ldapMetadata[] = ReadonlyField::create(
115 115
                 'LastSynced',
116
-                _t(__CLASS__ . '.LASTSYNCED', 'Last synced')
116
+                _t(__CLASS__.'.LASTSYNCED', 'Last synced')
117 117
             )
118 118
         );
119 119
         $fields->addFieldsToTab('Root.LDAP', $ldapMetadata);
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
         $message = '';
122 122
         if ($this->owner->GUID && $this->owner->config()->update_ldap_from_local) {
123 123
             $message = _t(
124
-                __CLASS__ . '.CHANGEFIELDSUPDATELDAP',
124
+                __CLASS__.'.CHANGEFIELDSUPDATELDAP',
125 125
                 'Changing fields here will update them in LDAP.'
126 126
             );
127 127
         } elseif ($this->owner->GUID && !$this->owner->config()->update_ldap_from_local) {
@@ -133,11 +133,11 @@  discard block
 block discarded – undo
133 133
                     // Set to readonly, but not disabled so that the data is still sent to the
134 134
                     // server and doesn't break Member_Validator
135 135
                     $field->setReadonly(true);
136
-                    $field->setTitle($field->Title()._t(__CLASS__ . '.IMPORTEDFIELD', ' (imported)'));
136
+                    $field->setTitle($field->Title()._t(__CLASS__.'.IMPORTEDFIELD', ' (imported)'));
137 137
                 }
138 138
             }
139 139
             $message = _t(
140
-                __CLASS__ . '.INFOIMPORTED',
140
+                __CLASS__.'.INFOIMPORTED',
141 141
                 'This user is automatically imported from LDAP. '.
142 142
                     'Manual changes to imported fields will be removed upon sync.'
143 143
             );
Please login to merge, or discard this patch.
src/Control/LDAPDebugController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
      * @var array
33 33
      */
34 34
     private static $dependencies = [
35
-        'ldapService' => '%$' . LDAPService::class
35
+        'ldapService' => '%$'.LDAPService::class
36 36
     ];
37 37
 
38 38
     /**
Please login to merge, or discard this patch.
src/Forms/LDAPLoginForm.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,13 +45,13 @@  discard block
 block discarded – undo
45 45
         if (Config::inst()->get(LDAPAuthenticator::class, 'allow_email_login') === 'yes') {
46 46
             $loginField = TextField::create(
47 47
                 'Login',
48
-                _t(__CLASS__ . '.USERNAMEOREMAIL', 'Username or email'),
48
+                _t(__CLASS__.'.USERNAMEOREMAIL', 'Username or email'),
49 49
                 null,
50 50
                 null,
51 51
                 $this
52 52
             );
53 53
         } else {
54
-            $loginField = TextField::create('Login', _t(__CLASS__ . '.USERNAME', 'Username'), null, null, $this);
54
+            $loginField = TextField::create('Login', _t(__CLASS__.'.USERNAME', 'Username'), null, null, $this);
55 55
         }
56 56
 
57 57
         $this->Fields()->replaceField('Email', $loginField);
@@ -98,6 +98,6 @@  discard block
 block discarded – undo
98 98
      */
99 99
     public function getAuthenticatorName()
100 100
     {
101
-        return _t(__CLASS__ . '.AUTHENTICATORNAME', 'LDAP');
101
+        return _t(__CLASS__.'.AUTHENTICATORNAME', 'LDAP');
102 102
     }
103 103
 }
Please login to merge, or discard this patch.
src/Forms/LDAPChangePasswordForm.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         ) {
60 60
             $emailField = TextField::create(
61 61
                 'Email',
62
-                _t(__CLASS__ . '.USERNAMEOREMAIL', 'Email'),
62
+                _t(__CLASS__.'.USERNAMEOREMAIL', 'Email'),
63 63
                 $member->Email,
64 64
                 null,
65 65
                 $this
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         if (!empty($data['samaccountname'])) {
69 69
             $usernameField = TextField::create(
70 70
                 'Username',
71
-                _t(__CLASS__ . '.USERNAME', 'Username'),
71
+                _t(__CLASS__.'.USERNAME', 'Username'),
72 72
                 $data['samaccountname'],
73 73
                 null,
74 74
                 $this
Please login to merge, or discard this patch.
src/Model/LDAPUtil.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
         for ($k = 1; $k <= 2; ++$k) {
43 43
             $hex_guid_to_guid_str .= substr($hex_guid, 16 - 2 * $k, 2);
44 44
         }
45
-        $hex_guid_to_guid_str .= '-' . substr($hex_guid, 16, 4);
46
-        $hex_guid_to_guid_str .= '-' . substr($hex_guid, 20);
45
+        $hex_guid_to_guid_str .= '-'.substr($hex_guid, 16, 4);
46
+        $hex_guid_to_guid_str .= '-'.substr($hex_guid, 20);
47 47
 
48 48
         return strtoupper($hex_guid_to_guid_str);
49 49
     }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
         if ($escape) {
71 71
             $escaped = '\\';
72
-            for ($i = 0; $i < strlen($octet_str); $i+=2) {
72
+            for ($i = 0; $i < strlen($octet_str); $i += 2) {
73 73
                 $escaped .= substr($octet_str, $i, 2);
74 74
                 if ($i != strlen($octet_str) - 2) {
75 75
                     $escaped .= '\\';
@@ -95,11 +95,11 @@  discard block
 block discarded – undo
95 95
 
96 96
         for ($x = 0; $x < $subcount; $x++) {
97 97
             $subauth[$x] = hexdec(self::little_endian(substr($hex_sid, 16 + ($x * 8), 8)));
98
-            $result .= '-' . $subauth[$x];
98
+            $result .= '-'.$subauth[$x];
99 99
         }
100 100
 
101 101
         // Cheat by tacking on the S-
102
-        return 'S-' . $result;
102
+        return 'S-'.$result;
103 103
     }
104 104
 
105 105
     /**
Please login to merge, or discard this patch.
src/Jobs/LDAPAllSyncJob.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
      */
47 47
     public function getTitle()
48 48
     {
49
-        return _t(__CLASS__ . '.SYNCTITLE', 'Sync all groups and users from Active Directory, and set mappings up.');
49
+        return _t(__CLASS__.'.SYNCTITLE', 'Sync all groups and users from Active Directory, and set mappings up.');
50 50
     }
51 51
 
52 52
     /**
Please login to merge, or discard this patch.
src/Jobs/LDAPMemberSyncJob.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
      */
46 46
     public function getTitle()
47 47
     {
48
-        return _t(__CLASS__ . '.SYNCTITLE', 'Sync all users from Active Directory');
48
+        return _t(__CLASS__.'.SYNCTITLE', 'Sync all users from Active Directory');
49 49
     }
50 50
 
51 51
     /**
Please login to merge, or discard this patch.
src/Tasks/LDAPGroupSyncTask.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      * @var array
27 27
      */
28 28
     private static $dependencies = [
29
-        'ldapService' => '%$' . LDAPService::class,
29
+        'ldapService' => '%$'.LDAPService::class,
30 30
     ];
31 31
 
32 32
     /**
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
      */
44 44
     public function getTitle()
45 45
     {
46
-        return _t(__CLASS__ . '.SYNCTITLE', 'Sync all groups from LDAP');
46
+        return _t(__CLASS__.'.SYNCTITLE', 'Sync all groups from LDAP');
47 47
     }
48 48
 
49 49
     /**
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
      */
149 149
     protected function log($message)
150 150
     {
151
-        $message = sprintf('[%s] ', date('Y-m-d H:i:s')) . $message;
152
-        echo Director::is_cli() ? ($message . PHP_EOL) : ($message . '<br>');
151
+        $message = sprintf('[%s] ', date('Y-m-d H:i:s')).$message;
152
+        echo Director::is_cli() ? ($message.PHP_EOL) : ($message.'<br>');
153 153
     }
154 154
 }
Please login to merge, or discard this patch.
src/Tasks/LDAPMigrateExistingMembersTask.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
      * @var array
28 28
      */
29 29
     private static $dependencies = [
30
-        'ldapService' => '%$' . LDAPService::class,
30
+        'ldapService' => '%$'.LDAPService::class,
31 31
     ];
32 32
 
33 33
     /**
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
      */
36 36
     public function getTitle()
37 37
     {
38
-        return _t(__CLASS__ . '.TITLE', 'Migrate existing members in SilverStripe into LDAP members');
38
+        return _t(__CLASS__.'.TITLE', 'Migrate existing members in SilverStripe into LDAP members');
39 39
     }
40 40
 
41 41
     /**
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
      */
89 89
     protected function log($message)
90 90
     {
91
-        $message = sprintf('[%s] ', date('Y-m-d H:i:s')) . $message;
92
-        echo Director::is_cli() ? ($message . PHP_EOL) : ($message . '<br>');
91
+        $message = sprintf('[%s] ', date('Y-m-d H:i:s')).$message;
92
+        echo Director::is_cli() ? ($message.PHP_EOL) : ($message.'<br>');
93 93
     }
94 94
 }
Please login to merge, or discard this patch.