|
@@ 80-86 (lines=7) @@
|
| 77 |
|
|
| 78 |
|
$propertyPath = $this->resolveSubVariableReferences($subject, $propertyPath); |
| 79 |
|
$propertyPathSegments = explode('.', $propertyPath); |
| 80 |
|
foreach ($propertyPathSegments as $index => $pathSegment) { |
| 81 |
|
$accessor = isset($accessors[$index]) ? $accessors[$index] : null; |
| 82 |
|
$subject = $this->extractSingleValue($subject, $pathSegment, $accessor); |
| 83 |
|
if ($subject === null) { |
| 84 |
|
break; |
| 85 |
|
} |
| 86 |
|
} |
| 87 |
|
return $subject; |
| 88 |
|
} |
| 89 |
|
|
|
@@ 99-110 (lines=12) @@
|
| 96 |
|
{ |
| 97 |
|
$accessors = []; |
| 98 |
|
$propertyPathSegments = explode('.', $propertyPath); |
| 99 |
|
foreach ($propertyPathSegments as $index => $pathSegment) { |
| 100 |
|
$accessor = $this->detectAccessor($subject, $pathSegment); |
| 101 |
|
if ($accessor === null) { |
| 102 |
|
// Note: this may include cases of sub-variable references. When such |
| 103 |
|
// a reference is encountered the accessor chain is stopped and new |
| 104 |
|
// accessors will be detected for the sub-variable and all following |
| 105 |
|
// path segments since the variable is now fully dynamic. |
| 106 |
|
break; |
| 107 |
|
} |
| 108 |
|
$accessors[] = $accessor; |
| 109 |
|
$subject = $this->extractSingleValue($subject, $pathSegment); |
| 110 |
|
} |
| 111 |
|
return $accessors; |
| 112 |
|
} |
| 113 |
|
|