Skip to content

Commit

Permalink
Make even more properties read-only (#42)
Browse files Browse the repository at this point in the history
Update ramsey/composer-install to v3 on github actions
  • Loading branch information
hugo-goncalves-kununu authored Apr 9, 2024
1 parent 236ec0e commit bd9ed8d
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
coverage: xdebug

- name: Install Composer Dependencies
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v3
with:
dependency-versions: ${{ matrix.dependencies }}
composer-options: "--prefer-stable"
Expand Down
6 changes: 4 additions & 2 deletions src/Executor/CachePoolExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@

final class CachePoolExecutor implements ExecutorInterface
{
public function __construct(private CacheItemPoolInterface $cache, private PurgerInterface $purger)
{
public function __construct(
private readonly CacheItemPoolInterface $cache,
private readonly PurgerInterface $purger
) {
}

public function execute(array $fixtures, bool $append = false): void
Expand Down
6 changes: 3 additions & 3 deletions src/Executor/ElasticsearchExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
final class ElasticsearchExecutor implements ExecutorInterface
{
public function __construct(
private Client $elasticSearch,
private string $indexName,
private PurgerInterface $purger
private readonly Client $elasticSearch,
private readonly string $indexName,
private readonly PurgerInterface $purger
) {
}

Expand Down
6 changes: 4 additions & 2 deletions src/Executor/HttpClientExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@

final class HttpClientExecutor implements ExecutorInterface
{
public function __construct(private HttpClientInterface $httpClient, private PurgerInterface $purger)
{
public function __construct(
private readonly HttpClientInterface $httpClient,
private readonly PurgerInterface $purger
) {
}

public function execute(array $fixtures, bool $append = false): void
Expand Down
2 changes: 1 addition & 1 deletion src/Executor/NonTransactionalConnectionExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

final class NonTransactionalConnectionExecutor implements ExecutorInterface
{
private ExecutorInterface $executor;
private readonly ExecutorInterface $executor;

public function __construct(Connection $connection, PurgerInterface $purger)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Purger/CachePoolPurger.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

final class CachePoolPurger implements PurgerInterface
{
public function __construct(private CacheItemPoolInterface $cachePool)
public function __construct(private readonly CacheItemPoolInterface $cachePool)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/Purger/ElasticsearchPurger.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

final class ElasticsearchPurger implements PurgerInterface
{
public function __construct(private Client $elasticSearch, private string $indexName)
public function __construct(private readonly Client $elasticSearch, private readonly string $indexName)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/Purger/HttpClientPurger.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

final class HttpClientPurger implements PurgerInterface
{
public function __construct(private HttpClientInterface $httpClient)
public function __construct(private readonly HttpClientInterface $httpClient)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/Purger/NonTransactionalConnectionPurger.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

final class NonTransactionalConnectionPurger implements PurgerInterface
{
private PurgerInterface $purger;
private readonly PurgerInterface $purger;

public function __construct(Connection $connection, array $excludedTables = [])
{
Expand Down
1 change: 0 additions & 1 deletion src/Tools/HttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ private function recreateResponseFactory(array $responses): void

$reflectionClass = new ReflectionClass(MockHttpClient::class);
$reflectionProperty = $reflectionClass->getProperty('responseFactory');
$reflectionProperty->setAccessible(true);
$reflectionProperty->setValue($this, $responseFactory);
}
}

0 comments on commit bd9ed8d

Please sign in to comment.