Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell authored and StyleCIBot committed Aug 16, 2020
1 parent 8162210 commit 53125c0
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public function workspaces(string $workspace)
*
* @return void
*/
public function authenticate(string $method, string $token, string $password = null)
public function authenticate(string $method, string $token, string $password = null): void
{
$this->getHttpClientBuilder()->removePlugin(Authentication::class);
$this->getHttpClientBuilder()->addPlugin(new Authentication($method, $token, $password));
Expand All @@ -218,7 +218,7 @@ public function authenticate(string $method, string $token, string $password = n
*
* @return void
*/
public function setUrl(string $url)
public function setUrl(string $url): void
{
$this->httpClientBuilder->removePlugin(AddHostPlugin::class);
$this->httpClientBuilder->addPlugin(new AddHostPlugin(Psr17FactoryDiscovery::findUrlFactory()->createUri($url)));
Expand Down
8 changes: 4 additions & 4 deletions src/HttpClient/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public function getHttpClient()
*
* @return void
*/
public function addPlugin(Plugin $plugin)
public function addPlugin(Plugin $plugin): void
{
$this->plugins[] = $plugin;
$this->pluginClient = null;
Expand All @@ -139,7 +139,7 @@ public function addPlugin(Plugin $plugin)
*
* @return void
*/
public function removePlugin(string $fqcn)
public function removePlugin(string $fqcn): void
{
foreach ($this->plugins as $idx => $plugin) {
if ($plugin instanceof $fqcn) {
Expand All @@ -157,7 +157,7 @@ public function removePlugin(string $fqcn)
*
* @return void
*/
public function addCache(CacheItemPoolInterface $cachePool, array $config = [])
public function addCache(CacheItemPoolInterface $cachePool, array $config = []): void
{
if (!isset($config['cache_key_generator'])) {
$config['cache_key_generator'] = new HeaderCacheKeyGenerator(['Authorization', 'Cookie', 'Accept', 'Content-type']);
Expand All @@ -172,7 +172,7 @@ public function addCache(CacheItemPoolInterface $cachePool, array $config = [])
*
* @return void
*/
public function removeCache()
public function removeCache(): void
{
$this->cachePlugin = null;
$this->pluginClient = null;
Expand Down
2 changes: 1 addition & 1 deletion src/HttpClient/Message/ResponseMediator.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public static function getPagination(ResponseInterface $response)
{
try {
/** @var array<string,string> */
return \array_filter(self::getContent($response), [self::class, 'paginationFilter'], ARRAY_FILTER_USE_KEY);
return \array_filter(self::getContent($response), [self::class, 'paginationFilter'], \ARRAY_FILTER_USE_KEY);
} catch (RuntimeException $e) {
return [];
}
Expand Down
4 changes: 2 additions & 2 deletions src/HttpClient/Plugin/History.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function getLastResponse()
*
* @return void
*/
public function addSuccess(RequestInterface $request, ResponseInterface $response)
public function addSuccess(RequestInterface $request, ResponseInterface $response): void
{
$this->lastResponse = $response;
}
Expand All @@ -66,7 +66,7 @@ public function addSuccess(RequestInterface $request, ResponseInterface $respons
*
* @return void
*/
public function addFailure(RequestInterface $request, ClientExceptionInterface $exception)
public function addFailure(RequestInterface $request, ClientExceptionInterface $exception): void
{
}
}
2 changes: 1 addition & 1 deletion src/HttpClient/Util/QueryStringBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ public static function build(array $query)
return '';
}

return \sprintf('?%s', \http_build_query($query, '', '&', PHP_QUERY_RFC3986));
return \sprintf('?%s', \http_build_query($query, '', '&', \PHP_QUERY_RFC3986));
}
}
2 changes: 1 addition & 1 deletion src/ResultPager.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public function fetchPrevious()
*
* @return void
*/
private function postFetch()
private function postFetch(): void
{
$response = $this->client->getLastResponse();

Expand Down
2 changes: 1 addition & 1 deletion tests/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
final class ClientTest extends TestCase
{
public function testCreateClient()
public function testCreateClient(): void
{
$client = new Client();

Expand Down
4 changes: 2 additions & 2 deletions tests/IntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
final class IntegrationTest extends TestCase
{
public function testShowRepo()
public function testShowRepo(): void
{
$client = new Client();

Expand All @@ -36,7 +36,7 @@ public function testShowRepo()
self::assertSame('{7dd600e6-0d9c-4801-b967-cb4cc17359ff}', $response['uuid']);
}

public function testRepoNotFound()
public function testRepoNotFound(): void
{
$client = new Client();

Expand Down
10 changes: 5 additions & 5 deletions tests/ProjectsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
final class ProjectsTest extends TestCase
{
public function testProjectList()
public function testProjectList(): void
{
$client = MockedClient::create(
ProjectsListResponse::create()
Expand All @@ -41,7 +41,7 @@ public function testProjectList()
self::assertCount(9, $response['values']);
}

public function testProjectShow()
public function testProjectShow(): void
{
$client = MockedClient::create(
ProjectsShowResponse::create()
Expand All @@ -56,7 +56,7 @@ public function testProjectShow()
self::assertCount(11, $response);
}

public function testProjectCreate()
public function testProjectCreate(): void
{
$client = MockedClient::create(
ProjectsCreateResponse::create()
Expand All @@ -83,7 +83,7 @@ public function testProjectCreate()
self::assertCount(11, $response);
}

public function testProjectUpdate()
public function testProjectUpdate(): void
{
$client = MockedClient::create(
ProjectsUpdateResponse::create()
Expand All @@ -110,7 +110,7 @@ public function testProjectUpdate()
self::assertCount(11, $response);
}

public function testProjectRemove()
public function testProjectRemove(): void
{
$client = MockedClient::create(
ProjectsRemoveResponse::create()
Expand Down
8 changes: 4 additions & 4 deletions tests/ResponseMediatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/
class ResponseMediatorTest extends TestCase
{
public function testGetContent()
public function testGetContent(): void
{
$response = new Response(
200,
Expand All @@ -35,7 +35,7 @@ public function testGetContent()
$this->assertSame(['foo' => 'bar'], ResponseMediator::getContent($response));
}

public function testGetContentNotJson()
public function testGetContentNotJson(): void
{
$body = 'foobar';
$response = new Response(
Expand All @@ -50,7 +50,7 @@ public function testGetContentNotJson()
ResponseMediator::getContent($response);
}

public function testGetContentInvalidJson()
public function testGetContentInvalidJson(): void
{
$body = 'foobar';
$response = new Response(
Expand All @@ -65,7 +65,7 @@ public function testGetContentInvalidJson()
ResponseMediator::getContent($response);
}

public function testGetErrrorMessageInvalidJson()
public function testGetErrrorMessageInvalidJson(): void
{
$body = 'foobar';
$response = new Response(
Expand Down
2 changes: 1 addition & 1 deletion tests/WorkspacesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
final class WorkspacesTest extends TestCase
{
public function testWorkspaceShow()
public function testWorkspaceShow(): void
{
$client = MockedClient::create(
WorkspacesShowResponse::create()
Expand Down

0 comments on commit 53125c0

Please sign in to comment.