Skip to content

Commit

Permalink
better handling for return values on Activity
Browse files Browse the repository at this point in the history
  • Loading branch information
d1rk committed Mar 12, 2013
1 parent 334493d commit 66714f8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/Activity.php
Expand Up @@ -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);
Expand All @@ -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;
}
Expand Down

0 comments on commit 66714f8

Please sign in to comment.