Skip to content

Commit 6312a8c

Browse files
committed
style: apply wdes/coding-standard
1 parent b573fd2 commit 6312a8c

File tree

8 files changed

+851
-770
lines changed

8 files changed

+851
-770
lines changed

src/Registration.php

Lines changed: 72 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,72 @@
1-
<?php
2-
3-
namespace CodeLts\U2F\U2FServer;
4-
5-
6-
class Registration
7-
{
8-
/** The key handle of the registered authenticator */
9-
protected $keyHandle;
10-
11-
/** The public key of the registered authenticator */
12-
protected $publicKey;
13-
14-
/** The attestation certificate of the registered authenticator */
15-
protected $certificate;
16-
17-
/** The counter associated with this registration */
18-
protected $counter = -1;
19-
20-
/**
21-
* @param string $keyHandle
22-
*/
23-
public function setKeyHandle($keyHandle)
24-
{
25-
$this->keyHandle = $keyHandle;
26-
}
27-
28-
/**
29-
* @param string $publicKey
30-
*/
31-
public function setPublicKey($publicKey)
32-
{
33-
$this->publicKey = $publicKey;
34-
}
35-
36-
/**
37-
* @param string $certificate
38-
*/
39-
public function setCertificate($certificate)
40-
{
41-
$this->certificate = $certificate;
42-
}
43-
44-
/**
45-
* @return string
46-
*/
47-
public function getKeyHandle()
48-
{
49-
return $this->keyHandle;
50-
}
51-
52-
/**
53-
* @return string
54-
*/
55-
public function getPublicKey()
56-
{
57-
return $this->publicKey;
58-
}
59-
60-
/**
61-
* @return string
62-
*/
63-
public function getCertificate()
64-
{
65-
return $this->certificate;
66-
}
67-
68-
/**
69-
* @return string
70-
*/
71-
public function getCounter()
72-
{
73-
return $this->counter;
74-
}
75-
}
1+
<?php
2+
3+
namespace CodeLts\U2F\U2FServer;
4+
5+
class Registration
6+
{
7+
/** The key handle of the registered authenticator */
8+
protected $keyHandle;
9+
/** The public key of the registered authenticator */
10+
protected $publicKey;
11+
/** The attestation certificate of the registered authenticator */
12+
protected $certificate;
13+
/** The counter associated with this registration */
14+
protected $counter = -1;
15+
16+
/**
17+
* @param string $keyHandle
18+
*/
19+
public function setKeyHandle($keyHandle)
20+
{
21+
$this->keyHandle = $keyHandle;
22+
}
23+
24+
/**
25+
* @param string $publicKey
26+
*/
27+
public function setPublicKey($publicKey)
28+
{
29+
$this->publicKey = $publicKey;
30+
}
31+
32+
/**
33+
* @param string $certificate
34+
*/
35+
public function setCertificate($certificate)
36+
{
37+
$this->certificate = $certificate;
38+
}
39+
40+
/**
41+
* @return string
42+
*/
43+
public function getKeyHandle()
44+
{
45+
return $this->keyHandle;
46+
}
47+
48+
/**
49+
* @return string
50+
*/
51+
public function getPublicKey()
52+
{
53+
return $this->publicKey;
54+
}
55+
56+
/**
57+
* @return string
58+
*/
59+
public function getCertificate()
60+
{
61+
return $this->certificate;
62+
}
63+
64+
/**
65+
* @return string
66+
*/
67+
public function getCounter()
68+
{
69+
return $this->counter;
70+
}
71+
72+
}

src/RegistrationRequest.php

Lines changed: 58 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,58 @@
1-
<?php
2-
3-
namespace CodeLts\U2F\U2FServer;
4-
5-
6-
class RegistrationRequest implements \JsonSerializable
7-
{
8-
/** Protocol version */
9-
protected $version = U2FServer::VERSION;
10-
11-
/** Registration challenge */
12-
protected $challenge;
13-
14-
/** Application id */
15-
protected $appId;
16-
17-
/**
18-
* @param string $challenge
19-
* @param string $appId
20-
*/
21-
public function __construct($challenge, $appId)
22-
{
23-
$this->challenge = $challenge;
24-
$this->appId = $appId;
25-
}
26-
27-
public function version()
28-
{
29-
return $this->version;
30-
}
31-
32-
public function challenge()
33-
{
34-
return $this->challenge;
35-
}
36-
37-
public function appId()
38-
{
39-
return $this->appId;
40-
}
41-
42-
#[\ReturnTypeWillChange]
43-
public function jsonSerialize()
44-
{
45-
return [
46-
'version' => $this->version,
47-
'challenge' => $this->challenge,
48-
'appId' => $this->appId,
49-
];
50-
}
51-
52-
}
1+
<?php
2+
3+
namespace CodeLts\U2F\U2FServer;
4+
5+
class RegistrationRequest implements \JsonSerializable
6+
{
7+
/** @var string Protocol version */
8+
protected $version = U2FServer::VERSION;
9+
/** @var string Registration challenge */
10+
protected $challenge;
11+
/** @var string Application id */
12+
protected $appId;
13+
14+
/**
15+
* @param string $challenge
16+
* @param string $appId
17+
*/
18+
public function __construct($challenge, $appId)
19+
{
20+
$this->challenge = $challenge;
21+
$this->appId = $appId;
22+
}
23+
24+
/**
25+
* @return string
26+
*/
27+
public function version()
28+
{
29+
return $this->version;
30+
}
31+
32+
/**
33+
* @return string
34+
*/
35+
public function challenge()
36+
{
37+
return $this->challenge;
38+
}
39+
40+
/**
41+
* @return string
42+
*/
43+
public function appId()
44+
{
45+
return $this->appId;
46+
}
47+
48+
#[\ReturnTypeWillChange]
49+
public function jsonSerialize()
50+
{
51+
return [
52+
'version' => $this->version,
53+
'challenge' => $this->challenge,
54+
'appId' => $this->appId,
55+
];
56+
}
57+
58+
}

src/SignRequest.php

Lines changed: 66 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,66 @@
1-
<?php
2-
3-
namespace CodeLts\U2F\U2FServer;
4-
5-
6-
class SignRequest implements \JsonSerializable
7-
{
8-
/** Protocol version */
9-
protected $version = U2FServer::VERSION;
10-
11-
/** Authentication challenge */
12-
protected $challenge;
13-
14-
/** Key handle of a registered authenticator */
15-
protected $keyHandle;
16-
17-
/** Application id */
18-
protected $appId;
19-
20-
public function __construct(array $parameters)
21-
{
22-
$this->challenge = $parameters['challenge'];
23-
$this->keyHandle = $parameters['keyHandle'];
24-
$this->appId = $parameters['appId'];
25-
}
26-
27-
/**
28-
* @return string
29-
*/
30-
public function version()
31-
{
32-
return $this->version;
33-
}
34-
35-
/**
36-
* @return string
37-
*/
38-
public function challenge()
39-
{
40-
return $this->challenge;
41-
}
42-
43-
/**
44-
* @return string
45-
*/
46-
public function keyHandle()
47-
{
48-
return $this->keyHandle;
49-
}
50-
51-
/**
52-
* @return string
53-
*/
54-
public function appId()
55-
{
56-
return $this->appId;
57-
}
58-
59-
#[\ReturnTypeWillChange]
60-
public function jsonSerialize()
61-
{
62-
return [
63-
'version' => $this->version,
64-
'challenge' => $this->challenge,
65-
'keyHandle' => $this->keyHandle,
66-
'appId' => $this->appId,
67-
];
68-
}
69-
70-
}
1+
<?php
2+
3+
namespace CodeLts\U2F\U2FServer;
4+
5+
class SignRequest implements \JsonSerializable
6+
{
7+
/** @var string Protocol version */
8+
protected $version = U2FServer::VERSION;
9+
/** @var string Authentication challenge */
10+
protected $challenge;
11+
/** @var string Key handle of a registered authenticator */
12+
protected $keyHandle;
13+
/** @var string Application id */
14+
protected $appId;
15+
16+
public function __construct(array $parameters)
17+
{
18+
$this->challenge = $parameters['challenge'];
19+
$this->keyHandle = $parameters['keyHandle'];
20+
$this->appId = $parameters['appId'];
21+
}
22+
23+
/**
24+
* @return string
25+
*/
26+
public function version()
27+
{
28+
return $this->version;
29+
}
30+
31+
/**
32+
* @return string
33+
*/
34+
public function challenge()
35+
{
36+
return $this->challenge;
37+
}
38+
39+
/**
40+
* @return string
41+
*/
42+
public function keyHandle()
43+
{
44+
return $this->keyHandle;
45+
}
46+
47+
/**
48+
* @return string
49+
*/
50+
public function appId()
51+
{
52+
return $this->appId;
53+
}
54+
55+
#[\ReturnTypeWillChange]
56+
public function jsonSerialize()
57+
{
58+
return [
59+
'version' => $this->version,
60+
'challenge' => $this->challenge,
61+
'keyHandle' => $this->keyHandle,
62+
'appId' => $this->appId,
63+
];
64+
}
65+
66+
}

0 commit comments

Comments
 (0)