In some programming languages such as Java or C# it's allowed for programmer to set allowed input variable types. I use PHP and I want to do the same to avoid passing wrong data to my methods/functions.
My code:
public static function generateFiles(array $data, Custom_Pager $pager)
{...}
Why is that allowed and I cant write like that:
public static function generateFiles(array $data, Custom_Pager $pager, int $limit, string $text)
{ ... }
Is any way to standardize first and second method declarations I presented above? If no, why?