Passed
Push — master ( 24687e...3d1824 )
by Tomasz
03:18
created
web/skins/example/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
  */
10 10
 ?>
11 11
 <h1>Example Skin (main user frontpage)</h1>
12
-<img src="<?php echo $Gui->skinObject->findresourceUrl("IMAGES","consortium_logo.png");?>"/>
12
+<img src="<?php echo $Gui->skinObject->findresourceUrl("IMAGES", "consortium_logo.png"); ?>"/>
13 13
 <p>This skin is much more sober and less bloated than the default one. As it happens, it also doesn't do anything.</p>
14 14
 <p>But at least it goes to show that it's possible to include custom images/CSS/external software using findResourceUrl(..., $filename):
15
-<img src="<?php echo $Gui->skinObject->findresourceUrl("IMAGES","custom.png");?>"/>
15
+<img src="<?php echo $Gui->skinObject->findresourceUrl("IMAGES", "custom.png"); ?>"/>
Please login to merge, or discard this patch.
web/skins/example/accountstatus.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,12 +8,12 @@
 block discarded – undo
8 8
  *******************************************************************************
9 9
  */
10 10
 ?>
11
-<h1>Example Skin (Pick-Up and Status page for <?php echo \core\ProfileSilverbullet::PRODUCTNAME;?>)</h1>
12
-<img src="<?php echo $Gui->skinObject->findresourceUrl("IMAGES","consortium_logo.png");?>"/>
11
+<h1>Example Skin (Pick-Up and Status page for <?php echo \core\ProfileSilverbullet::PRODUCTNAME; ?>)</h1>
12
+<img src="<?php echo $Gui->skinObject->findresourceUrl("IMAGES", "consortium_logo.png"); ?>"/>
13 13
 <p>This skin is much more sober and less bloated than the default one. As it happens, it also doesn't do anything.</p>
14 14
 <p>But at least it goes to show that it's possible to include custom images/CSS/external software using findResourceUrl(..., $filename):
15
-<img src="<?php echo $Gui->skinObject->findresourceUrl("IMAGES","custom.png");?>"/>
16
-<p>For <?php echo \core\ProfileSilverbullet::PRODUCTNAME;?>, this page can make use of the request status info we have collected prior to invocation of the skinned page:</p>
15
+<img src="<?php echo $Gui->skinObject->findresourceUrl("IMAGES", "custom.png"); ?>"/>
16
+<p>For <?php echo \core\ProfileSilverbullet::PRODUCTNAME; ?>, this page can make use of the request status info we have collected prior to invocation of the skinned page:</p>
17 17
 <pre>
18
-    <?php print_r($statusInfo);?>
18
+    <?php print_r($statusInfo); ?>
19 19
 </pre>
20 20
\ No newline at end of file
Please login to merge, or discard this patch.
tests/unit/web/lib/admin/domain/SilverbulletCertificateTest.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     
41 41
     private $faultyUser = null;
42 42
     
43
-    protected function setUp(){
43
+    protected function setUp() {
44 44
         $this->profile = new MockProfileSilverbullet(\core\DBConnection::handle('INST'));
45 45
         $this->profileId = $this->profile->identifier;
46 46
         
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
         $list = SilverbulletCertificate::getList($this->newUser);
71 71
         $found = false;
72 72
         foreach ($list as $certificate) {
73
-            if($certificate->getIdentifier() == $this->newCertificate->getIdentifier()){
73
+            if ($certificate->getIdentifier() == $this->newCertificate->getIdentifier()) {
74 74
                 $found = true;
75 75
                 break;
76 76
             }
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
         $this->assertTrue($result);
90 90
     }
91 91
     
92
-    public function testNewCertificateFailure(){
92
+    public function testNewCertificateFailure() {
93 93
         $this->faultyCertificate->save();
94 94
         $this->assertEmpty($this->faultyCertificate->getIdentifier());
95 95
         
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         $list = SilverbulletCertificate::getList($this->faultyUser);
100 100
         $found = false;
101 101
         foreach ($list as $certificate) {
102
-            if($certificate->getIdentifier() == $this->faultyCertificate->getIdentifier()){
102
+            if ($certificate->getIdentifier() == $this->faultyCertificate->getIdentifier()) {
103 103
                 $found = true;
104 104
                 break;
105 105
             }
@@ -107,12 +107,12 @@  discard block
 block discarded – undo
107 107
         $this->assertFalse($found);
108 108
     }
109 109
     
110
-    public function testFaultyCertificateLoadFailure(){
110
+    public function testFaultyCertificateLoadFailure() {
111 111
         $this->faultyCertificate->load();
112 112
         $this->assertEmpty($this->faultyCertificate->getIdentifier());
113 113
     }
114 114
     
115
-    public function testSetRevoked(){
115
+    public function testSetRevoked() {
116 116
         $this->newCertificate->save();
117 117
         $this->assertNotEmpty($this->newCertificate->getIdentifier());
118 118
         
@@ -136,9 +136,9 @@  discard block
 block discarded – undo
136 136
         $this->assertEquals(SilverbulletCertificate::NOT_REVOKED, $existingCertificate->get(SilverbulletCertificate::REVOCATION_STATUS));
137 137
     }
138 138
     
139
-    protected function tearDown(){
139
+    protected function tearDown() {
140 140
         $this->newUser->delete();
141
-        if(!empty($this->faultyCertificate)){
141
+        if (!empty($this->faultyCertificate)) {
142 142
             $this->faultyCertificate->delete();
143 143
         }
144 144
         $this->profile->delete();
Please login to merge, or discard this patch.
tests/unit/web/lib/admin/utils/CSVParserTest.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -2,19 +2,19 @@  discard block
 block discarded – undo
2 2
 
3 3
 use web\lib\admin\utils\CSVParser;
4 4
 
5
-class MockCSVParser extends CSVParser{
5
+class MockCSVParser extends CSVParser {
6 6
     
7 7
     public function __construct($fileData, $rowDelimiter, $tokenDelimiter) {
8 8
         $this->rowDelimiter = $rowDelimiter;
9 9
         $this->tokenDelimiter = $tokenDelimiter;
10
-        if($this->validate($fileData)){
10
+        if ($this->validate($fileData)) {
11 11
             $this->rows = str_getcsv($fileData['contents'], $this->rowDelimiter);
12 12
         }
13 13
     }
14 14
     
15 15
 }
16 16
 
17
-class CSVParserTest extends PHPUnit_Framework_TestCase{
17
+class CSVParserTest extends PHPUnit_Framework_TestCase {
18 18
     
19 19
     private $rowDelimiter = "\n", $tokenDelimiter = ",";
20 20
     
@@ -52,15 +52,15 @@  discard block
 block discarded – undo
52 52
             'contents' => ""
53 53
     );
54 54
     
55
-    protected function setUp(){
56
-        $this->successFileData['contents'] = "testuser1,".date('Y-m-d',strtotime("+1 month")).",2
57
-                           testuser2,".date('Y-m-d',strtotime("+2 month")).",
58
-                           testuser3,".date('Y-m-d',strtotime("+1 month")).",1
59
-                           testuser4,".date('Y-m-d',strtotime("+3 month")).",
60
-                           testuser5,".date('Y-m-d',strtotime("+1 month")).",3";
55
+    protected function setUp() {
56
+        $this->successFileData['contents'] = "testuser1," . date('Y-m-d', strtotime("+1 month")) . ",2
57
+                           testuser2,".date('Y-m-d', strtotime("+2 month")) . ",
58
+                           testuser3,".date('Y-m-d', strtotime("+1 month")) . ",1
59
+                           testuser4,".date('Y-m-d', strtotime("+3 month")) . ",
60
+                           testuser5,".date('Y-m-d', strtotime("+1 month")) . ",3";
61 61
     }
62 62
     
63
-    public function testIsValid(){
63
+    public function testIsValid() {
64 64
         $parser = new MockCSVParser($this->faultyFileData, $this->rowDelimiter, $this->tokenDelimiter);
65 65
         $this->assertFalse($parser->isValid());
66 66
         
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         $this->assertTrue($parser->isValid());
77 77
     }
78 78
     
79
-    public function testHasMoreRows(){
79
+    public function testHasMoreRows() {
80 80
         $parser = new MockCSVParser($this->faultyFileData, $this->rowDelimiter, $this->tokenDelimiter);
81 81
         $this->assertFalse($parser->hasMoreRows());
82 82
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         $this->assertTrue($parser->hasMoreRows());
88 88
     }
89 89
     
90
-    public function testNextRow(){
90
+    public function testNextRow() {
91 91
         $parser = new MockCSVParser($this->faultyFileData, $this->rowDelimiter, $this->tokenDelimiter);
92 92
         $this->assertCount(0, $parser->nextRow());
93 93
         
Please login to merge, or discard this patch.
tests/unit/web/lib/admin/storage/SessionStorageTest.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 use web\lib\admin\storage\SessionStorage;
3 3
 
4
-if ( !isset( $_SESSION ) ) $_SESSION = array();
4
+if (!isset($_SESSION)) $_SESSION = array();
5 5
 
6
-class SessionStorageTest extends PHPUnit_Framework_TestCase{
7
-    protected $backupGlobalsBlacklist = array( '_SESSION' );
6
+class SessionStorageTest extends PHPUnit_Framework_TestCase {
7
+    protected $backupGlobalsBlacklist = array('_SESSION');
8 8
     private $package1 = "testpackage1";
9 9
     private $package2 = "testpackage2";
10 10
     
11
-    public function testGetInstance(){
11
+    public function testGetInstance() {
12 12
         $globalSession = SessionStorage::getInstance();
13 13
         $scopedSession1 = SessionStorage::getInstance($this->package1);
14 14
         $scopedSession2 = SessionStorage::getInstance($this->package2);
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
         $this->assertNotEquals($scopedSession1, $scopedSession2);
22 22
     }
23 23
     
24
-    public function testPut(){
24
+    public function testPut() {
25 25
         $testPutGlobal = "testputglobal";
26 26
         $globalSession = SessionStorage::getInstance();
27 27
         $globalSession->put($testPutGlobal, $testPutGlobal);
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         $this->assertNotEquals($_SESSION[SessionStorage::INDEX][SessionStorage::SCOPED][$this->package1][$testPutScoped1], $_SESSION[SessionStorage::INDEX][SessionStorage::SCOPED][$this->package2][$testPutScoped2]);
42 42
     }
43 43
     
44
-    public function testGet(){
44
+    public function testGet() {
45 45
         $testGetGlobal = "testgetglobal";
46 46
         $globalSession = SessionStorage::getInstance();
47 47
         $_SESSION[SessionStorage::INDEX][SessionStorage::WIDE][$testGetGlobal] = $testGetGlobal;
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         $this->assertNotEquals($scopedSession2->get($testGetScoped2), $scopedSession1->get($testGetScoped1));
63 63
     }
64 64
     
65
-    public function testDelete(){
65
+    public function testDelete() {
66 66
         $testGetGlobal = "testgetglobal";
67 67
         $globalSession = SessionStorage::getInstance();
68 68
         $_SESSION[SessionStorage::INDEX][SessionStorage::WIDE][$testGetGlobal] = $testGetGlobal;
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 use web\lib\admin\storage\SessionStorage;
3 3
 
4
-if ( !isset( $_SESSION ) ) $_SESSION = array();
4
+if ( !isset( $_SESSION ) ) {
5
+    $_SESSION = array();
6
+}
5 7
 
6 8
 class SessionStorageTest extends PHPUnit_Framework_TestCase{
7 9
     protected $backupGlobalsBlacklist = array( '_SESSION' );
Please login to merge, or discard this patch.
tests/unit/web/lib/admin/view/html/AttributeTest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,19 +1,19 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 use web\lib\admin\view\html\Attribute;
3 3
 
4
-class AttributeTest extends \PHPUnit_Framework_TestCase{
4
+class AttributeTest extends \PHPUnit_Framework_TestCase {
5 5
     
6
-    private function validateString($attribute){
6
+    private function validateString($attribute) {
7 7
         $string = $attribute->__toString();
8 8
         $this->assertNotEmpty($string);
9 9
     
10 10
         $space = substr($string, 0, 1);
11
-        $this->assertEquals($space,' ');
11
+        $this->assertEquals($space, ' ');
12 12
     
13 13
         $spaceRemoved = substr($string, 1);
14 14
         $pair = explode('=', $spaceRemoved, 2);
15 15
     
16
-        if(count($pair)>1){
16
+        if (count($pair) > 1) {
17 17
             $this->assertTrue(strlen($pair[0]) > 0);
18 18
             $this->assertTrue(strlen($pair[1]) > 2);
19 19
             $this->assertEquals(substr_count($pair[0], '"'), 0);
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
         $this->assertEmpty($string);
33 33
     }
34 34
     
35
-    public function testValidToString(){
35
+    public function testValidToString() {
36 36
         $this->validateString(new Attribute("type", "button"));
37 37
     }
38 38
     
39
-    public function testFaultyToString(){
39
+    public function testFaultyToString() {
40 40
         $this->validateString(new Attribute("t\"ype", "b=ut\"ton"));
41 41
     }
42 42
     
Please login to merge, or discard this patch.
tests/unit/web/lib/admin/view/html/CompositeTagTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,13 +2,13 @@  discard block
 block discarded – undo
2 2
 use web\lib\admin\view\html\CompositeTag;
3 3
 use web\lib\admin\view\html\Tag;
4 4
 
5
-class CompositeTagTest extends \PHPUnit_Framework_TestCase{
5
+class CompositeTagTest extends \PHPUnit_Framework_TestCase {
6 6
     
7 7
     private $compositeTag;
8 8
     
9 9
     private $tag;
10 10
     
11
-    protected function setUp(){
11
+    protected function setUp() {
12 12
         $this->compositeTag = new CompositeTag('div');
13 13
         $this->tag = new Tag('p');
14 14
     }
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
         $this->assertTrue(in_array($this->tag, $tags));
24 24
     }
25 25
     
26
-    public function testToString(){
26
+    public function testToString() {
27 27
         $string = $this->compositeTag->__toString();
28 28
         $this->assertEquals('<div>', substr(trim($string), 0, 5));
29 29
         $this->assertEquals('</div>', substr(trim($string), -6));
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
         $this->assertEquals('<div>', substr(trim($string), 0, 5));
34 34
         $this->assertEquals('</div>', substr(trim($string), -6));
35 35
         
36
-        $string = str_replace(array('<div>','</div>'), '', $string);
36
+        $string = str_replace(array('<div>', '</div>'), '', $string);
37 37
         $this->assertEquals('<p>', substr(trim($string), 0, 3));
38 38
         $this->assertEquals('</p>', substr(trim($string), -4));
39 39
     }
Please login to merge, or discard this patch.
tests/unit/web/lib/admin/view/html/ButtonTest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 use web\lib\admin\view\html\Button;
3 3
 
4
-class ButtonTest extends \PHPUnit_Framework_TestCase{
4
+class ButtonTest extends \PHPUnit_Framework_TestCase {
5 5
     
6 6
     private $title;
7 7
     
8
-    protected function setUp(){
8
+    protected function setUp() {
9 9
         $this->title = 'Some title';
10 10
     }
11 11
     
@@ -26,10 +26,10 @@  discard block
 block discarded – undo
26 26
         $button = new Button($this->title, $type, $name, $value, $class);
27 27
         $string = $button->__toString();
28 28
     
29
-        $this->assertNotEquals(strpos($string, 'type="'.$type.'"'), false);
30
-        $this->assertNotEquals(strpos($string, 'name="'.$name.'"'), false);
31
-        $this->assertNotEquals(strpos($string, 'value="'.$value.'"'), false);
32
-        $this->assertNotEquals(strpos($string, 'class="'.$class.'"'), false);
29
+        $this->assertNotEquals(strpos($string, 'type="' . $type . '"'), false);
30
+        $this->assertNotEquals(strpos($string, 'name="' . $name . '"'), false);
31
+        $this->assertNotEquals(strpos($string, 'value="' . $value . '"'), false);
32
+        $this->assertNotEquals(strpos($string, 'class="' . $class . '"'), false);
33 33
         $this->assertNotEquals(strpos($string, $this->title), false);
34 34
     }
35 35
     
Please login to merge, or discard this patch.
web/lib/admin/http/AddUserCommand.php 2 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
             if(!empty($user->getIdentifier())){
14 14
                 $this->storeInfoMessage(_('User was added successfully!'));
15 15
             }
16
-        }else{
16
+        } else{
17 17
             $this->storeErrorMessage(_('User name or expiry parameters are missing!'));
18 18
         }
19 19
     }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -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,15 +33,15 @@  discard block
 block discarded – undo
33 33
      * {@inheritDoc}
34 34
      * @see \web\lib\admin\http\AbstractCommand::execute()
35 35
      */
36
-    public function execute(){
37
-        if(isset($_POST[self::PARAM_NAME]) && isset($_POST[self::PARAM_EXPIRY])){
36
+    public function execute() {
37
+        if (isset($_POST[self::PARAM_NAME]) && isset($_POST[self::PARAM_EXPIRY])) {
38 38
             $name = $this->parseString(filter_input(INPUT_POST, self::PARAM_NAME, FILTER_SANITIZE_STRING));
39 39
             $expiry = $this->parseString($_POST[self::PARAM_EXPIRY]);
40 40
             $user = $this->context->createUser($name, $expiry, $this);
41
-            if(!empty($user->getIdentifier())){
41
+            if (!empty($user->getIdentifier())) {
42 42
                 $this->storeInfoMessage(_('User was added successfully!'));
43 43
             }
44
-        }else{
44
+        } else {
45 45
             $this->storeErrorMessage(_('User name or expiry parameters are missing!'));
46 46
         }
47 47
     }
Please login to merge, or discard this patch.