Passed
Push — master ( dec63d...08895f )
by smiley
01:34
created
src/OAuthOptionsTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 
13 13
 namespace chillerlan\OAuth;
14 14
 
15
-trait OAuthOptionsTrait{
15
+trait OAuthOptionsTrait {
16 16
 
17 17
 	/**
18 18
 	 * The application key (or id) given by your provider
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
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 
13 13
 namespace chillerlan\OAuth\Core;
14 14
 
15
-interface TokenRefresh{
15
+interface TokenRefresh {
16 16
 
17 17
 	/**
18 18
 	 * Tries to refresh an existing access token with an associated refresh token
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
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 
13 13
 namespace chillerlan\OAuth\Core;
14 14
 
15
-interface OAuth1Interface extends OAuthInterface{
15
+interface OAuth1Interface extends OAuthInterface {
16 16
 
17 17
 	/**
18 18
 	 * Obtains an OAuth1 request token and returns an 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
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 
13 13
 namespace chillerlan\OAuth\Core;
14 14
 
15
-interface ClientCredentials{
15
+interface ClientCredentials {
16 16
 
17 17
 	/**
18 18
 	 * Obtains an OAuth2 client credentials token and returns an AccessToken
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
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 use chillerlan\OAuth\Core\AccessToken;
16 16
 use Psr\Log\LoggerAwareInterface;
17 17
 
18
-interface OAuthStorageInterface extends LoggerAwareInterface{
18
+interface OAuthStorageInterface extends LoggerAwareInterface {
19 19
 
20 20
 	/**
21 21
 	 * Stores an AccessToken for the given $service
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
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
 use function is_string;
20 20
 
21
-abstract class OAuthStorageAbstract implements OAuthStorageInterface{
21
+abstract class OAuthStorageAbstract implements OAuthStorageInterface {
22 22
 	use LoggerAwareTrait;
23 23
 
24 24
 	/**
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	 * @param \chillerlan\Settings\SettingsContainerInterface|null $options
33 33
 	 * @param \Psr\Log\LoggerInterface|null                        $logger
34 34
 	 */
35
-	public function __construct(SettingsContainerInterface $options = null, LoggerInterface $logger = null){
35
+	public function __construct(SettingsContainerInterface $options = null, LoggerInterface $logger = null) {
36 36
 		$this->options = $options ?? new OAuthOptions;
37 37
 
38 38
 		$this->setLogger($logger ?? new NullLogger);
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 	 */
55 55
 	public function fromStorage($data):AccessToken{
56 56
 
57
-		if(!is_string($data)){
57
+		if (!is_string($data)) {
58 58
 			throw new OAuthStorageException('invalid data');
59 59
 		}
60 60
 
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
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 
17 17
 use function array_keys, array_key_exists;
18 18
 
19
-class MemoryStorage extends OAuthStorageAbstract{
19
+class MemoryStorage extends OAuthStorageAbstract {
20 20
 
21 21
 	/**
22 22
 	 * @var array
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	 */
43 43
 	public function getAccessToken(string $service):AccessToken{
44 44
 
45
-		if($this->hasAccessToken($service)){
45
+		if ($this->hasAccessToken($service)) {
46 46
 			return $this->tokens[$service];
47 47
 		}
48 48
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 	 */
62 62
 	public function clearAccessToken(string $service):bool{
63 63
 
64
-		if(array_key_exists($service, $this->tokens)){
64
+		if (array_key_exists($service, $this->tokens)) {
65 65
 			unset($this->tokens[$service]);
66 66
 		}
67 67
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 	 */
74 74
 	public function clearAllAccessTokens():bool{
75 75
 
76
-		foreach(array_keys($this->tokens) as $service){
76
+		foreach (array_keys($this->tokens) as $service) {
77 77
 			unset($this->tokens[$service]);
78 78
 		}
79 79
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	 */
97 97
 	public function getCSRFState(string $service):string{
98 98
 
99
-		if($this->hasCSRFState($service)){
99
+		if ($this->hasCSRFState($service)) {
100 100
 			return $this->states[$service];
101 101
 		}
102 102
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 	 */
116 116
 	public function clearCSRFState(string $service):bool{
117 117
 
118
-		if(array_key_exists($service, $this->states)){
118
+		if (array_key_exists($service, $this->states)) {
119 119
 			unset($this->states[$service]);
120 120
 		}
121 121
 
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
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 
20 20
 use const PHP_SESSION_NONE;
21 21
 
22
-class SessionStorage extends OAuthStorageAbstract{
22
+class SessionStorage extends OAuthStorageAbstract {
23 23
 
24 24
 	/**
25 25
 	 * @var string
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	 *
37 37
 	 * @param \chillerlan\Settings\SettingsContainerInterface|null $options
38 38
 	 */
39
-	public function __construct(SettingsContainerInterface $options = null){
39
+	public function __construct(SettingsContainerInterface $options = null) {
40 40
 		parent::__construct($options);
41 41
 
42 42
 		$this->sessionVar = $this->options->sessionTokenVar;
@@ -44,15 +44,15 @@  discard block
 block discarded – undo
44 44
 
45 45
 		// Determine if the session has started.
46 46
 		// @link http://stackoverflow.com/a/18542272/1470961
47
-		if($this->options->sessionStart && !(session_status() !== PHP_SESSION_NONE)){
47
+		if ($this->options->sessionStart && !(session_status() !== PHP_SESSION_NONE)) {
48 48
 			session_start();
49 49
 		}
50 50
 
51
-		if(!isset($_SESSION[$this->sessionVar])){
51
+		if (!isset($_SESSION[$this->sessionVar])) {
52 52
 			$_SESSION[$this->sessionVar] = [];
53 53
 		}
54 54
 
55
-		if(!isset($_SESSION[$this->stateVar])){
55
+		if (!isset($_SESSION[$this->stateVar])) {
56 56
 			$_SESSION[$this->stateVar] = [];
57 57
 		}
58 58
 
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
 	 *
64 64
 	 * @codeCoverageIgnore
65 65
 	 */
66
-	public function __destruct(){
67
-		if($this->options->sessionStart){
66
+	public function __destruct() {
67
+		if ($this->options->sessionStart) {
68 68
 			session_write_close();
69 69
 		}
70 70
 	}
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	 */
84 84
 	public function getAccessToken(string $service):AccessToken{
85 85
 
86
-		if($this->hasAccessToken($service)){
86
+		if ($this->hasAccessToken($service)) {
87 87
 			return $this->fromStorage($_SESSION[$this->sessionVar][$service]);
88 88
 		}
89 89
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	 */
103 103
 	public function clearAccessToken(string $service):bool{
104 104
 
105
-		if(array_key_exists($service, $_SESSION[$this->sessionVar])){
105
+		if (array_key_exists($service, $_SESSION[$this->sessionVar])) {
106 106
 			unset($_SESSION[$this->sessionVar][$service]);
107 107
 		}
108 108
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 	 */
115 115
 	public function clearAllAccessTokens():bool{
116 116
 
117
-		foreach(array_keys($_SESSION[$this->sessionVar]) as $service){
117
+		foreach (array_keys($_SESSION[$this->sessionVar]) as $service) {
118 118
 			unset($_SESSION[$this->sessionVar][$service]);
119 119
 		}
120 120
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 	 */
138 138
 	public function getCSRFState(string $service):string{
139 139
 
140
-		if($this->hasCSRFState($service)){
140
+		if ($this->hasCSRFState($service)) {
141 141
 			return $_SESSION[$this->stateVar][$service];
142 142
 		}
143 143
 
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 	 */
157 157
 	public function clearCSRFState(string $service):bool{
158 158
 
159
-		if(array_key_exists($service, $_SESSION[$this->stateVar])){
159
+		if (array_key_exists($service, $_SESSION[$this->stateVar])) {
160 160
 			unset($_SESSION[$this->stateVar][$service]);
161 161
 		}
162 162
 
Please login to merge, or discard this patch.