Skip to content

Commit

Permalink
Improve property type hinting
Browse files Browse the repository at this point in the history
  • Loading branch information
LucWollants committed Sep 10, 2024
1 parent b61db49 commit 0c0ac7f
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 79 deletions.
10 changes: 2 additions & 8 deletions app/Console/AbstractMappingCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,9 @@

abstract class AbstractMappingCommand extends AbstractElasticSearchCommand
{
/**
* @var string
*/
protected $indexName;
protected string $indexName;

/**
* @var string
*/
protected $documentType;
protected string $documentType;

public function __construct(Client $client, string $indexName, string $documentType)
{
Expand Down
26 changes: 7 additions & 19 deletions app/Console/AbstractReindexCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,13 @@

abstract class AbstractReindexCommand extends AbstractElasticSearchCommand
{
/**
* @var string
*/
private $readIndexName;

/**
* @var string
*/
private $scrollTtl;

/**
* @var int
*/
private $scrollSize;

/**
* @var int
*/
private $bulkThreshold;
private string $readIndexName;

private string $scrollTtl;

private int $scrollSize;

private int $bulkThreshold;

private EventBus $eventBus;

Expand Down
2 changes: 1 addition & 1 deletion src/ElasticSearch/Aggregation/Aggregation.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ final class Aggregation
/**
* @var Bucket[]
*/
private $buckets;
private array $buckets;

/**
* @param Bucket ...$buckets
Expand Down
5 changes: 1 addition & 4 deletions src/ElasticSearch/JsonDocument/Properties/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ final class Url
{
private string $url;

/**
* @var array
*/
private $urlParts;
private array $urlParts;

public function __construct(string $url)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,9 @@ abstract class AbstractReindexUDB3CoreOperation extends AbstractElasticSearchOpe
{
private EventBus $eventBus;

/**
* @var string
*/
private $scrollTtl;
private string $scrollTtl;

/**
* @var int
*/
private $scrollSize;
private int $scrollSize;

public function __construct(
Client $client,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ final class CompositeOfferRequestParser implements OfferRequestParserInterface
/**
* @var OfferRequestParserInterface[]
*/
private $parsers = [];
private array $parsers = [];

public function __construct()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ final class CompositeOrganizerRequestParser implements OrganizerRequestParser
/**
* @var OrganizerRequestParser[]
*/
private $parsers = [];
private array $parsers = [];

public function __construct()
{
Expand Down
2 changes: 1 addition & 1 deletion src/JsonDocument/CompositeJsonTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ final class CompositeJsonTransformer implements JsonTransformer
/**
* @var JsonTransformer[]
*/
private $jsonTransformers;
private array $jsonTransformers;

public function __construct(JsonTransformer ...$jsonTransformers)
{
Expand Down
6 changes: 1 addition & 5 deletions src/Language/MultilingualString.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ final class MultilingualString

private string $originalString;

/**
* @var string[]
* Associative array with languages as keys and translations as values.
*/
private $translations;
private array $translations;

public function __construct(Language $originalLanguage, string $originalString)
{
Expand Down
2 changes: 1 addition & 1 deletion src/PagedResultSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class PagedResultSet
/**
* @var FacetTreeInterface[]
*/
private $facets;
private array $facets;

/**
* @param JsonDocument[] $results
Expand Down
5 changes: 1 addition & 4 deletions tests/AMQP/DomainMessageJSONDeserializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@

final class DomainMessageJSONDeserializerTest extends TestCase
{
/**
* @var DomainMessageJSONDeserializer
*/
protected $domainMessageJSONDeserializer;
protected DomainMessageJSONDeserializer $domainMessageJSONDeserializer;

protected function setUp(): void
{
Expand Down
10 changes: 2 additions & 8 deletions tests/AMQP/Dummies/DummyEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,9 @@

final class DummyEvent implements Serializable
{
/**
* @var string
*/
private $id;
private string $id;

/**
* @var string
*/
private $content;
private string $content;

public function __construct(string $id, string $content)
{
Expand Down
5 changes: 1 addition & 4 deletions tests/Deserializer/SimpleDeserializerLocatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@

final class SimpleDeserializerLocatorTest extends TestCase
{
/**
* @var SimpleDeserializerLocator
*/
protected $deserializerLocator;
protected SimpleDeserializerLocator $deserializerLocator;

public function setUp(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,13 @@ final class NodeMapAggregationTransformerTest extends TestCase
{
private FacetName $facetName;

/**
* @var array
*/
private $nodeMap;


private NodeMapAggregationTransformer $transformer;

protected function setUp(): void
{
$this->facetName = FacetName::regions();

$this->nodeMap = [
$nodeMap = [
'prv-vlaams-brabant' => [
'name' => [
'nl' => 'Vlaams-Brabant',
Expand Down Expand Up @@ -82,7 +76,7 @@ protected function setUp(): void

$this->transformer = new NodeMapAggregationTransformer(
$this->facetName,
$this->nodeMap
$nodeMap
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@

final class JsonLdPolyfillJsonTransformerTest extends TestCase
{
/**
* @var array
* The JSON-LD that should be poly-filled
*/
private $given;

private array $given;

private JsonLdPolyfillJsonTransformer $transformer;

Expand Down

0 comments on commit 0c0ac7f

Please sign in to comment.