Passed
Push — master ( 25bb9e...ffc196 )
by Tomasz
03:13
created
web/lib/admin/view/TabbedPanelsBox.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  * @author Zilvinas Vaira
11 11
  *
12 12
  */
13
-class TabbedPanelsBox implements PageElementInterface{
13
+class TabbedPanelsBox implements PageElementInterface {
14 14
 
15 15
     /**
16 16
      * 
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
      * @param integer $index
42 42
      * @return string
43 43
      */
44
-    private function composeTabId($index){
45
-        return PageElementInterface::TABS_CLASS.'-'.($index+1);
44
+    private function composeTabId($index) {
45
+        return PageElementInterface::TABS_CLASS . '-' . ($index + 1);
46 46
     }
47 47
     
48 48
     /**
@@ -50,15 +50,15 @@  discard block
 block discarded – undo
50 50
      * @param string $title
51 51
      * @param TabbedElementInterface $element
52 52
      */
53
-    public function addTabbedPanel($title, $element){
53
+    public function addTabbedPanel($title, $element) {
54 54
         $li = new CompositeTag('li');
55 55
         $a = new Tag('a');
56
-        $a->addAttribute('href', '#'.$this->composeTabId($this->index));
56
+        $a->addAttribute('href', '#' . $this->composeTabId($this->index));
57 57
         $a->addText($title);
58 58
         $li->addTag($a);
59 59
         $this->titles [$this->index] = $li;
60 60
         $this->elements [$this->index] = $element;
61
-        if($element->isActive()){
61
+        if ($element->isActive()) {
62 62
             $this->active = $this->index;
63 63
         }
64 64
         $this->index++;
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      * {@inheritDoc}
70 70
      * @see \web\lib\admin\view\PageElementInterface::render()
71 71
      */
72
-    public function render(){
72
+    public function render() {
73 73
         ?>
74 74
         <div id="<?php echo PageElementInterface::TABS_CLASS; ?>" active="<?php echo $this->active; ?>">
75 75
             <ul>
Please login to merge, or discard this patch.
web/lib/admin/http/AddUsersCommand.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
                     $userCount++;
33 33
                 }
34 34
             }else{
35
-                 $this->storeErrorMessage(sprintf(_('Username or expiry date missing for %s record!'), $userCount + 1));
35
+                    $this->storeErrorMessage(sprintf(_('Username or expiry date missing for %s record!'), $userCount + 1));
36 36
             }
37 37
         }
38 38
         if($userCount>0){
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  * @author Zilvinas Vaira
9 9
  *
10 10
  */
11
-class AddUsersCommand extends AbstractInvokerCommand{
11
+class AddUsersCommand extends AbstractInvokerCommand {
12 12
 
13 13
     const COMMAND = 'newusers';
14 14
 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
      * @param string $commandToken
24 24
      * @param SilverbulletContext $context
25 25
      */
26
-    public function __construct($commandToken, $context){
26
+    public function __construct($commandToken, $context) {
27 27
         parent::__construct($commandToken, $context);
28 28
         $this->context = $context;
29 29
     }
@@ -33,27 +33,27 @@  discard block
 block discarded – undo
33 33
      * {@inheritDoc}
34 34
      * @see \web\lib\admin\http\AbstractCommand::execute()
35 35
      */
36
-    public function execute(){
36
+    public function execute() {
37 37
         $parser = new CSVParser($_FILES[self::COMMAND], "\n", ',');
38
-        if(!$parser->isValid()){
38
+        if (!$parser->isValid()) {
39 39
             $this->storeErrorMessage(_('File either is empty or is not CSV file!'));
40 40
         }
41 41
         $userCount = 0;
42 42
         $invitationsCount = 0;
43
-        while($parser->hasMoreRows()){
43
+        while ($parser->hasMoreRows()) {
44 44
             $row = $parser->nextRow();
45
-            if(isset($row[0]) && isset($row[1])){
45
+            if (isset($row[0]) && isset($row[1])) {
46 46
                 $user = $this->context->createUser($row[0], $row[1], $this);
47 47
                 $max = empty($row[2]) ? 1 : intval($row[2]);
48
-                if(!empty($user->getIdentifier())){
48
+                if (!empty($user->getIdentifier())) {
49 49
                     $this->context->createInvitation($user, $this, $max);
50 50
                     $userCount++;
51 51
                 }
52
-            }else{
52
+            } else {
53 53
                  $this->storeErrorMessage(sprintf(_('Username or expiry date missing for %s record!'), $userCount + 1));
54 54
             }
55 55
         }
56
-        if($userCount>0){
56
+        if ($userCount > 0) {
57 57
             $this->storeInfoMessage(sprintf(_('%s total users were imported and %s invitations created!'), $userCount, $invitationsCount));
58 58
         }
59 59
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
                     $this->context->createInvitation($user, $this, $max);
50 50
                     $userCount++;
51 51
                 }
52
-            }else{
52
+            } else{
53 53
                  $this->storeErrorMessage(sprintf(_('Username or expiry date missing for %s record!'), $userCount + 1));
54 54
             }
55 55
         }
Please login to merge, or discard this patch.
web/lib/admin/view/AbstractForm.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @author Zilvinas Vaira
7 7
  *
8 8
  */
9
-abstract class AbstractForm implements TabbedElementInterface{
9
+abstract class AbstractForm implements TabbedElementInterface {
10 10
     
11 11
     /**
12 12
      * @var string
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      *
41 41
      * @return boolean
42 42
      */
43
-    public function isActive(){
43
+    public function isActive() {
44 44
         return $this->messageBox->hasMessages();
45 45
     }
46 46
 }
Please login to merge, or discard this patch.
web/lib/admin/view/AddNewUserForm.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @author Zilvinas Vaira
10 10
  *
11 11
  */
12
-class AddNewUserForm extends AbstractForm{
12
+class AddNewUserForm extends AbstractForm {
13 13
     
14 14
     const ADDNEWUSER_CLASS = 'sb-add-new-user';
15 15
     
@@ -28,11 +28,11 @@  discard block
 block discarded – undo
28 28
      * {@inheritDoc}
29 29
      * @see \web\lib\admin\view\PageElementInterface::render()
30 30
      */
31
-    public function render(){
31
+    public function render() {
32 32
         ?>
33
-        <form method="post" action="<?php echo $this->action;?>" accept-charset="utf-8">
33
+        <form method="post" action="<?php echo $this->action; ?>" accept-charset="utf-8">
34 34
             <div class="<?php echo self::ADDNEWUSER_CLASS; ?>">
35
-                <?php $this->messageBox->render();?>
35
+                <?php $this->messageBox->render(); ?>
36 36
                 <label for="<?php echo AddUserCommand::PARAM_NAME; ?>"><?php echo $this->description; ?></label>
37 37
                 <div style="margin: 5px 0px 10px 0px;">
38 38
                     <input type="text" name="<?php echo AddUserCommand::PARAM_NAME; ?>">
Please login to merge, or discard this patch.
core/User.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
                 }
185 185
                 $lookFor .= "$name";
186 186
             }
187
-            $finding = preg_match("/^(".$lookFor."):(.*)/", $oneRow->user_id, $matches);
187
+            $finding = preg_match("/^(" . $lookFor . "):(.*)/", $oneRow->user_id, $matches);
188 188
             if ($finding === 0 || $finding === FALSE) {
189 189
                 return FALSE;
190 190
             }
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
                 case $providerStrings[3]:
207 207
                 case $providerStrings[4]:
208 208
                 case $providerStrings[5]:
209
-                    if (!in_array(User::PROVIDER_STRINGS[$matches[1]],$listOfProviders)) {
209
+                    if (!in_array(User::PROVIDER_STRINGS[$matches[1]], $listOfProviders)) {
210 210
                         $listOfProviders[] = User::PROVIDER_STRINGS[$matches[1]];
211 211
                     }
212 212
                     break;
Please login to merge, or discard this patch.
web/lib/common/InputValidation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@
 block discarded – undo
134 134
      */
135 135
     public function string($input, $allowWhitespace = FALSE) {
136 136
     // always chop out invalid characters, and surrounding whitespace
137
-    $retvalStep0 =  iconv("UTF-8", "UTF-8//TRANSLIT", $input);
137
+    $retvalStep0 = iconv("UTF-8", "UTF-8//TRANSLIT", $input);
138 138
     if ($retvalStep0 === FALSE) {
139 139
         throw new Exception("iconv failure for string sanitisation. With TRANSLIT, this should never happen!");
140 140
     }
Please login to merge, or discard this patch.
utils/cleanup.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         if (isset($Cache[$entry])) {
42 42
             continue;
43 43
         }
44
-       \core\common\Entity::rrmdir($downloads . '/' . $entry);
44
+        \core\common\Entity::rrmdir($downloads . '/' . $entry);
45 45
         print "$entry\n";
46 46
     }
47 47
     closedir($handle);
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         if ($ftime < 3600) {
57 57
             continue;
58 58
         }
59
-       \core\common\Entity::rrmdir($downloads . '/' . $entry);
59
+        \core\common\Entity::rrmdir($downloads . '/' . $entry);
60 60
         print "$entry\n";
61 61
     }
62 62
     closedir($handle);
Please login to merge, or discard this patch.
devices/linux/Device_Linux.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
             $outString .= "# save user certificate\n";
66 66
             $outString .= 'echo "';
67 67
             $outString .= base64_encode($this->clientCert["certdata"])
68
-               . '" | base64 -d ' . " > \$HOME/$this->localDir/user.p12\n";
68
+                . '" | base64 -d ' . " > \$HOME/$this->localDir/user.p12\n";
69 69
         }
70 70
         if ($this->selectedEap == \core\common\EAP::EAPTYPE_TLS || $this->selectedEap == \core\common\EAP::EAPTYPE_SILVERBULLET) {
71 71
             $outString .= $this->printP12Dialog();
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -184,8 +184,8 @@  discard block
 block discarded – undo
184 184
 # will be the default value prompted to the user
185 185
 
186 186
     private function printFunctions() {
187
-        $url = (isset($this->attributes['support:url'][0]) && $this->attributes['support:url'][0] ) ? $this->attributes['support:url'][0] : $this->support_url_substitute;
188
-        $support = (isset($this->attributes['support:email'][0]) && $this->attributes['support:email'][0] ) ? $this->attributes['support:email'][0] : $this->support_email_substitute;
187
+        $url = (isset($this->attributes['support:url'][0]) && $this->attributes['support:url'][0]) ? $this->attributes['support:url'][0] : $this->support_url_substitute;
188
+        $support = (isset($this->attributes['support:email'][0]) && $this->attributes['support:email'][0]) ? $this->attributes['support:email'][0] : $this->support_email_substitute;
189 189
         $out = '
190 190
 my_name=$0
191 191
 
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
 ';
481 481
 }
482 482
     $cert_prompt = $this->selectedEap == \core\common\EAP::EAPTYPE_TLS ? _("enter the password for the certificate file") : _("enter your import password");
483
-    $out .=  '   cert=$HOME/' . $this->localDir . '/user.p12
483
+    $out .= '   cert=$HOME/' . $this->localDir . '/user.p12
484 484
 
485 485
     PASSWORD=""
486 486
     prompt="' . $cert_prompt . '"
Please login to merge, or discard this patch.
devices/redirect_dev/Device_RedirectDev.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -11,15 +11,15 @@
 block discarded – undo
11 11
 namespace devices\redirect_dev;
12 12
 
13 13
 class Device_RedirectDev extends \core\DeviceConfig {
14
-   /**
15
-    * Constructs a Device object.
16
-    *
17
-    * @final not to be redefined
18
-    */
14
+    /**
15
+     * Constructs a Device object.
16
+     *
17
+     * @final not to be redefined
18
+     */
19 19
     final public function __construct() {
20 20
         parent::__construct();
21
-      $this->setSupportedEapMethods([\core\common\EAP::EAPTYPE_NONE]);
22
-      $this->loggerInstance->debug(4,"RedirectEx called");
21
+        $this->setSupportedEapMethods([\core\common\EAP::EAPTYPE_NONE]);
22
+        $this->loggerInstance->debug(4,"RedirectEx called");
23 23
     }
24 24
     public function writeDeviceInfo() {
25 25
         $out = "<p>";
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
     final public function __construct() {
20 20
         parent::__construct();
21 21
       $this->setSupportedEapMethods([\core\common\EAP::EAPTYPE_NONE]);
22
-      $this->loggerInstance->debug(4,"RedirectEx called");
22
+      $this->loggerInstance->debug(4, "RedirectEx called");
23 23
     }
24 24
     public function writeDeviceInfo() {
25 25
         $out = "<p>";
Please login to merge, or discard this patch.