function it_might_be_invokable(ReflectionClass $reflectionClass, ReflectionMethod $method, AnnotationScanner $annotations, TypeFactory $typeFactory, Type $type, Annotations $methodAnnotations) { $reflectionClass->getName()->willReturn('MyClass'); $method->getName()->willReturn('__invoke'); $method->getReturnType()->willReturn(null); $method->getDocBlockReturnTypes()->willReturn([]); $method->getParameters()->willReturn([]); $method->getDocComment()->willReturn(''); $reflectionClass->getMethods()->willReturn([$method]); $annotations->scanForAnnotations(Argument::any(), Argument::any(), $this->imports)->willReturn($methodAnnotations); $typeFactory->create(Argument::any(), Argument::any(), Argument::any(), Argument::any())->willReturn($type); $this->isInvokable()->shouldBe(true); $reflectionClass->getMethods()->willReturn([]); $this->isInvokable()->shouldBe(false); }