2017 © Pedro Peláez
 

library chubbyphp-serialization

Chubbyphp Serialize

image

chubbyphp/chubbyphp-serialization

Chubbyphp Serialize

  • Thursday, June 28, 2018
  • by dominikzogg
  • Repository
  • 1 Watchers
  • 22 Stars
  • 1,917 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 41 Versions
  • 26 % Grown

The README.md

chubbyphp-serialization

CI Coverage Status Mutation testing badge Latest Stable Version Total Downloads Monthly Downloads, (*1)

bugs code_smells coverage duplicated_lines_density ncloc sqale_rating alert_status reliability_rating security_rating sqale_index vulnerabilities, (*2)

Description

A simple serialization., (*3)

Requirements

  • php: ^8.1
  • chubbyphp/chubbyphp-decode-encode: ^1.1
  • doctrine/inflector: ^1.4.4|^2.0.8
  • psr/http-message: ^1.1|^2.0
  • psr/link: ^1.1.1|^2.0.1
  • psr/log: ^2.0|^3.0

Suggest

  • chubbyphp/chubbyphp-container: ^2.2
  • pimple/pimple: ^3.5
  • psr/container: ^2.0.2
  • symfony/dependency-injection: ^5.4.31|^6.3.8|^7.0 (symfony integration)

Installation

Through Composer as chubbyphp/chubbyphp-serialization., (*4)

composer require chubbyphp/chubbyphp-serialization "^4.0"

Usage

Accessor

Encoder

Type Encoder

Normalizer

Field Normalizer

Relation Field Normalizer

Normalizer Context

NormalizerObjectMappingRegistry

Mapping

NormalizationFieldMapping

NormalizationLinkMapping

NormalizationObjectMapping

LazyNormalizationObjectMapping

Policy

ServiceFactory

chubbyphp-container

chubbyphp-laminas-config-factory

ServiceProvider

Serializer

<?php

use Chubbyphp\DecodeEncode\Encoder\Encoder;
use Chubbyphp\DecodeEncode\Encoder\JsonTypeEncoder;
use Chubbyphp\DecodeEncode\Encoder\JsonxTypeEncoder;
use Chubbyphp\DecodeEncode\Encoder\UrlEncodedTypeEncoder;
use Chubbyphp\DecodeEncode\Encoder\XmlTypeEncoder;
use Chubbyphp\DecodeEncode\Encoder\YamlTypeEncoder;
use Chubbyphp\Serialization\Normalizer\Normalizer;
use Chubbyphp\Serialization\Normalizer\NormalizerObjectMappingRegistry;
use Chubbyphp\Serialization\Serializer;
use MyProject\Serialization\ModelMapping;
use MyProject\Model\Model;
use Psr\Http\Message\ServerRequestInterface;

$logger = ...;

$serializer = new Serializer(
    new Normalizer(
        new NormalizerObjectMappingRegistry([
            new ModelMapping()
        ]),
        $logger
    ),
    new Encoder([
        new JsonTypeEncoder(),
        new JsonxTypeEncoder(),
        new UrlEncodedTypeEncoder(),
        new XmlTypeEncoder(),
        new YamlTypeEncoder()
    ])
);

$model = new Model;
$model->setName('php');

$json = $serializer->serialize(
    $model,
    'application/json'
);

echo $json;
// '{"name": "php"}'

$model = new Model;
$model->setName('php');

$data = $serializer->normalize(
    $model
);

print_r($data);
// ['name' => 'php']

print_r($serializer->getContentTypes());
//[
//    'application/json',
//    'application/jsonx+xml',
//    'application/x-www-form-urlencoded',
//    'application/xml',
//    'application/x-yaml'
//]

echo $serializer->encode(
    ['name' => 'php'],
    'application/json'
);
// '{"name": "php"}'

2024 Dominik Zogg, (*5)

The Versions

28/06 2018

dev-master

9999999-dev

Chubbyphp Serialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

serialization slim chubbyphp

28/06 2018
27/06 2018
22/06 2018
15/06 2018
11/06 2018
11/06 2018
01/06 2018
24/05 2018
23/05 2018

2.1-beta2

2.1.0.0-beta2

Chubbyphp Serialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

serialization slim chubbyphp

23/05 2018

2.1-beta1

2.1.0.0-beta1

Chubbyphp Serialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

serialization slim chubbyphp

24/04 2018
27/03 2018
26/03 2018
07/03 2018
15/01 2018

2.0-beta6

2.0.0.0-beta6

Chubbyphp Serialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

serialization slim chubbyphp

07/11 2017

v1.x-dev

1.9999999.9999999.9999999-dev

Chubbyphp Deserialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

serialization slim chubbyphp

07/11 2017

1.1.2

1.1.2.0

Chubbyphp Deserialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

serialization slim chubbyphp

07/11 2017

2.0-beta5

2.0.0.0-beta5

Chubbyphp Serialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

serialization slim chubbyphp

06/11 2017

2.0-beta4

2.0.0.0-beta4

Chubbyphp Serialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

serialization slim chubbyphp

03/11 2017

2.0-beta3

2.0.0.0-beta3

Chubbyphp Serialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

serialization slim chubbyphp

30/10 2017

2.0-beta2

2.0.0.0-beta2

Chubbyphp Serialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

serialization slim chubbyphp

26/10 2017

2.0-beta1

2.0.0.0-beta1

Chubbyphp Serialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

serialization slim chubbyphp

26/10 2017

2.0-alpha10

2.0.0.0-alpha10

Chubbyphp Serialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

serialization slim chubbyphp

24/10 2017

2.0-alpha9

2.0.0.0-alpha9

Chubbyphp Serialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

serialization slim chubbyphp

23/10 2017

2.0-alpha8

2.0.0.0-alpha8

Chubbyphp Serialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

serialization slim chubbyphp

23/10 2017

2.0-alpha7

2.0.0.0-alpha7

Chubbyphp Serialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

serialization slim chubbyphp

22/10 2017

2.0-alpha6

2.0.0.0-alpha6

Chubbyphp Serialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

serialization slim chubbyphp

20/10 2017

2.0-alpha5

2.0.0.0-alpha5

Chubbyphp Serialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

serialization slim chubbyphp

20/10 2017

2.0-alpha4

2.0.0.0-alpha4

Chubbyphp Serialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

serialization slim chubbyphp

20/10 2017

2.0-alpha3

2.0.0.0-alpha3

Chubbyphp Serialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

serialization slim chubbyphp

20/10 2017

2.0-alpha2

2.0.0.0-alpha2

Chubbyphp Serialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

serialization slim chubbyphp

20/10 2017

2.0-alpha1

2.0.0.0-alpha1

Chubbyphp Serialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

serialization slim chubbyphp

18/09 2017

1.1.1

1.1.1.0

Chubbyphp Deserialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

serialization slim chubbyphp

10/09 2017

1.1.0

1.1.0.0

Chubbyphp Deserialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

serialization slim chubbyphp

29/08 2017

1.0.2

1.0.2.0

Chubbyphp Deserialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

serialization slim chubbyphp

16/08 2017

1.0.1

1.0.1.0

Chubbyphp Deserialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

serialization slim chubbyphp

16/08 2017

1.0.0

1.0.0.0

Chubbyphp Deserialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

serialization slim chubbyphp

12/08 2017

1.0-beta2

1.0.0.0-beta2

Chubbyphp Deserialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

serialization slim chubbyphp

09/08 2017

1.0-beta1

1.0.0.0-beta1

Chubbyphp Deserialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

serialization slim chubbyphp

08/08 2017

1.0-alpha1

1.0.0.0-alpha1

Chubbyphp Deserialize

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

serialization slim chubbyphp