code: public static function setClassMemberAsAccessible(
          $classOrObj,
          $member,
          $type
      ) {
          $class = is_object($classOrObj) ? get_class($classOrObj) : $classOrObj;
          $method = $type == 'method' ? 'getMethod' : 'getProperty';
  
          $member = (new \ReflectionClass($class))->{$method}($member);
          $member->setAccessible(true);
  
          return $member;
      }
docs: @param mixed  $classOrObj
  @param string $member
  @param string $type
  
  @return mixed