public function addSnippets(array $snippets = null) {

        // register default snippets
        $this->add(new DefaultSnippets());

        if(!is_null($snippets)) {
            foreach ($snippets as $snippet=>$definition) {
                if ($definition instanceof Snippets) {
                    $this->add($definition);
                } else {
                    $this->add($snippet, $definition);
                }
            }
        }
    }