Skip to content

Commit 8f0f761

Browse files
committed
Rename configuration options
1 parent 68f19f6 commit 8f0f761

File tree

10 files changed

+25
-25
lines changed

10 files changed

+25
-25
lines changed

example/01.normalization/08.object-output-normalization.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function __construct(
2323

2424
$mapper = new Mapper(
2525
config: new Configuration(
26-
isObjectAsArray: true,
26+
objectAsArray: true,
2727
),
2828
);
2929

example/04.mapping-readers/02.attribute-mapping.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function __construct(
2222
);
2323

2424
$mapper = new Mapper($platform, new Configuration(
25-
isStrictTypes: false,
25+
strictTypes: false,
2626
));
2727

2828
var_dump($mapper->denormalize([

example/04.mapping-readers/03.phpdoc-mapping.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct(
3333
);
3434

3535
$mapper = new Mapper($platform, new Configuration(
36-
isStrictTypes: false,
36+
strictTypes: false,
3737
));
3838

3939
var_dump($mapper->denormalize([

example/04.mapping-readers/04.array-mapping.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function __construct(
2626
);
2727

2828
$mapper = new Mapper($platform, new Configuration(
29-
isStrictTypes: false,
29+
strictTypes: false,
3030
));
3131

3232
var_dump($mapper->denormalize([

example/04.mapping-readers/05.php-config-mapping.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function __construct(
2222
);
2323

2424
$mapper = new Mapper($platform, new Configuration(
25-
isStrictTypes: false,
25+
strictTypes: false,
2626
));
2727

2828
var_dump($mapper->denormalize([

example/04.mapping-readers/06.yaml-config-mapping.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function __construct(
2222
);
2323

2424
$mapper = new Mapper($platform, new Configuration(
25-
isStrictTypes: false,
25+
strictTypes: false,
2626
));
2727

2828
var_dump($mapper->denormalize([

example/04.mapping-readers/07.neon-config-mapping.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function __construct(
2222
);
2323

2424
$mapper = new Mapper($platform, new Configuration(
25-
isStrictTypes: false,
25+
strictTypes: false,
2626
));
2727

2828
var_dump($mapper->denormalize([

src/Configuration.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
final class Configuration
1111
{
1212
/**
13-
* Default value for {@see $isObjectAsArray} option.
13+
* Default value for {@see $objectAsArray} option.
1414
*/
1515
public const OBJECT_AS_ARRAY_DEFAULT_VALUE = true;
1616

1717
/**
18-
* Default value for {@see $isStrictTypes} option.
18+
* Default value for {@see $strictTypes} option.
1919
*/
2020
public const STRICT_TYPES_DEFAULT_VALUE = true;
2121

@@ -25,12 +25,12 @@ public function __construct(
2525
* associative arrays, otherwise anonymous {@see object} will be
2626
* returned.
2727
*/
28-
private readonly ?bool $isObjectAsArray = null,
28+
private readonly ?bool $objectAsArray = null,
2929
/**
3030
* If this option contains {@see true}, then strict types will
3131
* be enabled.
3232
*/
33-
private readonly ?bool $isStrictTypes = null,
33+
private readonly ?bool $strictTypes = null,
3434
/**
3535
* Enable or disable type parsing logs
3636
*/
@@ -90,8 +90,8 @@ public function __construct(
9090
public function withObjectAsArray(?bool $enabled = null): self
9191
{
9292
return new self(
93-
isObjectAsArray: $enabled,
94-
isStrictTypes: $this->isStrictTypes,
93+
objectAsArray: $enabled,
94+
strictTypes: $this->strictTypes,
9595
logTypeParse: $this->logTypeParse,
9696
logTypeFind: $this->logTypeFind,
9797
logTypeMatch: $this->logTypeMatch,
@@ -113,7 +113,7 @@ public function withObjectAsArray(?bool $enabled = null): self
113113
*/
114114
public function isObjectAsArray(): bool
115115
{
116-
return $this->isObjectAsArray
116+
return $this->objectAsArray
117117
?? self::OBJECT_AS_ARRAY_DEFAULT_VALUE;
118118
}
119119

@@ -124,7 +124,7 @@ public function isObjectAsArray(): bool
124124
*/
125125
public function isObjectAsArrayOptionDefined(): bool
126126
{
127-
return $this->isObjectAsArray !== null;
127+
return $this->objectAsArray !== null;
128128
}
129129

130130
/**
@@ -137,8 +137,8 @@ public function isObjectAsArrayOptionDefined(): bool
137137
public function withStrictTypes(?bool $enabled = null): self
138138
{
139139
return new self(
140-
isObjectAsArray: $this->isObjectAsArray,
141-
isStrictTypes: $enabled,
140+
objectAsArray: $this->objectAsArray,
141+
strictTypes: $enabled,
142142
logTypeParse: $this->logTypeParse,
143143
logTypeFind: $this->logTypeFind,
144144
logTypeMatch: $this->logTypeMatch,
@@ -161,7 +161,7 @@ public function withStrictTypes(?bool $enabled = null): self
161161
*/
162162
public function isStrictTypesEnabled(): bool
163163
{
164-
return $this->isStrictTypes
164+
return $this->strictTypes
165165
?? self::STRICT_TYPES_DEFAULT_VALUE;
166166
}
167167

@@ -172,7 +172,7 @@ public function isStrictTypesEnabled(): bool
172172
*/
173173
public function isStrictTypesOptionDefined(): bool
174174
{
175-
return $this->isStrictTypes !== null;
175+
return $this->strictTypes !== null;
176176
}
177177

178178
/**

tests/Context/ContextConfigMutationTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ public function testConfigRollbackAfterMultipleEntrance(): void
7878
public function testNonDefaultConfigRollbackAfterMultipleEntrance(): void
7979
{
8080
$context = $this->createNormalizationContext(42, new Configuration(
81-
isObjectAsArray: false,
82-
isStrictTypes: false,
81+
objectAsArray: false,
82+
strictTypes: false,
8383
));
8484

8585
self::assertFalse($context->config->isStrictTypesEnabled());
@@ -106,8 +106,8 @@ public function testNonDefaultConfigRollbackAfterMultipleEntrance(): void
106106
public function testOnlyOneConfigChanged(): void
107107
{
108108
$context = $this->createNormalizationContext(42, new Configuration(
109-
isObjectAsArray: false,
110-
isStrictTypes: false,
109+
objectAsArray: false,
110+
strictTypes: false,
111111
));
112112

113113
self::assertFalse($context->config->isStrictTypesEnabled());

tests/TestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ protected function createConfiguration(
4646
bool $objectAsArray = Configuration::OBJECT_AS_ARRAY_DEFAULT_VALUE,
4747
): Configuration {
4848
return new Configuration(
49-
isObjectAsArray: $objectAsArray,
50-
isStrictTypes: $strictTypes,
49+
objectAsArray: $objectAsArray,
50+
strictTypes: $strictTypes,
5151
);
5252
}
5353

0 commit comments

Comments
 (0)