Passed
Push — main ( e1d1c1...171fb7 )
by smiley
02:29
created
src/Core/OAuthInterface.php 1 patch
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,6 @@
 block discarded – undo
55 55
 	 * @param string|null                                          $method
56 56
 	 * @param array|string|\Psr\Http\Message\StreamInterface|null  $body
57 57
 	 * @param array|null                                           $headers
58
-
59 58
 	 * @throws \chillerlan\OAuth\Core\ProviderException
60 59
 	 */
61 60
 	public function request(
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):OAuthStorageInterface{
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():OAuthStorageInterface{
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):OAuthStorageInterface{
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/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
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	/**
36 36
 	 * SessionStorage constructor.
37 37
 	 */
38
-	public function __construct(SettingsContainerInterface $options = null){
38
+	public function __construct(SettingsContainerInterface $options = null) {
39 39
 		parent::__construct($options);
40 40
 
41 41
 		$this->tokenVar = $this->options->sessionTokenVar;
@@ -43,15 +43,15 @@  discard block
 block discarded – undo
43 43
 
44 44
 		// Determine if the session has started.
45 45
 		// @link http://stackoverflow.com/a/18542272/1470961
46
-		if($this->options->sessionStart && !(session_status() !== PHP_SESSION_NONE)){
46
+		if ($this->options->sessionStart && !(session_status() !== PHP_SESSION_NONE)) {
47 47
 			session_start();
48 48
 		}
49 49
 
50
-		if(!isset($_SESSION[$this->tokenVar])){
50
+		if (!isset($_SESSION[$this->tokenVar])) {
51 51
 			$_SESSION[$this->tokenVar] = [];
52 52
 		}
53 53
 
54
-		if(!isset($_SESSION[$this->stateVar])){
54
+		if (!isset($_SESSION[$this->stateVar])) {
55 55
 			$_SESSION[$this->stateVar] = [];
56 56
 		}
57 57
 
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
 	 *
63 63
 	 * @codeCoverageIgnore
64 64
 	 */
65
-	public function __destruct(){
66
-		if($this->options->sessionStart){
65
+	public function __destruct() {
66
+		if ($this->options->sessionStart) {
67 67
 			session_write_close();
68 68
 		}
69 69
 	}
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	 */
83 83
 	public function getAccessToken(string $service):AccessToken{
84 84
 
85
-		if($this->hasAccessToken($service)){
85
+		if ($this->hasAccessToken($service)) {
86 86
 			return $this->fromStorage($_SESSION[$this->tokenVar][$service]);
87 87
 		}
88 88
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	 */
102 102
 	public function clearAccessToken(string $service):OAuthStorageInterface{
103 103
 
104
-		if(array_key_exists($service, $_SESSION[$this->tokenVar])){
104
+		if (array_key_exists($service, $_SESSION[$this->tokenVar])) {
105 105
 			unset($_SESSION[$this->tokenVar][$service]);
106 106
 		}
107 107
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 	 */
114 114
 	public function clearAllAccessTokens():OAuthStorageInterface{
115 115
 
116
-		foreach(array_keys($_SESSION[$this->tokenVar]) as $service){
116
+		foreach (array_keys($_SESSION[$this->tokenVar]) as $service) {
117 117
 			unset($_SESSION[$this->tokenVar][$service]);
118 118
 		}
119 119
 
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 	 */
137 137
 	public function getCSRFState(string $service):string{
138 138
 
139
-		if($this->hasCSRFState($service)){
139
+		if ($this->hasCSRFState($service)) {
140 140
 			return $_SESSION[$this->stateVar][$service];
141 141
 		}
142 142
 
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 	 */
156 156
 	public function clearCSRFState(string $service):OAuthStorageInterface{
157 157
 
158
-		if(array_key_exists($service, $_SESSION[$this->stateVar])){
158
+		if (array_key_exists($service, $_SESSION[$this->stateVar])) {
159 159
 			unset($_SESSION[$this->stateVar][$service]);
160 160
 		}
161 161
 
Please login to merge, or discard this patch.