Skip to content

Commit

Permalink
Defined readonly properties
Browse files Browse the repository at this point in the history
  • Loading branch information
ro-pi committed Mar 29, 2022
1 parent b7f838e commit d92958f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"ext-bcmath": "*",
"ext-mbstring": "*",
"ext-fileinfo": "*",
"php": ">=8.0.0",
"php": ">=8.1.0",
"guzzlehttp/psr7": "^2.0",
"symfony/polyfill-intl-idn": "^1.23"
},
Expand Down
4 changes: 2 additions & 2 deletions src/EvaluationConfig/StaticEvaluationConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class StaticEvaluationConfig
{
public /*readonly*/ SchemaPoolInterface $schemaPool;
public readonly SchemaPoolInterface $schemaPool;

/**
* @var DraftInterface[]
Expand All @@ -22,7 +22,7 @@ class StaticEvaluationConfig
* @param SchemaPoolInterface|null $schemaPool
*/
public function __construct(
public /*readonly*/ DraftInterface $defaultDraft,
public readonly DraftInterface $defaultDraft,
array $supportedDrafts = [],
?SchemaPoolInterface $schemaPool = null
) {
Expand Down
2 changes: 1 addition & 1 deletion src/EvaluationContext/RuntimeEvaluationContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class RuntimeEvaluationContext
public function __construct(
object|bool $schema,
mixed &$instance,
public /*readonly*/ StaticEvaluationContext $staticEvaluationContext
public readonly StaticEvaluationContext $staticEvaluationContext
) {
$this->schemaStack[0] = [
'schema' => $schema,
Expand Down
10 changes: 5 additions & 5 deletions src/EvaluationContext/RuntimeEvaluationResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ class RuntimeEvaluationResult
private ?bool $evaluationResult = null;

public function __construct(
public /*readonly*/ int $number,
public /*readonly*/ KeywordInterface $keyword,
public /*readonly*/ string $keywordLocation,
public /*readonly*/ string $instanceLocation,
public /*readonly*/ ?string $absoluteKeywordLocation
public readonly int $number,
public readonly KeywordInterface $keyword,
public readonly string $keywordLocation,
public readonly string $instanceLocation,
public readonly ?string $absoluteKeywordLocation
) {}

public function setEvaluationResult(bool $evaluationResult): void
Expand Down
2 changes: 1 addition & 1 deletion src/EvaluationContext/StaticEvaluationContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class StaticEvaluationContext

public function __construct(
object|bool $schema,
public /*readonly*/ StaticEvaluationConfig $config
public readonly StaticEvaluationConfig $config
) {
$this->draft = $this->config->defaultDraft;
$this->prioritizedSchemaKeywords = new \WeakMap();
Expand Down

0 comments on commit d92958f

Please sign in to comment.