fXmlRpc\Exception\SerializationException::invalidType PHP Méthode

invalidType() public static méthode

public static invalidType ( $value )
    public static function invalidType($value)
    {
        return new static(sprintf('Could not serialize %s of type "%s"', gettype($value), get_resource_type($value)));
    }

Usage Example

 /** {@inheritdoc} */
 public function serialize($method, array $params = [])
 {
     $toBeVisited = [&$params];
     while (isset($toBeVisited[0]) && ($value =& $toBeVisited[0])) {
         $type = gettype($value);
         if ($type === 'array') {
             foreach ($value as &$child) {
                 $toBeVisited[] =& $child;
             }
         } elseif ($type === 'object') {
             if ($value instanceof DateTime) {
                 $value = $value->format('Ymd\\TH:i:s');
                 xmlrpc_set_type($value, 'datetime');
             } elseif ($value instanceof Base64Interface) {
                 $value = $value->getDecoded();
                 xmlrpc_set_type($value, 'base64');
             } else {
                 $value = get_object_vars($value);
             }
         } elseif ($type === 'resource') {
             throw SerializationException::invalidType($value);
         }
         array_shift($toBeVisited);
     }
     return xmlrpc_encode_request($method, $params, ['encoding' => 'UTF-8', 'escaping' => 'markup', 'verbosity' => 'no_white_space']);
 }
All Usage Examples Of fXmlRpc\Exception\SerializationException::invalidType
SerializationException