src/Handler/JsonHandler.php
public function serialize($data)
    {
        if (!$this->serializer || \is_numeric($data) || \is_string($data) || empty($data) || $data instanceof \JsonSerializable) {
            return $data;
        }

        return $this->getSerializer()->serialize($data);
    }
public function serialize($data)
    {
        if (!$this->serializer || \is_numeric($data) || \is_string($data) || empty($data) || $data instanceof \JsonSerializable) {
            return $data;
        }

        return $this->getSerializer()->serialize($data);
    }
public function serialize ( $ data ) { if ( ! $ this -> serializer || \ is_numeric ( $ data ) || \ is_string ( $ data ) || empty ( $ data ) || $ data instanceof \ JsonSerializable ) { return $ data ; } return $ this -> getSerializer ( ) -> serialize ( $ data ) ; }
Serialize data.

@param mixed $data

@return null|array|int|\JsonSerializable|string
Serialize data .