Skip to content

Commit fcde9c6

Browse files
committed
Options: setFillRawValues() -> setTrackRawValues()
1 parent 3be4b48 commit fcde9c6

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed

src/Processing/DefaultProcessor.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ private function fillObject(
619619
$meta = $callContext->getMeta();
620620

621621
// Set raw data
622-
if ($options->isFillRawValues()) {
622+
if ($options->isTrackRawValues()) {
623623
$this->rawValuesMap->setRawValues($object, $rawData);
624624
}
625625

@@ -657,9 +657,6 @@ private function createHolder(string $class, ClassRuntimeMeta $meta, ?MappedObje
657657
return new ObjectHolder($this->objectCreator, $meta, $class, $object);
658658
}
659659

660-
/**
661-
* @return mixed
662-
*/
663660
public function getRawValues(MappedObject $object)
664661
{
665662
return $this->rawValuesMap->getRawValues($object);

src/Processing/Options.php

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ final class Options
1717

1818
private bool $prefillDefaultValues = false;
1919

20-
private bool $fillRawValues = false;
20+
private bool $trackRawValues = false;
2121

2222
/** @var array<class-string, object> */
2323
private array $dynamicContexts = [];
@@ -68,20 +68,14 @@ public function isPrefillDefaultValues(): bool
6868
return $this->prefillDefaultValues;
6969
}
7070

71-
/**
72-
* Make user-sent values accessible by $mappedObject->getRawValues()
73-
* Used only if objects are initialized
74-
* Use only for debug, it may lead to significant raw data grow in bigger hierarchies
75-
* you can set data to a custom property in before class callback, if are always needed
76-
*/
77-
public function setFillRawValues(bool $fill = true): void
71+
public function setTrackRawValues(bool $fill = true): void
7872
{
79-
$this->fillRawValues = $fill;
73+
$this->trackRawValues = $fill;
8074
}
8175

82-
public function isFillRawValues(): bool
76+
public function isTrackRawValues(): bool
8377
{
84-
return $this->fillRawValues;
78+
return $this->trackRawValues;
8579
}
8680

8781
public function addDynamicContext(object $context): void

tests/Unit/Processing/DefaultProcessorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ public function testInitialization(): void
455455
public function testTransformation(): void
456456
{
457457
$options = new Options();
458-
$options->setFillRawValues();
458+
$options->setTrackRawValues();
459459

460460
$data = [
461461
'bool' => 'true',
@@ -697,7 +697,7 @@ public function testPropertyCallbacksFailure(): void
697697
public function testBeforeClassCallbackMixedValue(): void
698698
{
699699
$options = new Options();
700-
$options->setFillRawValues();
700+
$options->setTrackRawValues();
701701

702702
$vo = null;
703703
$exception = null;

0 commit comments

Comments
 (0)