From 029a9293f0f66b3de78601599890f5aca04c38cc Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Mon, 4 Mar 2013 18:07:09 +0100 Subject: [PATCH] Use call_user_func() instead of direct variable (only in PHP 5.4). --- composer.lock | 21 +++++++++++++++------ lib/Client.php | 6 ++++-- lib/Loop.php | 4 ++-- lib/XCP.php | 2 +- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/composer.lock b/composer.lock index dd75b8e..c550248 100644 --- a/composer.lock +++ b/composer.lock @@ -146,12 +146,12 @@ "source": { "type": "git", "url": "https://github.com/vatesfr/eventus.git", - "reference": "27efc85692f8f77531f0864da30a3724890a44b7" + "reference": "472924725b04ec8c6452b86d97ae7fe84dff43ad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vatesfr/eventus/zipball/27efc85692f8f77531f0864da30a3724890a44b7", - "reference": "27efc85692f8f77531f0864da30a3724890a44b7", + "url": "https://api.github.com/repos/vatesfr/eventus/zipball/472924725b04ec8c6452b86d97ae7fe84dff43ad", + "reference": "472924725b04ec8c6452b86d97ae7fe84dff43ad", "shasum": "" }, "require": { @@ -180,7 +180,7 @@ "keywords": [ "event" ], - "time": "2013-02-16 11:40:13" + "time": "2013-03-04 17:11:11" }, { "name": "vates/rekodi", @@ -225,7 +225,9 @@ "time": "2013-03-03 13:25:27" } ], - "packages-dev": null, + "packages-dev": [ + + ], "aliases": [ ], @@ -234,5 +236,12 @@ "ircmaxell/password-compat": 20, "vates/eventus": 20, "vates/rekodi": 20 - } + }, + "platform": { + "php": ">=5.3.0", + "ext-xmlrpc": "*" + }, + "platform-dev": [ + + ] } diff --git a/lib/Client.php b/lib/Client.php index f327512..e447bbb 100644 --- a/lib/Client.php +++ b/lib/Client.php @@ -162,8 +162,10 @@ final class Client extends Base if (isset($this->_methods[$method])) { - $_ = $this->_methods[$method]; - $error = $_($id, $params, $this); + $error = call_user_func( + $this->_methods[$method], + $id, $params, $this + ); } else { diff --git a/lib/Loop.php b/lib/Loop.php index e2d5fca..8b2abcb 100644 --- a/lib/Loop.php +++ b/lib/Loop.php @@ -120,7 +120,7 @@ final class Loop extends Base foreach ($read as $handle) { $callback = $this->_readCallbacks[(int) $handle]; - $result = $callback($handle, $user_data); + $result = call_user_func($callback, $handle, $user_data); if (!is_resource($handle)) { @@ -134,7 +134,7 @@ final class Loop extends Base foreach ($write as $handle) { $callback = $this->_writeCallbacks[(int) $handle]; - $result = $callback($handle, $user_data); + $result = call_user_func($callback, $handle, $user_data); if (!is_resource($handle)) { diff --git a/lib/XCP.php b/lib/XCP.php index ff5763d..54b951b 100644 --- a/lib/XCP.php +++ b/lib/XCP.php @@ -92,7 +92,7 @@ final class XCP extends Base if ($request[0] !== null) { $callback = $request[0]; - $result = $callback($response, $this); + $result = call_user_func($callback, $response, $this); if ($result === true) { $this->_queue[] = $request;