Set the serializer used to serialize the resource data.

@param  \League\Fractal\Serializer\SerializerAbstract|string $serializer
@return self
554241
public function serializer($serializer):SuccessResponseBuilder
    {
        $this->manager->setSerializer($this->resolveSerializer($serializer));

        return $this;
    }
466065
public static function create(string $format = SerializerBuilder::DEFAULT_FORMAT) : SerializerInterface
    {
        return SerializerBuilder::instance()->setFormat($format)->build();
    }
584702
public function addSerializer(JsonSerializerInterface $serializer): EntryPoint
    {
        foreach ($serializer->getSupportedTypes() as $type) {
            $this->serializers[$type] = $serializer;
        }

        return $this;
    }
264229
public static function requestBuilder(callable $serializer)
    {
        return function (callable $handler) use ($serializer) {
            return function (CommandInterface $command) use ($serializer, $handler) {
                return $handler($command, $serializer($command));
            };
        };
    }
782532
public function getSerializerHandledClass($serializer)
    {
        if (method_exists($serializer, 'getClass')) {
            // 1. the serializer implements the getClass method, so we just call it
            //    this is the recommended way because it's more efficient than using reflection
            return $serializer->getClass();
        } else {
            // 2. else, we try to find the correct serializer by using the type hint of the `serialize` method
            //    this is not always possible, because some serializers can not use type hint (mostly because of an Interface),
            //    so for this case the `getClass` method is required
            $p = new \ReflectionParameter([get_class($serializer), 'serialize'], 0);

            return $p->getClass()->getName();
        }
    }
1212882
public CacheConfigurationBuilder<K, V> withKeySerializer(Serializer<K> keySerializer) {
    return withSerializer(new DefaultSerializerConfiguration<>(requireNonNull(keySerializer, "Null key serializer"), DefaultSerializerConfiguration.Type.KEY));
  }
740214
public function unserialize( $serialization ) {
		$serializationData = unserialize( $serialization );

		foreach ( $serializationData['data'] as $offset => $value ) {
			// Just set the element, bypassing checks and offset resolving,
			// as these elements have already gone through this.
			parent::offsetSet( $offset, $value );
		}

		$this->indexOffset = $serializationData['index'];

		$this->typePointers = $serializationData['typePointers'];

		if ( array_key_exists( 'assoc', $serializationData ) ) {
			$this->isAssociative = $serializationData['assoc'] === 'n' ? null : $serializationData['assoc'] === 't';
		}
	}
703839
private function createSerializer()
    {
        return SerializerBuilder::create()
            ->setPropertyNamingStrategy(new IdenticalPropertyNamingStrategy())
            ->configureListeners(function (EventDispatcher $dispatcher) {
                $dispatcher->addListener('serializer.post_deserialize',
                    function (ObjectEvent $event) {
                        $object = $event->getObject();
                        if ($object instanceof ClientAwareInterface) {
                            $object->setClient($this);
                        }
                    }
                );

                $dispatcher->addListener('serializer.post_serialize',
                    function (ObjectEvent $event) {
                        $options = $event->getContext()->attributes->get('options')->getOrElse(array());
                        $visitor = $event->getVisitor();

                        if ($visitor instanceof GenericSerializationVisitor) {
                            foreach ($options as $key => $value) {
                                $visitor->addData($key, $value);
                            }
                        }
                    }
                );
            })
            ->build();
    }
295633
public function setBucket(string $bucket, string $password = '', string $serialize = 'php'): CouchbaseStore
    {
        $this->bucket = $this->cluster->openBucket($bucket, $password);
        if ($serialize === 'php') {
            $this->bucket->setTranscoder('couchbase_php_serialize_encoder', 'couchbase_default_decoder');
        }

        return $this;
    }
3884
public function setSerializers(array $serializers)
    {
        $this->serializers = [];

        foreach ($serializers as $serializer) {
            if (!($serializer instanceof SerializerInterface)) {
                throw new \Exception('SerializerManager manage only ' . __NAMESPACE__ . '\\SerializerInterface');
            }

            $this->serializers[$serializer->getId()] = $serializer;
        }

        return $this;
    }
822715
public function get()
    {
        if (class_exists($this->serializerType)) {

            if (in_array('Mmoreram\\RSQueueBundle\\Serializer\\Interfaces\\SerializerInterface', class_implements($this->serializerType))) {
                return new $this->serializerType;
            } else {

                throw new SerializerNotImplementsInterfaceException;
            }
        }

        $composedSerializerNamespace = '\\Mmoreram\\RSQueueBundle\\Serializer\\' . $this->serializerType . 'Serializer';

        if (class_exists($composedSerializerNamespace)) {
            return new $composedSerializerNamespace;
        }

        throw new SerializerNotFoundException;
    }
1084111
protected function _setTokenizer($tokenizer)
    {
        if ($tokenizer !== null && !($tokenizer instanceof TokenizerInterface)) {
            throw $this->_createInvalidArgumentException($this->__('Invalid tokenizer'), null, null, $tokenizer);
        }

        $this->tokenizer = $tokenizer;
    }
1229145
def set_custom_serializer(self, _type, serializer):
        
        validate_type(_type)
        validate_serializer(serializer, StreamSerializer)
        self._custom_serializers[_type] = serializer
667069
public function isValidSerializer($serializer): bool
    {
        if ($serializer === false) {
            // False is a valid value (forces serialization to be off)
            return true;
        }
        if ($serializer instanceof SerializerInterface) {
            return true;
        }
        if (\is_callable($serializer)) {
            return true;
        }

        return false;
    }
1165219
public static function serialize($transformer = null)
    {
        if ($transformer === null) {
            return null;
        }

        // Instance of transformer?
        if ($transformer instanceof Serializable) {
            return self::SERIALIZED_PREFIX . base64_encode(serialize($transformer));
        }

        // Instance of transformer?
        if ($transformer instanceof Transformer) {
            return get_class($transformer);
        }

        return $transformer;
    }
1031994
static protected function checkSerializer_( $serializer ):void
	{
		if(!(
			(
				is_object( $serializer )
			&&
				$serializer instanceof S\ASerializer
			)
		or
			(
				is_string( $serializer )
			&&
				class_exists( $serializer )
			&&
				isset( class_parents( $serializer )[S\ASerializer::class] )
			)
		)){
			$caller= debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS, 2 )[1];

			throw new \TypeError(
				"Argument 2 passed to {$caller['class']}{$caller['type']}{$caller['function']}() must be an class extends ".S\ASerializer::class.' or it\'s instance'
			);
		}
	}
36562
protected void configureSerializer(LSSerializer serializer) {
        for (Map.Entry<String, Object> setting : serializeSettings.entrySet()) {
            setSerializerConfigParameter(serializer, setting.getKey(), setting.getValue());
        }
    }