public function __construct(int
$magicMethods = self::MAGIC_GET | self::MAGIC_SET, int
$throw = self::THROW_ON_INVALID_PROPERTY_PATH, CacheItemPoolInterface
$cacheItemPool = null, PropertyReadInfoExtractorInterface
$readInfoExtractor = null, PropertyWriteInfoExtractorInterface
$writeInfoExtractor = null
) { $this->magicMethodsFlags =
$magicMethods;
$this->ignoreInvalidIndices = 0
=== ($throw & self::THROW_ON_INVALID_INDEX
);
$this->cacheItemPool =
$cacheItemPool instanceof NullAdapter ? null :
$cacheItemPool; // Replace the NullAdapter by the null value
$this->ignoreInvalidProperty = 0
=== ($throw & self::THROW_ON_INVALID_PROPERTY_PATH
);
$this->readInfoExtractor =
$readInfoExtractor ??
new ReflectionExtractor([], null, null, false
);
$this->writeInfoExtractor =
$writeInfoExtractor ??
new ReflectionExtractor(['set'
], null, null, false
);
} public function getValue(object|array
$objectOrArray, string|PropertyPathInterface
$propertyPath): mixed
{ $zval =
[ self::VALUE =>
$objectOrArray,
];
if (\
is_object($objectOrArray) && false ===
strpbrk((string) $propertyPath, '.[?'
)) { return $this->
readProperty($zval,
$propertyPath,
$this->ignoreInvalidProperty
)[self::VALUE
];
}