@@ -51,7 +51,7 @@ composer require rybakit/msgpack
5151
5252### Packing
5353
54- To pack values you can either use an instance of a ` Packer ` :
54+ To pack values, you can either use an instance of a ` Packer ` :
5555
5656``` php
5757$packer = new Packer();
@@ -66,8 +66,8 @@ $packed = MessagePack::pack($value);
6666
6767In the examples above, the method ` pack ` automatically packs a value depending on its type. However, not all PHP types
6868can be uniquely translated to MessagePack types. For example, the MessagePack format defines ` map ` and ` array ` types,
69- which are represented by a single ` array ` type in PHP. By default, the packer will pack a PHP array as a MessagePack
70- array if it has sequential numeric keys, starting from ` 0 ` and as a MessagePack map otherwise:
69+ which are represented by a single ` array ` type in PHP. By default, the packer will pack a PHP array as a MessagePack
70+ array if it has sequential numeric keys starting from ` 0 ` , and as a MessagePack map otherwise:
7171
7272``` php
7373$mpArr1 = $packer->pack([1, 2]); // MP array [1, 2]
@@ -144,7 +144,7 @@ $packer = new Packer(PackOptions::FORCE_FLOAT32 | PackOptions::FORCE_FLOAT64);
144144
145145### Unpacking
146146
147- To unpack data you can either use an instance of a ` BufferUnpacker ` :
147+ To unpack data, you can either use an instance of a ` BufferUnpacker ` :
148148
149149``` php
150150$unpacker = new BufferUnpacker();
@@ -159,8 +159,8 @@ or call a static method on the `MessagePack` class:
159159$value = MessagePack::unpack($packed);
160160```
161161
162- If the packed data is received in chunks (e.g. when reading from a stream), use the ` tryUnpack ` method, which attempts
163- to unpack data and returns an array of unpacked messages (if any) instead of throwing an ` InsufficientDataException ` :
162+ If the packed data is received in chunks (e.g. when reading from a stream), use the ` tryUnpack ` method, which attempts
163+ to unpack the data and returns an array of unpacked messages (if any) instead of throwing an ` InsufficientDataException ` :
164164
165165``` php
166166while ($chunk = ...) {
@@ -286,8 +286,8 @@ $packedArray = $packer->pack([1, 2, 3]);
286286
287287As with type objects, type transformers are only responsible for * serializing* values. They should be
288288used when you need to serialize a value that does not implement the [ CanBePacked] ( src/CanBePacked.php )
289- interface. Examples of such values could be instances of built-in or third-party classes that you don't
290- own, or non-objects such as resources.
289+ interface. Examples of such values include instances of built-in or third-party classes that you do not
290+ own, or non-objects such as resources.
291291
292292A transformer class must implement the [ CanPack] ( src/CanPack.php ) interface. To use a transformer,
293293it must first be registered in the packer. Here is an example of how to serialize PHP streams into
@@ -346,7 +346,7 @@ $timestamp = MessagePack::unpack($packedTimestamp);
346346
347347In addition, the format can be extended with your own types. For example, to make the built-in PHP ` DateTime ` objects
348348first-class citizens in your code, you can create a corresponding extension, as shown in the [ example] ( examples/MessagePack/DateTimeExtension.php ) .
349- Please note, that custom extensions have to be registered with a unique extension ID (an integer from ` 0 ` to ` 127 ` ).
349+ Please note that custom extensions must be registered with a unique extension ID (an integer from ` 0 ` to ` 127 ` ).
350350
351351> * More extension examples can be found in the [ examples/MessagePack] ( examples/MessagePack ) directory.*
352352
@@ -371,7 +371,7 @@ Run tests as follows:
371371vendor/bin/phpunit
372372```
373373
374- Also, if you already have Docker installed, you can run the tests in a docker container. First, create a container:
374+ Also, if you already have Docker installed, you can run the tests in a Docker container. First, create a container:
375375
376376``` sh
377377./dockerfile.sh | docker build -t msgpack -
@@ -396,7 +396,7 @@ docker run --rm -v $PWD:/msgpack -w /msgpack msgpack
396396#### Fuzzing
397397
398398To ensure that the unpacking works correctly with malformed/semi-malformed data, you can use a testing technique
399- called [ Fuzzing ] ( https://en.wikipedia.org/wiki/Fuzzing ) . The library ships with a help file (target)
399+ called [ fuzzing ] ( https://en.wikipedia.org/wiki/Fuzzing ) . The library ships with a helper file (target)
400400for [ PHP-Fuzzer] ( https://github.com/nikic/PHP-Fuzzer ) and can be used as follows:
401401
402402``` sh
0 commit comments