Skip to content

Commit

Permalink
don't needlessly reimplement trait functions
Browse files Browse the repository at this point in the history
  • Loading branch information
AD7six committed Mar 25, 2014
1 parent 34a4dfa commit 1a75ce6
Showing 1 changed file with 5 additions and 22 deletions.
27 changes: 5 additions & 22 deletions src/View/StringTemplate.php
Expand Up @@ -28,7 +28,10 @@
*/
class StringTemplate {

use InstanceConfigTrait;
use InstanceConfigTrait {
config as add;
config as get;
}

/**
* List of attributes that can be made compact.
Expand Down Expand Up @@ -76,34 +79,14 @@ public function load($file) {
$this->add($templates);
}

/**
* Add one or more template strings.
*
* @param array $templates The templates to add.
* @return void
*/
public function add(array $templates) {
$this->config($templates);
}

/**
* Get one or all templates.
*
* @param string $name Leave null to get all templates, provide a name to get a single template.
* @return string|array|null Either the template(s) or null
*/
public function get($name = null) {
return $this->config($name);
}

/**
* Remove the named template.
*
* @param string $name The template to remove.
* @return void
*/
public function remove($name) {
unset($this->_config[$name]);
$this->config($name, null);
}

/**
Expand Down

0 comments on commit 1a75ce6

Please sign in to comment.