public function getDeserializerForElementName(string $name): callable
    {
        if (!array_key_exists($name, $this->elementMap)) {
            if ('{}' == substr($name, 0, 2) && array_key_exists(substr($name, 2), $this->elementMap)) {
                $name = substr($name, 2);
            } else {
                return ['Sabre\\Xml\\Element\\Base', 'xmlDeserialize'];
            }
        }

        $deserializer = $this->elementMap[$name];
        if (is_subclass_of($deserializer, 'Sabre\\Xml\\XmlDeserializable')) {
            return [$deserializer, 'xmlDeserialize'];
        }

        if (is_callable($deserializer)) {
            return $deserializer;
        }

        $type = gettype($deserializer);
        if ('string' === $type) {
            $type .= ' ('.$deserializer.')';
        } elseif ('object' === $type) {
            $type .= ' ('.get_class($deserializer).')';
        }
        throw new \LogicException('Could not use this type as a deserializer: '.$type.' for element: '.$name);
    }
public function getDeserializerForElementName(string $name): callable
    {
        if (!array_key_exists($name, $this->elementMap)) {
            if ('{}' == substr($name, 0, 2) && array_key_exists(substr($name, 2), $this->elementMap)) {
                $name = substr($name, 2);
            } else {
                return ['Sabre\\Xml\\Element\\Base', 'xmlDeserialize'];
            }
        }

        $deserializer = $this->elementMap[$name];
        if (is_subclass_of($deserializer, 'Sabre\\Xml\\XmlDeserializable')) {
            return [$deserializer, 'xmlDeserialize'];
        }

        if (is_callable($deserializer)) {
            return $deserializer;
        }

        $type = gettype($deserializer);
        if ('string' === $type) {
            $type .= ' ('.$deserializer.')';
        } elseif ('object' === $type) {
            $type .= ' ('.get_class($deserializer).')';
        }
        throw new \LogicException('Could not use this type as a deserializer: '.$type.' for element: '.$name);
    }
public function getDeserializerForElementName ( string $ name ) : callable { if ( ! array_key_exists ( $ name , $ this -> elementMap ) ) { if ( '{}' == substr ( $ name , 0 , 2 ) && array_key_exists ( substr ( $ name , 2 ) , $ this -> elementMap ) ) { $ name = substr ( $ name , 2 ) ; } else { return [ 'Sabre\\Xml\\Element\\Base' , 'xmlDeserialize' ] ; } } $ deserializer = $ this -> elementMap [ $ name ] ; if ( is_subclass_of ( $ deserializer , 'Sabre\\Xml\\XmlDeserializable' ) ) { return [ $ deserializer , 'xmlDeserialize' ] ; } if ( is_callable ( $ deserializer ) ) { return $ deserializer ; } $ type = gettype ( $ deserializer ) ; if ( 'string' === $ type ) { $ type .= ' (' . $ deserializer . ')' ; } elseif ( 'object' === $ type ) { $ type .= ' (' . get_class ( $ deserializer ) . ')' ; } throw new \ LogicException ( 'Could not use this type as a deserializer: ' . $ type . ' for element: ' . $ name ) ; }
Returns the function that should be used to parse the element identified
by it's clark-notation name.
Returns the function that should be used to parse the element identified by it s clark - notation name .