Given the following code snippet:
class Foo {
}
interface TypeProvider() {
type(): ?;
}
class Bar implements TypeProvider {
type(): ? {
return (Foo);
}
}
class Baz implements TypeProvider {
type(): ? {
return (Bar);
}
}
If I am returning a class from a method, what should be the type assigned to the method signature?
Also, is there any difference between return (Foo)
and return Foo
? If they are different, I would prefer the former.