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.
Completed
Push — master ( 99571d...fbfcab )
by Steven
03:08
created
src/HtpasswdManager/Controller/UserController.php 1 patch
Doc Comments   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 	 * Returns true if valid, of not it returns a String with information about the reason
153 153
 	 *
154 154
 	 * @param string $username        	
155
-	 * @return boolean string
155
+	 * @return string|boolean string
156 156
 	 */
157 157
 	private function isUsernameValid($username) {
158 158
 		if (strlen ( $username ) <= 2)
@@ -167,7 +167,6 @@  discard block
 block discarded – undo
167 167
 	/**
168 168
 	 * Returns true if valid, of not it returns a String with information about the reason
169 169
 	 *
170
-	 * @param string $username        	
171 170
 	 * @return boolean string
172 171
 	 */
173 172
 	private function isPasswordValid($password) {
Please login to merge, or discard this patch.
src/HtpasswdManager/Service/HtpasswdService.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -108,6 +108,9 @@
 block discarded – undo
108 108
 		return $usernameDeleted;
109 109
 	}
110 110
 
111
+	/**
112
+	 * @param string $newContent
113
+	 */
111 114
 	private function replaceHtPasswdContent($newContent) {
112 115
 		// file_put_contents ( $this->filename, $newContent );
113 116
 		$fp = fopen ( $this->filename, 'w' );
Please login to merge, or discard this patch.
src/HtpasswdManager/Test/HtpasswdServiceTest.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -140,6 +140,9 @@
 block discarded – undo
140 140
         $this->assertFalse($service->userExists('not Existant'), "User 'not Existant' should not exist");
141 141
     }
142 142
 
143
+    /**
144
+     * @param string $filename
145
+     */
143 146
     protected function getNumberOfLines($filename) {
144 147
         $cont  = file_get_contents($filename);
145 148
         $lines = explode("\n", $cont);
Please login to merge, or discard this patch.
Indentation   +108 added lines, -108 removed lines patch added patch discarded remove patch
@@ -5,153 +5,153 @@
 block discarded – undo
5 5
 
6 6
 class HtpasswdServiceTest extends \PHPUnit_Framework_TestCase {
7 7
 
8
-    protected $testDataDir;
8
+	protected $testDataDir;
9 9
 
10
-    public function setUp() {
11
-        $this->testDataDir = __DIR__ . '/TestData';
10
+	public function setUp() {
11
+		$this->testDataDir = __DIR__ . '/TestData';
12 12
 
13
-        parent::setUp();
14
-    }
13
+		parent::setUp();
14
+	}
15 15
 
16 16
 
17
-    public function testCreateFileIfNotExistant() {
18
-        $testFile = $this->testDataDir . '/notExistant';
17
+	public function testCreateFileIfNotExistant() {
18
+		$testFile = $this->testDataDir . '/notExistant';
19 19
 
20
-        if (true === file_exists($testFile)) {
21
-            unlink($testFile);
22
-        }
20
+		if (true === file_exists($testFile)) {
21
+			unlink($testFile);
22
+		}
23 23
 
24
-        $this->assertFileNotExists($testFile);
24
+		$this->assertFileNotExists($testFile);
25 25
 
26
-        $service = new HtpasswdService($testFile);
27
-        $this->assertFileExists($testFile);
26
+		$service = new HtpasswdService($testFile);
27
+		$this->assertFileExists($testFile);
28 28
 
29
-        // Cleanup
30
-        unlink($testFile);
31
-    }
29
+		// Cleanup
30
+		unlink($testFile);
31
+	}
32 32
 
33
-    public function testGetUserList_Empty() {
34
-        $testFile = $this->testDataDir . '/htaccess_UserServiceTest_empty';
33
+	public function testGetUserList_Empty() {
34
+		$testFile = $this->testDataDir . '/htaccess_UserServiceTest_empty';
35 35
 
36
-        if (true === file_exists($testFile)) {
37
-            unlink($testFile);
38
-        }
39
-        $this->assertFileNotExists($testFile);
40
-        touch($testFile);
41
-        $this->assertFileExists($testFile);
36
+		if (true === file_exists($testFile)) {
37
+			unlink($testFile);
38
+		}
39
+		$this->assertFileNotExists($testFile);
40
+		touch($testFile);
41
+		$this->assertFileExists($testFile);
42 42
 
43
-        $service = new HtpasswdService($testFile);
43
+		$service = new HtpasswdService($testFile);
44 44
 
45
-        $userList = $service->getUserList();
46
-        $this->assertEquals($expected = [ ], $userList, "UserList");
45
+		$userList = $service->getUserList();
46
+		$this->assertEquals($expected = [ ], $userList, "UserList");
47 47
 
48
-        // Cleanup
49
-        unlink($testFile);
50
-    }
48
+		// Cleanup
49
+		unlink($testFile);
50
+	}
51 51
 
52
-    public function testGetUserList_Filled() {
53
-        $testFile = $this->testDataDir . '/htaccess_UserServiceTest';
54
-        $this->assertFileExists($testFile);
52
+	public function testGetUserList_Filled() {
53
+		$testFile = $this->testDataDir . '/htaccess_UserServiceTest';
54
+		$this->assertFileExists($testFile);
55 55
 
56
-        $service = new HtpasswdService($testFile);
56
+		$service = new HtpasswdService($testFile);
57 57
 
58
-        $userList = $service->getUserList();
59
-        $this->assertEquals(
60
-            $expected = [ 'steven' => '$apr1$UF1l/6iv$tT3IJUH.QL82HAraXetNo0',
61
-                          'blub'   => '$apr1$jVosh5nC$q6KJ5EZNU6thOPETMQw8O/'
62
-            ], $userList, "UserList");
63
-    }
58
+		$userList = $service->getUserList();
59
+		$this->assertEquals(
60
+			$expected = [ 'steven' => '$apr1$UF1l/6iv$tT3IJUH.QL82HAraXetNo0',
61
+						  'blub'   => '$apr1$jVosh5nC$q6KJ5EZNU6thOPETMQw8O/'
62
+			], $userList, "UserList");
63
+	}
64 64
 
65
-    public function testAddUser() {
66
-        $testFileTemplate = $this->testDataDir . '/htaccess_UserServiceTest';
67
-        $testFile         = $this->testDataDir . '/htaccess_UserServiceTest_addUser';
68
-        $this->assertFileExists($testFileTemplate);
65
+	public function testAddUser() {
66
+		$testFileTemplate = $this->testDataDir . '/htaccess_UserServiceTest';
67
+		$testFile         = $this->testDataDir . '/htaccess_UserServiceTest_addUser';
68
+		$this->assertFileExists($testFileTemplate);
69 69
 
70
-        if (true === file_exists($testFile)) {
71
-            unlink($testFile);
72
-        }
73
-        $this->assertFileNotExists($testFile);
70
+		if (true === file_exists($testFile)) {
71
+			unlink($testFile);
72
+		}
73
+		$this->assertFileNotExists($testFile);
74 74
 
75
-        copy($testFileTemplate, $testFile);
76
-        $this->assertFileExists($testFile);
75
+		copy($testFileTemplate, $testFile);
76
+		$this->assertFileExists($testFile);
77 77
 
78
-        $service  = new HtpasswdService($testFile);
79
-        $userList = $service->getUserList();
80
-        $this->assertCount(2, $userList);
81
-        $this->assertEquals(2, $this->getNumberOfLines($testFile), "Number of Lines");
78
+		$service  = new HtpasswdService($testFile);
79
+		$userList = $service->getUserList();
80
+		$this->assertCount(2, $userList);
81
+		$this->assertEquals(2, $this->getNumberOfLines($testFile), "Number of Lines");
82 82
 
83 83
 
84
-        $service->addUser('test', 'test');
84
+		$service->addUser('test', 'test');
85 85
 
86
-        $userList = $service->getUserList();
87
-        $this->assertCount(3, $userList);
88
-        $this->assertEquals($expected = [ 'steven', 'blub', 'test' ],
89
-            array_keys($userList));
90
-        $this->assertEquals(3, $this->getNumberOfLines($testFile), "Number of Lines");
86
+		$userList = $service->getUserList();
87
+		$this->assertCount(3, $userList);
88
+		$this->assertEquals($expected = [ 'steven', 'blub', 'test' ],
89
+			array_keys($userList));
90
+		$this->assertEquals(3, $this->getNumberOfLines($testFile), "Number of Lines");
91 91
 
92 92
 
93
-        // Cleanup
94
-        unlink($testFile);
95
-    }
93
+		// Cleanup
94
+		unlink($testFile);
95
+	}
96 96
 
97 97
 
98
-    public function testdeleteUser() {
99
-        $testFileTemplate = $this->testDataDir . '/htaccess_UserServiceTest';
100
-        $testFile         = $this->testDataDir . '/htaccess_UserServiceTest_addUser';
101
-        $this->assertFileExists($testFileTemplate);
98
+	public function testdeleteUser() {
99
+		$testFileTemplate = $this->testDataDir . '/htaccess_UserServiceTest';
100
+		$testFile         = $this->testDataDir . '/htaccess_UserServiceTest_addUser';
101
+		$this->assertFileExists($testFileTemplate);
102 102
 
103
-        if (true === file_exists($testFile)) {
104
-            unlink($testFile);
105
-        }
106
-        $this->assertFileNotExists($testFile);
103
+		if (true === file_exists($testFile)) {
104
+			unlink($testFile);
105
+		}
106
+		$this->assertFileNotExists($testFile);
107 107
 
108
-        copy($testFileTemplate, $testFile);
109
-        $this->assertFileExists($testFile);
108
+		copy($testFileTemplate, $testFile);
109
+		$this->assertFileExists($testFile);
110 110
 
111
-        $service  = new HtpasswdService($testFile);
112
-        $userList = $service->getUserList();
113
-        $this->assertCount(2, $userList);
114
-        $this->assertEquals(2, $this->getNumberOfLines($testFile), "Number of Lines");
111
+		$service  = new HtpasswdService($testFile);
112
+		$userList = $service->getUserList();
113
+		$this->assertCount(2, $userList);
114
+		$this->assertEquals(2, $this->getNumberOfLines($testFile), "Number of Lines");
115 115
 
116 116
 
117
-        $service->deleteUser('steven');
118
-        $userList = $service->getUserList();
119
-        $this->assertCount(1, $userList);
120
-        $this->assertEquals($expected = [ 'blub' ],
121
-            array_keys($userList));
122
-        $this->assertEquals(1, $this->getNumberOfLines($testFile), "Number of Lines");
117
+		$service->deleteUser('steven');
118
+		$userList = $service->getUserList();
119
+		$this->assertCount(1, $userList);
120
+		$this->assertEquals($expected = [ 'blub' ],
121
+			array_keys($userList));
122
+		$this->assertEquals(1, $this->getNumberOfLines($testFile), "Number of Lines");
123 123
 
124 124
 
125
-        // Cleanup
126
-        unlink($testFile);
127
-    }
125
+		// Cleanup
126
+		unlink($testFile);
127
+	}
128 128
 
129
-    public function testUserExists() {
130
-        $testFile = $this->testDataDir . '/htaccess_UserServiceTest';
131
-        $this->assertFileExists($testFile);
129
+	public function testUserExists() {
130
+		$testFile = $this->testDataDir . '/htaccess_UserServiceTest';
131
+		$this->assertFileExists($testFile);
132 132
 
133
-        $service  = new HtpasswdService($testFile);
134
-        $userList = $service->getUserList();
133
+		$service  = new HtpasswdService($testFile);
134
+		$userList = $service->getUserList();
135 135
 
136
-        $this->assertTrue($service->userExists('steven'), 'User should exist');
137
-        $this->assertTrue($service->userExists('blub'), 'User should exist');
138
-        $this->assertFalse($service->userExists(''), "User '' should not exist");
139
-        $this->assertFalse($service->userExists('notExistant'), "User 'notExistant' should not exist");
140
-        $this->assertFalse($service->userExists('not Existant'), "User 'not Existant' should not exist");
141
-    }
136
+		$this->assertTrue($service->userExists('steven'), 'User should exist');
137
+		$this->assertTrue($service->userExists('blub'), 'User should exist');
138
+		$this->assertFalse($service->userExists(''), "User '' should not exist");
139
+		$this->assertFalse($service->userExists('notExistant'), "User 'notExistant' should not exist");
140
+		$this->assertFalse($service->userExists('not Existant'), "User 'not Existant' should not exist");
141
+	}
142 142
 
143
-    protected function getNumberOfLines($filename) {
144
-        $cont  = file_get_contents($filename);
145
-        $lines = explode("\n", $cont);
143
+	protected function getNumberOfLines($filename) {
144
+		$cont  = file_get_contents($filename);
145
+		$lines = explode("\n", $cont);
146 146
 
147
-        // Remove emtpy lines
148
-        foreach ($lines as $i => $line) {
149
-            if (empty(trim($line))) {
150
-                unset($lines[$i]);
151
-            }
152
-        }
147
+		// Remove emtpy lines
148
+		foreach ($lines as $i => $line) {
149
+			if (empty(trim($line))) {
150
+				unset($lines[$i]);
151
+			}
152
+		}
153 153
 
154
-        return count($lines);
155
-    }
154
+		return count($lines);
155
+	}
156 156
 
157 157
 }
158 158
\ No newline at end of file
Please login to merge, or discard this patch.
src/HtpasswdManager/Test/Bootstrap/Bootstrap.php 1 patch
Indentation   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -12,48 +12,48 @@
 block discarded – undo
12 12
  * Test bootstrap, for setting up autoloading
13 13
  */
14 14
 class Bootstrap {
15
-    protected static $serviceManager;
16
-
17
-    public static function init() {
18
-        static::initAutoloader();
19
-    }
20
-
21
-    protected static function initAutoloader() {
22
-        $vendorPath = static::findParentPath('vendor');
23
-
24
-        if (file_exists($vendorPath . '/autoload.php')) {
25
-            include $vendorPath . '/autoload.php';
26
-        }
27
-
28
-        if (!class_exists('Zend\Loader\AutoloaderFactory')) {
29
-            throw new RuntimeException(
30
-                'Unable to load ZF2. Run `php composer.phar install`'
31
-            );
32
-        }
33
-
34
-        AutoloaderFactory::factory(array(
35
-            'Zend\Loader\StandardAutoloader' => array(
36
-                'autoregister_zf' => true,
37
-                'namespaces'      => array(
38
-                    __NAMESPACE__ => __DIR__ . '/' . __NAMESPACE__,
39
-                ),
40
-            ),
41
-        ));
42
-    }
43
-
44
-    protected static function findParentPath($path) {
45
-        $dir         = __DIR__;
46
-        $previousDir = '.';
47
-        while (!is_dir($dir . '/' . $path)) {
48
-            $dir = dirname($dir);
49
-            if ($previousDir === $dir) {
50
-                return false;
51
-            }
52
-            $previousDir = $dir;
53
-        }
54
-
55
-        return $dir . '/' . $path;
56
-    }
15
+	protected static $serviceManager;
16
+
17
+	public static function init() {
18
+		static::initAutoloader();
19
+	}
20
+
21
+	protected static function initAutoloader() {
22
+		$vendorPath = static::findParentPath('vendor');
23
+
24
+		if (file_exists($vendorPath . '/autoload.php')) {
25
+			include $vendorPath . '/autoload.php';
26
+		}
27
+
28
+		if (!class_exists('Zend\Loader\AutoloaderFactory')) {
29
+			throw new RuntimeException(
30
+				'Unable to load ZF2. Run `php composer.phar install`'
31
+			);
32
+		}
33
+
34
+		AutoloaderFactory::factory(array(
35
+			'Zend\Loader\StandardAutoloader' => array(
36
+				'autoregister_zf' => true,
37
+				'namespaces'      => array(
38
+					__NAMESPACE__ => __DIR__ . '/' . __NAMESPACE__,
39
+				),
40
+			),
41
+		));
42
+	}
43
+
44
+	protected static function findParentPath($path) {
45
+		$dir         = __DIR__;
46
+		$previousDir = '.';
47
+		while (!is_dir($dir . '/' . $path)) {
48
+			$dir = dirname($dir);
49
+			if ($previousDir === $dir) {
50
+				return false;
51
+			}
52
+			$previousDir = $dir;
53
+		}
54
+
55
+		return $dir . '/' . $path;
56
+	}
57 57
 }
58 58
 
59 59
 Bootstrap::init();
60 60
\ No newline at end of file
Please login to merge, or discard this patch.