File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,24 @@ public function getPath(): array {
8484 * @return array<string|int>
8585 */
8686 public function getPropertyPath (): array {
87- return array_values (array_filter ($ this ->getPath (), fn ($ value ) => 'properties ' !== $ value && '' !== $ value ));
87+ $ consecutivePropertiesCount = 0 ;
88+ return array_values (array_filter (
89+ $ this ->getPath (),
90+ function ($ value ) use (&$ consecutivePropertiesCount ) {
91+ // There might be a property named "properties" and the corresponding
92+ // scope would contain ".../properties/properties/...". Thus, we cannot
93+ // just filter out every occurrence of "properties".
94+ if ('properties ' === $ value ) {
95+ $ consecutivePropertiesCount ++;
96+
97+ return $ consecutivePropertiesCount % 2 === 0 ;
98+ }
99+
100+ $ consecutivePropertiesCount = 0 ;
101+
102+ return '' !== $ value ;
103+ }
104+ ));
88105 }
89106
90107 public function getScope (): string {
You can’t perform that action at this time.
0 commit comments