Hello!
Looking into invokable classes and I see arguments passed to __invoke method are not type-checked.
The following will happily accept the integer as argument even though it will throw an exception and there also doesn't seem to be a way to preview the __invoke method signature.
<?php
declare(strict_types=1);
class Invokable {
public function __invoke(string $something): string {
return "something else";
}
}
echo new Invokable()(1);