public function satisfies(iRequirement $requirement, iResponsible $responsible) { $requiredClass = new ReflectionClass($requirement->getClass()); $givenClass = new ReflectionClass($responsible->getResponsibility()); return $this->isSatisfiedBy($requiredClass, $givenClass); }
public function add(Responsible $responsible) { $this->responsibles[$responsible->getResponsibility()] = $responsible; return $this; }
function it_shouldnt_satisfy_a_class_with_an_object_of_another_class(Requirement $requirement, Responsible $responsible) { $requirement->getClass()->willReturn(aClass::class); $responsible->getResponsibility()->willReturn(anotherClass::class); $this->satisfies($requirement, $responsible)->shouldReturn(false); }