Passed
Push — main ( 51cb4d...02435f )
by smiley
10:59
created
src/OAuthOptionsTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 /**
14 14
  * The settings for the OAuth provider
15 15
  */
16
-trait OAuthOptionsTrait{
16
+trait OAuthOptionsTrait {
17 17
 
18 18
 	/**
19 19
 	 * The application key (or id) given by your provider
Please login to merge, or discard this patch.
src/Storage/OAuthStorageInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
 /**
17 17
  * Specifies the methods required for an OAuth storage adapter
18 18
  */
19
-interface OAuthStorageInterface extends LoggerAwareInterface{
19
+interface OAuthStorageInterface extends LoggerAwareInterface {
20 20
 
21 21
 	/**
22 22
 	 * Stores an AccessToken for the given $service
Please login to merge, or discard this patch.
src/Storage/MemoryStorage.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 /**
18 18
  * Implements a memory storage adapter. Memory storage is not persistent as tokens are only stored during script runtime.
19 19
  */
20
-class MemoryStorage extends OAuthStorageAbstract{
20
+class MemoryStorage extends OAuthStorageAbstract {
21 21
 
22 22
 	/**
23 23
 	 * the token storage array
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 */
44 44
 	public function getAccessToken(string $service):AccessToken{
45 45
 
46
-		if($this->hasAccessToken($service)){
46
+		if ($this->hasAccessToken($service)) {
47 47
 			return $this->tokens[$service];
48 48
 		}
49 49
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	 */
63 63
 	public function clearAccessToken(string $service):bool{
64 64
 
65
-		if(array_key_exists($service, $this->tokens)){
65
+		if (array_key_exists($service, $this->tokens)) {
66 66
 			unset($this->tokens[$service]);
67 67
 		}
68 68
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 	 */
75 75
 	public function clearAllAccessTokens():bool{
76 76
 
77
-		foreach(array_keys($this->tokens) as $service){
77
+		foreach (array_keys($this->tokens) as $service) {
78 78
 			unset($this->tokens[$service]);
79 79
 		}
80 80
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 	 */
98 98
 	public function getCSRFState(string $service):string{
99 99
 
100
-		if($this->hasCSRFState($service)){
100
+		if ($this->hasCSRFState($service)) {
101 101
 			return $this->states[$service];
102 102
 		}
103 103
 
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 	 */
117 117
 	public function clearCSRFState(string $service):bool{
118 118
 
119
-		if(array_key_exists($service, $this->states)){
119
+		if (array_key_exists($service, $this->states)) {
120 120
 			unset($this->states[$service]);
121 121
 		}
122 122
 
Please login to merge, or discard this patch.
src/Storage/OAuthStorageAbstract.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 /**
20 20
  * Implements ab anstract OAuth storage adapter
21 21
  */
22
-abstract class OAuthStorageAbstract implements OAuthStorageInterface{
22
+abstract class OAuthStorageAbstract implements OAuthStorageInterface {
23 23
 	use LoggerAwareTrait;
24 24
 
25 25
 	/**
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	 * @param \chillerlan\Settings\SettingsContainerInterface|null $options
34 34
 	 * @param \Psr\Log\LoggerInterface|null                        $logger
35 35
 	 */
36
-	public function __construct(SettingsContainerInterface $options = null, LoggerInterface $logger = null){
36
+	public function __construct(SettingsContainerInterface $options = null, LoggerInterface $logger = null) {
37 37
 		$this->options = $options ?? new OAuthOptions;
38 38
 
39 39
 		$this->setLogger($logger ?? new NullLogger);
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	 */
54 54
 	public function fromStorage($data):AccessToken{
55 55
 
56
-		if(!is_string($data)){
56
+		if (!is_string($data)) {
57 57
 			throw new OAuthStorageException('invalid data');
58 58
 		}
59 59
 
Please login to merge, or discard this patch.
src/Storage/SessionStorage.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 /**
21 21
  * Implements a session storage adapter. Session storage is half persistent as tokens are stored for the duration of the session.
22 22
  */
23
-class SessionStorage extends OAuthStorageAbstract{
23
+class SessionStorage extends OAuthStorageAbstract {
24 24
 
25 25
 	/**
26 26
 	 * the key name for the token storage array in $_SESSION
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	 *
38 38
 	 * @param \chillerlan\Settings\SettingsContainerInterface|null $options
39 39
 	 */
40
-	public function __construct(SettingsContainerInterface $options = null){
40
+	public function __construct(SettingsContainerInterface $options = null) {
41 41
 		parent::__construct($options);
42 42
 
43 43
 		$this->tokenVar = $this->options->sessionTokenVar;
@@ -45,15 +45,15 @@  discard block
 block discarded – undo
45 45
 
46 46
 		// Determine if the session has started.
47 47
 		// @link http://stackoverflow.com/a/18542272/1470961
48
-		if($this->options->sessionStart && !(session_status() !== PHP_SESSION_NONE)){
48
+		if ($this->options->sessionStart && !(session_status() !== PHP_SESSION_NONE)) {
49 49
 			session_start();
50 50
 		}
51 51
 
52
-		if(!isset($_SESSION[$this->tokenVar])){
52
+		if (!isset($_SESSION[$this->tokenVar])) {
53 53
 			$_SESSION[$this->tokenVar] = [];
54 54
 		}
55 55
 
56
-		if(!isset($_SESSION[$this->stateVar])){
56
+		if (!isset($_SESSION[$this->stateVar])) {
57 57
 			$_SESSION[$this->stateVar] = [];
58 58
 		}
59 59
 
@@ -64,8 +64,8 @@  discard block
 block discarded – undo
64 64
 	 *
65 65
 	 * @codeCoverageIgnore
66 66
 	 */
67
-	public function __destruct(){
68
-		if($this->options->sessionStart){
67
+	public function __destruct() {
68
+		if ($this->options->sessionStart) {
69 69
 			session_write_close();
70 70
 		}
71 71
 	}
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	 */
85 85
 	public function getAccessToken(string $service):AccessToken{
86 86
 
87
-		if($this->hasAccessToken($service)){
87
+		if ($this->hasAccessToken($service)) {
88 88
 			return $this->fromStorage($_SESSION[$this->tokenVar][$service]);
89 89
 		}
90 90
 
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 	 */
104 104
 	public function clearAccessToken(string $service):bool{
105 105
 
106
-		if(array_key_exists($service, $_SESSION[$this->tokenVar])){
106
+		if (array_key_exists($service, $_SESSION[$this->tokenVar])) {
107 107
 			unset($_SESSION[$this->tokenVar][$service]);
108 108
 		}
109 109
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 	 */
116 116
 	public function clearAllAccessTokens():bool{
117 117
 
118
-		foreach(array_keys($_SESSION[$this->tokenVar]) as $service){
118
+		foreach (array_keys($_SESSION[$this->tokenVar]) as $service) {
119 119
 			unset($_SESSION[$this->tokenVar][$service]);
120 120
 		}
121 121
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 	 */
139 139
 	public function getCSRFState(string $service):string{
140 140
 
141
-		if($this->hasCSRFState($service)){
141
+		if ($this->hasCSRFState($service)) {
142 142
 			return $_SESSION[$this->stateVar][$service];
143 143
 		}
144 144
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 */
158 158
 	public function clearCSRFState(string $service):bool{
159 159
 
160
-		if(array_key_exists($service, $_SESSION[$this->stateVar])){
160
+		if (array_key_exists($service, $_SESSION[$this->stateVar])) {
161 161
 			unset($_SESSION[$this->stateVar][$service]);
162 162
 		}
163 163
 
Please login to merge, or discard this patch.
src/Core/TokenRefresh.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
  *
16 16
  * @link https://tools.ietf.org/html/rfc6749#section-10.4
17 17
  */
18
-interface TokenRefresh{
18
+interface TokenRefresh {
19 19
 
20 20
 	/**
21 21
 	 * Tries to refresh an existing AccessToken with an associated refresh token and returns a fresh AccessToken.
Please login to merge, or discard this patch.
src/Core/ClientCredentials.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
  *
16 16
  * @link https://tools.ietf.org/html/rfc6749#section-4.4
17 17
  */
18
-interface ClientCredentials{
18
+interface ClientCredentials {
19 19
 
20 20
 	/**
21 21
 	 * Obtains an OAuth2 client credentials token and returns an AccessToken
Please login to merge, or discard this patch.
src/Core/OAuth1Interface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 /**
14 14
  * Specifies the basic methods for an OAuth1 provider.
15 15
  */
16
-interface OAuth1Interface extends OAuthInterface{
16
+interface OAuth1Interface extends OAuthInterface {
17 17
 
18 18
 	/**
19 19
 	 * Obtains an OAuth1 request token and returns an AccessToken object for use in the authentication request.
Please login to merge, or discard this patch.
src/Core/OAuth2Interface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 /**
16 16
  * Specifies the basic methods for an OAuth2 provider.
17 17
  */
18
-interface OAuth2Interface extends OAuthInterface{
18
+interface OAuth2Interface extends OAuthInterface {
19 19
 
20 20
 	const AUTH_METHOD_HEADER = 1;
21 21
 	const AUTH_METHOD_QUERY  = 2;
Please login to merge, or discard this patch.