|
|
|
@ -50,7 +50,7 @@ trait TMultiLevelProperties {
|
|
|
|
|
*
|
|
|
|
|
* @throws UnexpectedValueException If property is not set AND $default is Null
|
|
|
|
|
*/
|
|
|
|
|
public function getProperty ($name, mixed $default = null) {
|
|
|
|
|
public function getProperty ($name, mixed $default = null): mixed {
|
|
|
|
|
if (!$this->hasProperty($name)) {
|
|
|
|
|
if ($default === null) {
|
|
|
|
|
throw new UnexpectedValueException('The "' . $name . '" property is not set');
|
|
|
|
@ -86,11 +86,11 @@ trait TMultiLevelProperties {
|
|
|
|
|
/**
|
|
|
|
|
* Get array of levels of a property name
|
|
|
|
|
*
|
|
|
|
|
* @param string|string[]|IArrayCast $propertyName The property name
|
|
|
|
|
* @param string|IArrayCast|string[] $propertyName The property name
|
|
|
|
|
*
|
|
|
|
|
* @return InsensitiveCaseKeyImmutableCollection The property levels
|
|
|
|
|
*/
|
|
|
|
|
private function getPropertyLevels ($propertyName): InsensitiveCaseKeyImmutableCollection {
|
|
|
|
|
private function getPropertyLevels (array|IArrayCast|string $propertyName): InsensitiveCaseKeyImmutableCollection {
|
|
|
|
|
if ($propertyName instanceof IArrayCast) {
|
|
|
|
|
$parts = $propertyName->toArray();
|
|
|
|
|
}
|
|
|
|
|