Implemented PHP-CS-Fixer support

This commit is contained in:
ErickSkrauch
2018-04-17 23:47:25 +03:00
parent bfdcaf2233
commit 02ea7346a8
115 changed files with 883 additions and 363 deletions

View File

@@ -214,7 +214,7 @@ class Component extends YiiUserComponent {
protected function createToken(Account $account): Token {
$token = new Token();
foreach($this->getClaims($account) as $claim) {
foreach ($this->getClaims($account) as $claim) {
$token->addClaim($claim);
}

View File

@@ -18,6 +18,10 @@ class Identity implements IdentityInterface {
*/
private $_accessToken;
private function __construct(AccessTokenEntity $accessToken) {
$this->_accessToken = $accessToken;
}
/**
* @inheritdoc
* @throws \yii\web\UnauthorizedHttpException
@@ -73,10 +77,6 @@ class Identity implements IdentityInterface {
throw new NotSupportedException('This method used for cookie auth, except we using Bearer auth');
}
private function __construct(AccessTokenEntity $accessToken) {
$this->_accessToken = $accessToken;
}
private function getSession(): OauthSession {
return OauthSession::findOne($this->_accessToken->getSessionId());
}

View File

@@ -23,6 +23,11 @@ class JwtIdentity implements IdentityInterface {
*/
private $token;
private function __construct(string $rawToken, Token $token) {
$this->rawToken = $rawToken;
$this->token = $token;
}
public static function findIdentityByAccessToken($rawToken, $type = null): IdentityInterface {
/** @var \api\components\User\Component $component */
$component = Yii::$app->user;
@@ -86,9 +91,4 @@ class JwtIdentity implements IdentityInterface {
throw new NotSupportedException('This method used for cookie auth, except we using Bearer auth');
}
private function __construct(string $rawToken, Token $token) {
$this->rawToken = $rawToken;
$this->token = $token;
}
}

View File

@@ -5,7 +5,7 @@ use Emarref\Jwt\Claim\AbstractClaim;
class ScopesClaim extends AbstractClaim {
const NAME = 'ely-scopes';
public const NAME = 'ely-scopes';
/**
* ScopesClaim constructor.

View File

@@ -21,7 +21,7 @@ class SubjectPrefixVerifier implements VerifierInterface {
$subject = ($subjectClaim === null) ? null : $subjectClaim->getValue();
if (!StringHelper::startsWith($subject, $this->subjectPrefix)) {
throw new InvalidSubjectException;
throw new InvalidSubjectException();
}
}