Skip to content

Commit

Permalink
fix(cs): Fix code style after PHPCSFixer v3.17 release (#167)
Browse files Browse the repository at this point in the history
Co-authored-by: jmsche <[email protected]>
  • Loading branch information
jmsche and jmsche committed May 26, 2023
1 parent d915d80 commit 6f8e1b7
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"symfony/yaml": "^5.4 || ^6.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.16.0",
"friendsofphp/php-cs-fixer": "^3.17.0",
"jane-php/json-schema": "^7.4",
"jane-php/json-schema-runtime": "^7.4",
"phpstan/phpstan": "^1.9",
Expand Down
2 changes: 1 addition & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Client extends ElasticaClient
private ResultSetBuilder $resultSetBuilder;
private IndexNameMapper $indexNameMapper;

public function __construct($config = [], ?callable $callback = null, ?LoggerInterface $logger = null, ?ResultSetBuilder $resultSetBuilder = null, ?IndexNameMapper $indexNameMapper = null)
public function __construct($config = [], callable $callback = null, LoggerInterface $logger = null, ResultSetBuilder $resultSetBuilder = null, IndexNameMapper $indexNameMapper = null)
{
parent::__construct($config, $callback, $logger);

Expand Down
2 changes: 1 addition & 1 deletion src/IndexBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function purgeOldIndices(string $indexName, bool $dryRun = false): array
$indexes = $indexes['metadata']['indices'];

foreach ($indexes as $realIndexName => &$data) {
if (0 !== strpos($realIndexName, $indexName)) {
if (!str_starts_with($realIndexName, $indexName)) {
unset($indexes[$realIndexName]);

continue;
Expand Down
2 changes: 1 addition & 1 deletion src/Indexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Indexer

private ?Bulk $currentBulk = null;

public function __construct(Client $client, SerializerInterface $serializer, int $bulkMaxSize = 100, array $bulkRequestParams = [], ?ContextBuilderInterface $contextBuilder = null)
public function __construct(Client $client, SerializerInterface $serializer, int $bulkMaxSize = 100, array $bulkRequestParams = [], ContextBuilderInterface $contextBuilder = null)
{
// TODO: on the destruct, maybe throw an exception for non empty indexer queues?
Expand Down
2 changes: 1 addition & 1 deletion src/Mapping/YamlProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class YamlProvider implements MappingProviderInterface
private string $configurationDirectory;
private Parser $parser;

public function __construct(string $configurationDirectory, ?Parser $parser = null)
public function __construct(string $configurationDirectory, Parser $parser = null)
{
$this->configurationDirectory = $configurationDirectory;
$this->parser = $parser ?? new Parser();
Expand Down
4 changes: 2 additions & 2 deletions src/Model/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ class Document extends ElasticaDocument
{
private ?object $model;

public function __construct(?string $id, ?object $model = null, string|array $data = [], Index|string $index = '')
public function __construct(?string $id, object $model = null, string|array $data = [], Index|string $index = '')
{
parent::__construct($id, $data, $index);

$this->model = $model;
}

public static function createFromDocument(ElasticaDocument $document, ?object $model = null): self
public static function createFromDocument(ElasticaDocument $document, object $model = null): self
{
return new self($document->getId(), $model, $document->getData(), $document->getIndex());
}
Expand Down
2 changes: 1 addition & 1 deletion src/Transport/HttpClientTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class HttpClientTransport extends AbstractTransport
*/
private string $scheme;

public function __construct(HttpClientInterface $client, string $scheme = 'http', ?Connection $connection = null)
public function __construct(HttpClientInterface $client, string $scheme = 'http', Connection $connection = null)
{
parent::__construct($connection);

Expand Down
4 changes: 2 additions & 2 deletions tests/BaseTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected function setUp(): void
$this->getFactory()->buildClient()->request('*', 'DELETE');
}

protected function getFactory(?string $path = null, array $config = []): Factory
protected function getFactory(string $path = null, array $config = []): Factory
{
return new Factory($config + [
Factory::CONFIG_MAPPINGS_DIRECTORY => $path ?? __DIR__ . '/configs',
Expand All @@ -33,7 +33,7 @@ protected function getFactory(?string $path = null, array $config = []): Factory
]);
}

protected function getClient(?string $path = null, array $config = []): Client
protected function getClient(string $path = null, array $config = []): Client
{
return $this->getFactory($path, $config)->buildClient();
}
Expand Down
2 changes: 1 addition & 1 deletion tests/IndexBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public function testMigrate(): void
$this->assertInstanceOf(ElasticaDocument::class, $document);
}

private function getIndexBuilder(?string $path = null, array $config = []): IndexBuilder
private function getIndexBuilder(string $path = null, array $config = []): IndexBuilder
{
return $this->getFactory($path, $config)->buildIndexBuilder();
}
Expand Down
10 changes: 5 additions & 5 deletions tests/Messenger/MemoryQueuingFunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ final class MemoryQueuingFunctionalTest extends KernelTestCase
{
public function testFrameworkQueue(): void
{
static::bootKernel(['debug' => false]);
self::bootKernel(['debug' => false]);

/** @var InMemoryTransport $transport */
$transport = self::getContainer()->get('messenger.transport.queuing.test');
Expand All @@ -40,7 +40,7 @@ public function testFrameworkQueue(): void

public function testFrameworkKernelTerminateResend(): void
{
static::bootKernel(['debug' => false]);
self::bootKernel(['debug' => false]);

/** @var MessageBus $bus */
$bus = self::getContainer()->get('messenger.default_bus');
Expand All @@ -60,7 +60,7 @@ public function testFrameworkKernelTerminateResend(): void

// Simulate Kernel Response
$dispatcher->dispatch(
new ResponseEvent(static::$kernel, new Request(), Kernel::MASTER_REQUEST, new Response()),
new ResponseEvent(self::$kernel, new Request(), Kernel::MASTER_REQUEST, new Response()),
KernelEvents::RESPONSE
);

Expand All @@ -83,7 +83,7 @@ public function testFrameworkKernelTerminateResend(): void

public function testFrameworkKernelTerminateWithNoMessage(): void
{
static::bootKernel(['debug' => false]);
self::bootKernel(['debug' => false]);

/** @var InMemoryTransport $transport */
$transport = self::getContainer()->get('messenger.transport.queuing.test');
Expand All @@ -94,7 +94,7 @@ public function testFrameworkKernelTerminateWithNoMessage(): void

// Simulate Kernel Response
$dispatcher->dispatch(
new ResponseEvent(static::$kernel, new Request(), Kernel::MASTER_REQUEST, new Response()),
new ResponseEvent(self::$kernel, new Request(), Kernel::MASTER_REQUEST, new Response()),
KernelEvents::RESPONSE
);

Expand Down
4 changes: 2 additions & 2 deletions tests/Messenger/TestControllerFunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class TestControllerFunctionalTest extends WebTestCase
{
public function testControllerWithException(): void
{
$client = static::createClient();
$client = self::createClient();
$client->request('GET', '/with_exception');

/** @var InMemoryTransport $transport */
Expand All @@ -38,7 +38,7 @@ public function testControllerWithException(): void

public function testControllerWithResponse(): void
{
$client = static::createClient();
$client = self::createClient();
$client->request('GET', '/with_response');

/** @var InMemoryTransport $transport */
Expand Down
2 changes: 1 addition & 1 deletion tests/Transport/HttpClientTransportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ private function runOnBothAndCompare(Client $clientHttpClient, Client $clientNat

$this->assertInstanceOf(ExceptionInterface::class, $nativeException);
$this->assertInstanceOf(ExceptionInterface::class, $httpClientException);
$this->assertInstanceOf(\get_class($httpClientException), $nativeException);
$this->assertInstanceOf($httpClientException::class, $nativeException);
}
}

Expand Down

0 comments on commit 6f8e1b7

Please sign in to comment.