From 24ba87f5de56fd759e20156640c37edf3507517b Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 8 Aug 2011 08:31:57 -0500 Subject: [PATCH] Refactoring Asset class. --- system/asset.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/system/asset.php b/system/asset.php index 4f43313d..bd8c318c 100644 --- a/system/asset.php +++ b/system/asset.php @@ -76,7 +76,9 @@ public function __construct($name) */ public function add($name, $source, $dependencies = array(), $attributes = array()) { - return call_user_func(array($this, (File::extension($source) == 'css') ? 'style' : 'script'), $name, $source, $dependencies, $attributes); + $type = (File::extension($source) == 'css') ? 'style' : 'script'; + + return call_user_func(array($this, $type), $name, $source, $dependencies, $attributes); } /** @@ -200,10 +202,7 @@ public function get_script($name) */ private function get_asset($group, $name) { - if ( ! isset($this->assets[$group][$name])) - { - return ''; - } + if ( ! isset($this->assets[$group][$name])) return ''; $asset = $this->assets[$group][$name];