Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/vendor
/.idea
.phpunit.result.cache
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
"ext-json": "*",
"amphp/amp": "^2.1.1",
"amphp/artax": "^3.0.14",
"harmonyio/cache": "^1.0.0-rc1"
"harmonyio/cache": "dev-master"
},
"require-dev": {
"harmonyio/php-codesniffer-ruleset": "^1.0.0-rc1",
"harmonyio/phpunit-extension": "^1.0.0-rc1",
"maglnet/composer-require-checker": "^1.1.0",
"phpunit/phpunit": "^7.5.1",
"slevomat/coding-standard": "^4.8.6",
"squizlabs/php_codesniffer": "^3.4.0"
"harmonyio/php-codesniffer-ruleset": "dev-master",
"harmonyio/phpunit-extension": "dev-master",
"maglnet/composer-require-checker": "^2.0.0",
"phpunit/phpunit": "^8.1.3",
"slevomat/coding-standard": "^5.0.4",
"squizlabs/php_codesniffer": "^3.4.2"
},
"autoload": {
"psr-4": {
Expand Down
420 changes: 240 additions & 180 deletions composer.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Client/ArtaxClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private function makeCachingRequest(CachingRequest $request): Promise
yield $this->cache->store(new Item(
$request->getCachingKey(),
serialize($response),
$request->getTtl()
$request->getTtl(),
));
}

Expand Down
4 changes: 2 additions & 2 deletions src/Message/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Response implements CacheableResponse
/** @var string */
private $textualStatusCode;

/** @var array<string, string[]> */
/** @var array<string, array<string>> */
private $headers = [];

/** @var string */
Expand Down Expand Up @@ -62,7 +62,7 @@ public function getHeader(string $key): ?string
}

/**
* @return string[]
* @return array<string>
*/
public function getHeaderArray(string $key): array
{
Expand Down
3 changes: 1 addition & 2 deletions tests/Unit/Client/ArtaxClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ class ArtaxClientTest extends TestCase
/** @var MockObject|Cache */
private $cache;

// phpcs:ignore SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingReturnTypeHint
public function setUp()
public function setUp(): void
{
$this->artaxBaseClient = $this->createMock(ArtaxBaseClient::class);
$this->cache = $this->createMock(Cache::class);
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Exception/InvalidBodyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function testMessageWhenBodyTypeIsAnObject(): void
{
$this->expectException(InvalidBody::class);
$this->expectExceptionMessage(
'Expected body to be of type string|Amp\Artax\RequestBody, but got DateTimeImmutable.'
'Expected body to be of type string|Amp\Artax\RequestBody, but got DateTimeImmutable.',
);

throw new InvalidBody(new \DateTimeImmutable());
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Message/CachingRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function testImplementsCachingInterface(): void
{
$this->assertInstanceOf(
CacheableRequest::class,
(new CachingRequest('TestKey', new Ttl(10), 'https://example.com'))
(new CachingRequest('TestKey', new Ttl(10), 'https://example.com')),
);
}

Expand All @@ -29,7 +29,7 @@ public function testGetTtl(): void
{
$this->assertSame(
10,
(new CachingRequest('TestKey', new Ttl(10), 'https://example.com'))->getTtl()->getTtlInSeconds()
(new CachingRequest('TestKey', new Ttl(10), 'https://example.com'))->getTtl()->getTtlInSeconds(),
);
}
}
2 changes: 1 addition & 1 deletion tests/Unit/Message/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function testSerialize(): void
{
$this->assertSame(
require TEST_FIXTURE_DIR . '/Message/serialized-response.php',
serialize($this->response)
serialize($this->response),
);
}

Expand Down