src/Component.php
public function addComponent(self $component, $key = null)
    {
        if (null == $key) {
            $this->components[] = $component;
        } else {
            $this->components[$key] = $component;
        }
    }
public function addComponent(self $component, $key = null)
    {
        if (null == $key) {
            $this->components[] = $component;
        } else {
            $this->components[$key] = $component;
        }
    }
public function addComponent ( self $ component , $ key = null ) { if ( null == $ key ) { $ this -> components [ ] = $ component ; } else { $ this -> components [ $ key ] = $ component ; } }
Adds a Component.

If $key is given, the component at $key will be replaced else the component will be append.

@param Component $component The Component that will be added
@param null      $key       The key of the Component
Adds a Component .