Permalink
Browse files

Remove composite

composite::__construct() is not compatible with
base::__construct(), which throws warnings in PHP 5.4. This class
wasn't really that useful and may have even been buggy anyways.
  • Loading branch information...
1 parent 587dc81 commit d4789514767fcd626d23bb2191571278a2452969 @Swahvay Swahvay committed Nov 11, 2012
Showing with 0 additions and 66 deletions.
  1. +0 −66 php-lib/core.php
View
@@ -615,72 +615,6 @@ protected function &__xhpChildrenDeclaration() {
}
/**
- * :x:composite is a special class which allows you to pass around a node that
- * acts on another node, but any `appendChild()` calls will append to one of its
- * children.
- *
- * This can be useful if you want to pass around an object that will later be
- * wrapped on the inside.
- *
- * For instance, you can define an :x:composite like this:
- * $parent = <div><p>{$anchor = <span />}</p></div>;
- * $composite = new :x:composite($parent, $anchor);
- *
- * Then if another client wants to wrap the contents of your composite node,
- * he would do so by:
- * $composite->appendChild($anchor = <b />);
- * $composite = new :x:composite($composite, $anchor);
- *
- * Note that we create another composite from the old one so that later down the
- * line we can wrap again with another tag.
- *
- * IMPORTANT: I think this class is broken right now. If you want to use it you
- * should try to fix it.
- */
-class :x:composite extends :x:base {
- private
- $parent,
- $anchor;
-
- public function __construct(:x:base $parent, :x:base $anchor) {
- $this->parent = $parent;
- $this->anchor = $anchor;
- }
-
- public function appendChild($child) {
- return $this->anchor->appendChild($child);
- }
-
- public function getAttribute($attr) {
- return $this->parent->getAttribute($attr);
- }
-
- public function setAttribute($attr, $val) {
- return $this->parent->setAttribute($attr, $val);
- }
-
- public function categoryOf($cat) {
- return $this->parent->categoryOf($cat);
- }
-
- public function __toString() {
- return $this->parent->__toString();
- }
-
- protected static function &__xhpAttributeDeclaration() {
- return $this->parent->__xhpAttributeDeclaration();
- }
-
- protected function &__xhpCategoryDeclaration() {
- return $this->parent->__xhpCategoryDeclaration();
- }
-
- protected function &__xhpChildrenDeclaration() {
- return $this->parent->__xhpChildrenDeclaration();
- }
-}
-
-/**
* An <x:frag /> is a transparent wrapper around any number of elements. When
* you render it just the children will be rendered. When you append it to an
* element the <x:frag /> will disappear and each child will be sequentially

0 comments on commit d478951

Please sign in to comment.