Skip to content

Commit

Permalink
[smarcet]
Browse files Browse the repository at this point in the history
* fixed code issues
  • Loading branch information
smarcet committed Apr 5, 2016
1 parent 356550c commit 41f07fc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/jws/impl/JWS.php
Expand Up @@ -28,6 +28,7 @@
use jws\exceptions\JWSNotSupportedAlgorithm;
use jws\IJWS;
use jws\IJWSPayloadClaimSetSpec;
use jws\IJWSPayloadRawSpec;
use jws\IJWSPayloadSpec;
use jws\payloads\JWSPayloadFactory;
use jwt\IBasicJWT;
Expand All @@ -39,7 +40,6 @@
use jwt\utils\JOSEHeaderSerializer;
use jwt\utils\JWTClaimSetSerializer;
use jwt\utils\JWTRawSerializer;
use utils\json_types\JsonArray;
use utils\json_types\JsonValue;
use utils\json_types\StringOrURI;

Expand Down Expand Up @@ -175,11 +175,12 @@ public function getEncodedPayload()
throw new JWSInvalidPayloadException('payload is not set!');

$enc_payload = '';
if($this->payload->isClaimSet() && $this->payload instanceof IJWSPayloadClaimSetSpec)

if($this->payload instanceof IJWSPayloadClaimSetSpec)
{
$enc_payload = JWTClaimSetSerializer::serialize($this->payload->getClaimSet());
}
else
else if($this->payload instanceof IJWSPayloadRawSpec)
{
$enc_payload = JWTRawSerializer::serialize($this->payload->getRaw());
}
Expand Down Expand Up @@ -320,8 +321,7 @@ static public function fromHeaderClaimsAndSignature(IJOSEHeader $header, IJWSPay
*/
public function take()
{
$payload = $this->payload->isClaimSet() ? $this->claim_set : $this->payload->getRaw();

$payload = ($this->payload instanceof IJWSPayloadRawSpec) ? $this->payload->getRaw() : $this->claim_set;
return array
(
$this->header,
Expand Down

0 comments on commit 41f07fc

Please sign in to comment.