Commit b37c5045 authored by Patrick Barroca's avatar Patrick Barroca 🐧

php7 compatibility

parent 4afb442b
......@@ -404,9 +404,12 @@ class Storm_Model_Loader {
public function findAllBy($args) {
$filter_given_func = isset($args['callback']) ? $args['callback'] : null;
$filter_func = isset($args['select'])
? function($model) use($args){ return $model->$args['select'](); }
: null;
$filter_func = null;
if (isset($args['select'])) {
$select = $args['select'];
$filter_func = function($model) use($select) { return $model->$select(); };
}
unset($args['select']);
unset($args['callback']);
......
......@@ -65,7 +65,8 @@ class Storm_Test_ObjectWrapper {
* @return Storm_Test_ObjectWrapper
*/
public static function mock($name = '') {
if (!$name) $name = 'from '.xdebug_call_file().':'.xdebug_call_line();
if (!$name && function_exists('xdebug_call_file') && function_exists('xdebug_call_line'))
$name = 'from '.xdebug_call_file().':'.xdebug_call_line();
return self::on(new Storm_Test_Mock($name));
}
......
......@@ -31,7 +31,10 @@ trait Storm_Test_THelpers {
public function mock() {
return Storm_Test_ObjectWrapper::mock('from '.xdebug_call_file().':'.xdebug_call_line());
$name = (function_exists('xdebug_call_file') && function_exists('xdebug_call_line'))
? 'from '.xdebug_call_file().':'.xdebug_call_line()
: '';
return Storm_Test_ObjectWrapper::mock($name);
}
......
zf @ 0f49c4f1
Subproject commit 5282218c4331c9b10da73917340c3b6c7c0af465
Subproject commit 0f49c4f1d0c252fd1d0f3066fcb0d9a449de2551
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment