Suppose I have several classes with a method
public function foo (int $a, int $b, ..) {..}
where the number of parameters depends on the particular class (but is fixed for a specific class).
Is there a way to put such a method in an interface so that all my classes could implement that interface?
I don't think variadics can help here, because I would need to define all my foo implementations as
public function foo(int ...$ints) {..}
losing the information around how many parameters I need to have for a specific class.
Any trickery that could be used?
P.S. I would really like to avoid exceptions, so I can't just check if the number of arguments matches programmatically