Skip to content

Commit

Permalink
cs fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alibo committed Feb 28, 2016
1 parent 4481120 commit 4a1f163
Show file tree
Hide file tree
Showing 26 changed files with 27 additions and 51 deletions.
2 changes: 1 addition & 1 deletion examples/authorization.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
echo $token->errorDescription();
} else {
echo "Refresh Token: " . $token->refreshToken();
}
}
2 changes: 1 addition & 1 deletion examples/purchase.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
echo "Consumed: " . $purchase->consumed();
echo "Developer Payload: " . $purchase->developerPayload();
echo "Purchase Time (Timestamp in ms): " . $purchase->time();
}
}
2 changes: 1 addition & 1 deletion examples/subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
echo "End Time (Timestamp in ms): " . $subscription->endTime(); // expirationTime(), nextTime()
echo "Is auto renewing? " . $subscription->autoRenewing();
echo "Is expired? (end time is past) " . $subscription->expired();
}
}
2 changes: 1 addition & 1 deletion examples/unsubscribe.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
echo "The subscription has been successfully cancelled!";
} else {
echo $unsubscribe->errorDescription();
}
}
4 changes: 1 addition & 3 deletions src/Bazaar.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ public function token($redirectUrl, array $input = [])
]);

return new Token($response);

}

/**
Expand Down Expand Up @@ -286,5 +285,4 @@ protected function fetchToken()

return $token->accessToken();
}

}
}
3 changes: 1 addition & 2 deletions src/BazaarException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@

class BazaarException extends \Exception
{

}
}
2 changes: 1 addition & 1 deletion src/Client/ClientInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ public function get($url, array $options = []);
* @return array
*/
public function post($url, array $options = []);
}
}
4 changes: 1 addition & 3 deletions src/Client/GuzzleClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public function get($url, array $options = [])
{
try {
$response = $this->client->get($url, $options);

} catch (RequestException $e) {
if (!$e->hasResponse()) {
throw $e;
Expand All @@ -49,7 +48,6 @@ public function post($url, array $options = [])
{
try {
$response = $this->client->post($url, $options);

} catch (RequestException $e) {
if (!$e->hasResponse()) {
throw $e;
Expand All @@ -61,4 +59,4 @@ public function post($url, array $options = [])
$response->getBody()->getContents(), true
);
}
}
}
3 changes: 1 addition & 2 deletions src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,4 @@ public function refreshToken()
{
return $this->options['refresh-token'];
}

}
}
2 changes: 1 addition & 1 deletion src/Models/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ public function errorDescription()
{
return $this->errorDescription;
}
}
}
4 changes: 1 addition & 3 deletions src/Models/Purchase.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,4 @@ public function notFound()
{
return $this->failed() && $this->error == 'not_found';
}


}
}
3 changes: 1 addition & 2 deletions src/Models/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,5 +150,4 @@ public function notFound()
{
return $this->failed() && $this->error == 'not_found';
}

}
}
3 changes: 1 addition & 2 deletions src/Models/Token.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,4 @@ public function scope()
{
return $this->scope;
}

}
}
2 changes: 1 addition & 1 deletion src/Models/Unsubscribe.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ public function notFound()
{
return $this->failed() && $this->error == 'not_found';
}
}
}
3 changes: 1 addition & 2 deletions src/Storage/FileTokenStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public function retrieve()
}

return null;

}

/**
Expand Down Expand Up @@ -82,4 +81,4 @@ protected function read()

return $data;
}
}
}
4 changes: 2 additions & 2 deletions src/Storage/MemoryTokenStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class MemoryTokenStorage implements TokenStorageInterface
/**
* token object
*
* Token
* @var Token
*/
protected $token;

Expand Down Expand Up @@ -48,4 +48,4 @@ public function expired()
{
return time() > $this->expireTime;
}
}
}
2 changes: 1 addition & 1 deletion src/Storage/TokenStorageInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ public function retrieve();
* @return bool
*/
public function expired();
}
}
4 changes: 1 addition & 3 deletions tests/AccessTokenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ class AccessTokenTest extends TestCase
/** @test */
public function it_should_fetch_access_token()
{
$bazaar = $this->makeBazaar();

$redirectUrl = 'http://example.com/callback';

$bazaar = $this->makeBazaar();
Expand Down Expand Up @@ -45,4 +43,4 @@ public function it_should_fetch_access_token()
$this->assertEquals('refresh-123456', $token->refreshToken());
$this->assertEquals('androidpublisher', $token->scope());
}
}
}
2 changes: 1 addition & 1 deletion tests/FileTokenStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ public function it_should_say_token_has_been_expired_when_token_does_not_exist()
$this->assertTrue($storage->expired());
$this->assertNull($storage->retrieve());
}
}
}
5 changes: 1 addition & 4 deletions tests/GuzzleClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public function it_should_send_a_get_request()
'key-one' => 'something',
'key-two' => 'something-else'
], $response);

}

/** @test */
Expand Down Expand Up @@ -84,7 +83,5 @@ public function it_should_send_a_post_request()
'key-one' => 'something',
'key-two' => 'something-else'
], $response);

}

}
}
3 changes: 1 addition & 2 deletions tests/MemoryTokenStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ public function it_should_save_the_token()
/** @test */
public function it_should_say_token_has_been_expired_when_token_does_not_exist()
{

$storage = new MemoryTokenStorage();

$this->assertTrue($storage->expired());
$this->assertNull($storage->retrieve());
}
}
}
5 changes: 1 addition & 4 deletions tests/PurchaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public function it_should_fetch_purchase_state()
$this->assertTrue($purchase->purchased());
$this->assertFalse($purchase->consumed());
$this->assertEquals('payload-123456', $purchase->payload());

}

/** @test */
Expand Down Expand Up @@ -78,6 +77,4 @@ public function purchase_should_parse_not_found_response()
$this->assertEquals('not_found', $purchase->error());
$this->assertEquals('The requested purchase is not found!', $purchase->errorDescription());
}


}
}
3 changes: 1 addition & 2 deletions tests/RefreshTokenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,5 @@ public function it_should_refresh_the_token_and_store_it()

$this->assertFalse($token->failed());
$this->assertEquals('123456', $token->accessToken());

}
}
}
4 changes: 1 addition & 3 deletions tests/SubscriptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public function it_should_fetch_subscription_state()
$this->assertEquals(1100000000000, $subscription->endTime());
$this->assertTrue($subscription->autoRenewing());
$this->assertTrue($subscription->expired());

}

/** @test */
Expand Down Expand Up @@ -80,5 +79,4 @@ public function it_should_parse_not_found_response()
$this->assertEquals('not_found', $subscription->error());
$this->assertEquals('The requested purchase is not found!', $subscription->errorDescription());
}

}
}
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ protected function makeTokenUrl()
{
return (new Config())->url('token');
}
}
}
3 changes: 1 addition & 2 deletions tests/UnsubscribeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,4 @@ public function it_should_parse_not_found_response()
$this->assertEquals('not_found', $unsubscribe->error());
$this->assertEquals('The requested purchase is not found!', $unsubscribe->errorDescription());
}

}
}

0 comments on commit 4a1f163

Please sign in to comment.