Permalink
Browse files

better handling for return values on Activity

  • Loading branch information...
1 parent 334493d commit 66714f876310f43c75a22704e85cf4306cf7ab4b @d1rk d1rk committed Mar 12, 2013
Showing with 4 additions and 3 deletions.
  1. +4 −3 core/Activity.php
View
@@ -81,11 +81,12 @@ protected static function _initConfig($name, $config) {
* @filter
*/
public static function track($type, array $data = array(), array $options = array()) {
- $defaults = array('name' => null);
+ $defaults = array('name' => null, 'scope' => array());
$options += $defaults;
- $result = true;
+ $result = array();
if ($name = $options['name']) {
+ unset($options['name']);
$methods = array($name => static::adapter($name)->track($type, $data, $options));
} else {
$methods = static::_configsByType($type, $data, $options);
@@ -94,7 +95,7 @@ public static function track($type, array $data = array(), array $options = arra
foreach ($methods as $name => $method) {
$params = compact('type', 'data', 'options');
$config = static::_config($name);
- $result &= static::_filter(__FUNCTION__, $params, $method, $config['filters']);
+ $result[] = static::_filter(__FUNCTION__, $params, $method, $config['filters']);
}
return $methods ? $result : false;
}

0 comments on commit 66714f8

Please sign in to comment.