protected function serializerFor($object): ObjectXmlSerializer
    {
        if (!annotationsOf($object)->contain('XmlSerializer')) {
            return AnnotationBasedObjectXmlSerializer::fromObject($object);
        }

        return $this->injector->getInstance(
                annotationsOf($object)
                        ->firstNamed('XmlSerializer')
                        ->getValue()
                        ->getName()
        );
    }
protected function serializerFor($object): ObjectXmlSerializer
    {
        if (!annotationsOf($object)->contain('XmlSerializer')) {
            return AnnotationBasedObjectXmlSerializer::fromObject($object);
        }

        return $this->injector->getInstance(
                annotationsOf($object)
                        ->firstNamed('XmlSerializer')
                        ->getValue()
                        ->getName()
        );
    }
protected function serializerFor ( $ object ) : ObjectXmlSerializer { if ( ! annotationsOf ( $ object ) -> contain ( 'XmlSerializer' ) ) { return AnnotationBasedObjectXmlSerializer :: fromObject ( $ object ) ; } return $ this -> injector -> getInstance ( annotationsOf ( $ object ) -> firstNamed ( 'XmlSerializer' ) -> getValue ( ) -> getName ( ) ) ; }
returns serializer for given object

@param   object  $object
@return  \stubbles\xml\serializer\ObjectXmlSerializer
returns serializer for given object