if ( self::isEnabled() ) {
throw new Exception( 'Profiling is already enabled.' );
}
+
+ $args = [ $flags ];
+ if ( $options ) {
+ $args[] = $options;
+ }
+
self::$enabled = true;
self::callAny(
[
'tideways_enable',
'tideways_xhprof_enable'
],
- [ $flags, $options ]
+ $args
);
}
'tideways_disable',
'tideways_xhprof_disable'
] );
+ } else {
+ return null;
}
}
* Call the first available function from $functions.
* @param array $functions
* @param array $args
+ * @return mixed
* @throws Exception
*/
protected static function callAny( array $functions, array $args = [] ) {