From 9a2536bc56f981abfb894e4f5f1df3c67c2803a3 Mon Sep 17 00:00:00 2001 From: Trismegiste Date: Sat, 17 Aug 2013 19:23:57 -0400 Subject: [PATCH] strong typing based on interface, not object --- Visitor/Role.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Visitor/Role.php b/Visitor/Role.php index baaefe9..83ee912 100644 --- a/Visitor/Role.php +++ b/Visitor/Role.php @@ -28,7 +28,7 @@ abstract class Role preg_match('#([^\\\\]+)$#', $fqcn, $extract); $visitingMethod = 'visit' . $extract[1]; - if (!method_exists($visitor, $visitingMethod)) { + if (!method_exists('DesignPatterns\Visitor\RoleVisitor', $visitingMethod)) { throw new \InvalidArgumentException("The visitor you provide cannot visit a $fqcn object"); }