mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-28 18:50:11 +02:00
strong typing based on interface, not object
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user