Skip to content

Commit e2c3f0c

Browse files
committed
Make additional and pattern property names unique, closes #56
1 parent 32ef8f4 commit e2c3f0c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Structure/ObjectItemTrait.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,22 @@ public function setNestedProperty($propertyName, $value, Egg $nestedEgg)
4343
protected $__additionalPropertyNames;
4444
public function addAdditionalPropertyName($name)
4545
{
46-
$this->__additionalPropertyNames[] = $name;
46+
$this->__additionalPropertyNames[$name] = true;
4747
}
4848

4949
/**
5050
* @return null|string[]
5151
*/
5252
public function getAdditionalPropertyNames()
5353
{
54-
return $this->__additionalPropertyNames;
54+
return array_keys($this->__additionalPropertyNames);
5555
}
5656

5757
protected $__patternPropertyNames;
5858

5959
public function addPatternPropertyName($pattern, $name)
6060
{
61-
$this->__patternPropertyNames[$pattern][] = $name;
61+
$this->__patternPropertyNames[$pattern][$name] = true;
6262
}
6363

6464
/**
@@ -68,7 +68,7 @@ public function addPatternPropertyName($pattern, $name)
6868
public function getPatternPropertyNames($pattern)
6969
{
7070
if (isset($this->__patternPropertyNames[$pattern])) {
71-
return $this->__patternPropertyNames[$pattern];
71+
return array_keys($this->__patternPropertyNames[$pattern]);
7272
} else {
7373
return null;
7474
}

0 commit comments

Comments
 (0)