From 95a99e71c6f135340a0d8e1299d57321b4ea7508 Mon Sep 17 00:00:00 2001 From: vrana Date: Fri, 14 Dec 2012 17:00:43 -0800 Subject: [PATCH] Require Conduit methods to be instances of ConduitAPIMethod Test Plan: Deleted `extends ConduitAPIMethod`, then: $ echo '{}' | arc call-conduit conduit.ping Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4190 --- src/applications/conduit/call/ConduitCall.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/applications/conduit/call/ConduitCall.php b/src/applications/conduit/call/ConduitCall.php index 738be10831..54130cd359 100644 --- a/src/applications/conduit/call/ConduitCall.php +++ b/src/applications/conduit/call/ConduitCall.php @@ -81,7 +81,15 @@ final class ConduitCall { "base class."); } - return newv($method_class, array()); + $method = newv($method_class, array()); + + if (!($method instanceof ConduitAPIMethod)) { + throw new ConduitException( + "Method '{$method}' is not valid; the implementation must be ". + "a subclass of ConduitAPIMethod."); + } + + return $method; }