Skip to content

Commit 1bf4d9c

Browse files
committed
Adopt SSP coding-style
1 parent 70893cd commit 1bf4d9c

File tree

3 files changed

+29
-16
lines changed

3 files changed

+29
-16
lines changed

src/Auth/Source/Negotiate.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,16 @@
88
use GSSAPIChannelBinding;
99
use KRB5NegotiateAuth;
1010
use SimpleSAML\Assert\Assert;
11-
use SimpleSAML\{Auth, Configuration, Error, Logger, Module, Session, Utils};
11+
use SimpleSAML\Auth;
12+
use SimpleSAML\Configuration;
13+
use SimpleSAML\Error;
14+
use SimpleSAML\Logger;
15+
use SimpleSAML\Module;
16+
use SimpleSAML\Session;
17+
use SimpleSAML\Utils;
1218
use SimpleSAML\XHTML\Template;
13-
use Symfony\Component\HttpFoundation\{IpUtils, Request};
19+
use Symfony\Component\HttpFoundation\IpUtils;
20+
use Symfony\Component\HttpFoundation\Request;
1421

1522
use function array_key_exists;
1623
use function extension_loaded;
@@ -38,6 +45,7 @@ class Negotiate extends Auth\Source
3845

3946
public const AUTHID = '\SimpleSAML\Module\negotiate\Auth\Source\Negotiate.AuthId';
4047

48+
4149
/** @var string|null */
4250
protected ?string $backend = null;
4351

@@ -155,10 +163,12 @@ public function authenticate(array &$state): void
155163

156164
try {
157165
if (version_compare(phpversion('krb5'), '1.1.6', '<')) {
158-
Logger::debug('Negotiate - authenticate(): Trying to authenticate (channel binding not available).');
166+
Logger::debug(
167+
'Negotiate - authenticate(): Trying to authenticate (channel binding not available).',
168+
);
159169
$auth = new KRB5NegotiateAuth($this->keytab, $this->spn);
160170
$reply = $this->doAuthentication($auth);
161-
} else if (empty($this->allowedCertificateHashes) && $this->enforceChannelBinding === false) {
171+
} elseif (empty($this->allowedCertificateHashes) && $this->enforceChannelBinding === false) {
162172
Logger::debug('Negotiate - authenticate(): Trying to authenticate without channel binding.');
163173
$auth = new KRB5NegotiateAuth($this->keytab, $this->spn);
164174
$reply = $this->doAuthentication($auth);

src/Controller/NegotiateController.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function setLogger(Logger $logger): void
116116
/**
117117
* Get the metadata storage handler instance.
118118
*
119-
* @return MetaDataStorageHandler
119+
* @return \SimpleSAML\Metadata\MetaDataStorageHandler
120120
*/
121121
protected function getMetadataStorageHandler(): MetaDataStorageHandler
122122
{
@@ -151,7 +151,7 @@ public function setModule(Module $module): void
151151
*
152152
* @param \Symfony\Component\HttpFoundation\Request $request
153153
* @return \SimpleSAML\XHTML\Template
154-
* @throws Exception
154+
* @throws \Exception
155155
*/
156156
public function enable(Request $request): Template
157157
{
@@ -180,7 +180,7 @@ public function enable(Request $request): Template
180180
*
181181
* @param \Symfony\Component\HttpFoundation\Request $request
182182
* @return \SimpleSAML\XHTML\Template
183-
* @throws Exception
183+
* @throws \Exception
184184
*/
185185
public function disable(Request $request): Template
186186
{
@@ -207,7 +207,7 @@ public function disable(Request $request): Template
207207
/**
208208
* Show retry
209209
*
210-
* @param Request $request The request that lead to this retry operation.
210+
* @param \Symfony\Component\HttpFoundation\Request $request The request that lead to this retry operation.
211211
* @return \SimpleSAML\HTTP\RunnableResponse
212212
* @throws \Exception
213213
* @throws \SimpleSAML\Error\BadRequest
@@ -244,7 +244,7 @@ public function retry(Request $request): RunnableResponse
244244
/**
245245
* Show fallback
246246
*
247-
* @param Request $request The request that lead to this retry operation.
247+
* @param \Symfony\Component\HttpFoundation\Request $request The request that lead to this retry operation.
248248
*
249249
* @return \SimpleSAML\HTTP\RunnableResponse
250250
* @throws \SimpleSAML\Error\BadRequest

tests/src/Controller/NegotiateControllerTest.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@
2626
final class NegotiateControllerTest extends TestCase
2727
{
2828
protected Configuration $config;
29+
2930
protected Logger $logger;
31+
3032
protected Module $module;
33+
3134
protected Session $session;
3235

3336

@@ -177,13 +180,12 @@ final public function __construct()
177180

178181

179182
/** @param array<mixed> $state */
180-
public function authenticate(array &$state): void
181183
{
182184
// stub
183185
}
184186

185187

186-
public static function getById(string $authId, ?string $type = null): ?Source
188+
public static function getById(string $authId, ?string $type = null): Source
187189
{
188190
return new static();
189191
}
@@ -279,7 +281,8 @@ public function authenticate(array &$state): void
279281
// stub
280282
}
281283

282-
public static function getById(string $authId, ?string $type = null): ?Source
284+
285+
public static function getById(string $authId, ?string $type = null): null
283286
{
284287
return null;
285288
}
@@ -316,8 +319,8 @@ public function testRetryMissingState(): void
316319

317320
/**
318321
* Test that a valid requests results in a RunnableResponse
319-
* @throws Error\BadRequest
320-
* @throws Error\NoState
322+
* @throws \SimpleSAML\Error\BadRequest
323+
* @throws \SimpleSAML\Error\NoState
321324
*/
322325
public function testBackend(): void
323326
{
@@ -349,8 +352,8 @@ public static function loadState(string $id, string $stage, bool $allowMissing =
349352

350353
/**
351354
* Test that a missing AuthState results in a BadRequest-error
352-
* @throws Error\BadRequest
353-
* @throws Error\NoState
355+
* @throws \SimpleSAML\Error\BadRequest
356+
* @throws \SimpleSAML\Error\NoState
354357
*/
355358
public function testBackendMissingState(): void
356359
{

0 commit comments

Comments
 (0)