changed the way to access nodes and attributes from a node
authorFabien Potencier <fabien.potencier@gmail.com>
Sat, 2 Oct 2010 06:23:54 +0000 (08:23 +0200)
committerFabien Potencier <fabien.potencier@gmail.com>
Sat, 2 Oct 2010 06:29:25 +0000 (08:29 +0200)
commit29b020eb2f029d77ce0d055cf9212b33b787a50e
tree54c3f094d63b5133b948cb9f3bbe0970625ba8cc
parentb034e6545d2a1a1c1b84d736c41a6531fb65e10f
changed the way to access nodes and attributes from a node

Before:
  Nodes were accessed via node properties ($node->body)
  Attributes were accessed via node array access ($node['name'])

After:
  Nodes are accessed via getNode(), setNode(), ... ($node->getNode('body'))
  Attributes are accessed via getAttribute(), setAttribute(), ... ($node->getAttribute('name'))

The change was necessary because of side-effects. This is one more time the
demonstration that being explicit is always better than magic ;)
73 files changed:
CHANGELOG
doc/04-Extending-Twig.markdown
lib/Twig/Node.php
lib/Twig/Node/AutoEscape.php
lib/Twig/Node/Block.php
lib/Twig/Node/BlockReference.php
lib/Twig/Node/Expression/AssignName.php
lib/Twig/Node/Expression/Binary.php
lib/Twig/Node/Expression/Compare.php
lib/Twig/Node/Expression/Conditional.php
lib/Twig/Node/Expression/Constant.php
lib/Twig/Node/Expression/ExtensionReference.php
lib/Twig/Node/Expression/Filter.php
lib/Twig/Node/Expression/GetAttr.php
lib/Twig/Node/Expression/Name.php
lib/Twig/Node/Expression/Test.php
lib/Twig/Node/Expression/Unary.php
lib/Twig/Node/For.php
lib/Twig/Node/If.php
lib/Twig/Node/Import.php
lib/Twig/Node/Include.php
lib/Twig/Node/Macro.php
lib/Twig/Node/Module.php
lib/Twig/Node/Parent.php
lib/Twig/Node/Print.php
lib/Twig/Node/Sandbox.php
lib/Twig/Node/SandboxedModule.php
lib/Twig/Node/SandboxedPrint.php
lib/Twig/Node/Set.php
lib/Twig/Node/Text.php
lib/Twig/Node/Trans.php
lib/Twig/NodeTraverser.php
lib/Twig/NodeVisitor/Escaper.php
lib/Twig/NodeVisitor/Sandbox.php
lib/Twig/Parser.php
lib/Twig/TokenParser/For.php
test/Twig/Tests/Node/AutoEscapeTest.php
test/Twig/Tests/Node/BlockReferenceTest.php
test/Twig/Tests/Node/BlockTest.php
test/Twig/Tests/Node/Expression/ArrayTest.php
test/Twig/Tests/Node/Expression/AssignNameTest.php
test/Twig/Tests/Node/Expression/Binary/AddTest.php
test/Twig/Tests/Node/Expression/Binary/AndTest.php
test/Twig/Tests/Node/Expression/Binary/ConcatTest.php
test/Twig/Tests/Node/Expression/Binary/DivTest.php
test/Twig/Tests/Node/Expression/Binary/FloorDivTest.php
test/Twig/Tests/Node/Expression/Binary/ModTest.php
test/Twig/Tests/Node/Expression/Binary/MulTest.php
test/Twig/Tests/Node/Expression/Binary/OrTest.php
test/Twig/Tests/Node/Expression/Binary/SubTest.php
test/Twig/Tests/Node/Expression/CompareTest.php
test/Twig/Tests/Node/Expression/ConditionalTest.php
test/Twig/Tests/Node/Expression/ConstantTest.php
test/Twig/Tests/Node/Expression/FilterTest.php
test/Twig/Tests/Node/Expression/GetAttrTest.php
test/Twig/Tests/Node/Expression/NameTest.php
test/Twig/Tests/Node/Expression/Unary/NegTest.php
test/Twig/Tests/Node/Expression/Unary/NotTest.php
test/Twig/Tests/Node/Expression/Unary/PosTest.php
test/Twig/Tests/Node/ForTest.php
test/Twig/Tests/Node/IfTest.php
test/Twig/Tests/Node/ImportTest.php
test/Twig/Tests/Node/IncludeTest.php
test/Twig/Tests/Node/MacroTest.php
test/Twig/Tests/Node/ModuleTest.php
test/Twig/Tests/Node/ParentTest.php
test/Twig/Tests/Node/PrintTest.php
test/Twig/Tests/Node/SandboxTest.php
test/Twig/Tests/Node/SandboxedModuleTest.php
test/Twig/Tests/Node/SandboxedPrintTest.php
test/Twig/Tests/Node/SetTest.php
test/Twig/Tests/Node/TextTest.php
test/Twig/Tests/Node/TransTest.php