'PHP: Is setting valid type like this doubled?

I think I am double checking for the valid param type here, but not sure. What do you guys think?

# When declaring a function like this:
function validate_sign_in_code(object $connection, object $return, object $sign, object $system)
{

  # Is this needed then?
  (object) $connection;
  (object) $return;
  (object) $sign;
  (object) $system;
  
  ...
php


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source