Skip to content

Commit

Permalink
[Config] Renaming the key attribute removal property for consistency …
Browse files Browse the repository at this point in the history
…per Johannes' recommendation. Also fixing a PHPDoc typo per Stof.
  • Loading branch information
weaverryan committed Feb 18, 2011
1 parent 663dcbc commit 48459e9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/Symfony/Component/Config/Definition/ArrayNode.php
Expand Up @@ -28,7 +28,7 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
protected $children;
protected $prototype;
protected $keyAttribute;
protected $keyAttributeIsRemoved;
protected $removeKeyAttribute;
protected $allowFalse;
protected $allowNewKeys;
protected $addIfNotSet;
Expand All @@ -49,7 +49,7 @@ public function __construct($name, NodeInterface $parent = null)

$this->children = array();
$this->xmlRemappings = array();
$this->keyAttributeIsRemoved = true;
$this->removeKeyAttribute = true;
$this->allowFalse = false;
$this->addIfNotSet = false;
$this->allowNewKeys = true;
Expand Down Expand Up @@ -115,9 +115,9 @@ public function setKeyAttribute($attribute)
*
* @param Boolean $remove Whether or not the key attribute should be removed.
*/
public function setKeyAttributeIsRemoved($remove)
public function setRemoveKeyAttribute($remove)
{
$this->keyAttributeIsRemoved = $remove;
$this->removeKeyAttribute = $remove;
}

/**
Expand Down Expand Up @@ -394,7 +394,7 @@ protected function normalizeValue($value)
$k = $v[$this->keyAttribute];

// remove the key attribute if configured to
if ($this->keyAttributeIsRemoved) {
if ($this->removeKeyAttribute) {
unset($v[$this->keyAttribute]);
}
}
Expand Down Expand Up @@ -497,7 +497,7 @@ protected function mergeValues($leftSide, $rightSide)
}

/**
* Set whether or not to this array should just prevent child values from
* Set whether or not this array should just prevent child values from
* keys that have no corresponding child nodes.
*
* If true (default), an exception will be thrown if unrecognized options
Expand Down
Expand Up @@ -167,7 +167,7 @@ protected function createArrayConfigNode(NodeBuilder $node)

if (null !== $node->key) {
$configNode->setKeyAttribute($node->key);
$configNode->setKeyAttributeIsRemoved($node->removeKeyItem);
$configNode->setRemoveKeyAttribute($node->removeKeyItem);
}

if (true === $node->atLeastOne) {
Expand Down
Expand Up @@ -129,7 +129,7 @@ public function testMappedAttributeKeyNotRemoved()
{
$node = new ArrayNode('root');
$node->setKeyAttribute('id');
$node->setKeyAttributeIsRemoved(false);
$node->setRemoveKeyAttribute(false);

$prototype = new ArrayNode(null);
$prototype->setPreventExtraKeys(false); // just so it allows anything
Expand Down

0 comments on commit 48459e9

Please sign in to comment.