Skip to content

Commit bc32de1

Browse files
committed
Finalizing documentation
1 parent 5e3018c commit bc32de1

File tree

4 files changed

+25
-17
lines changed

4 files changed

+25
-17
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog #
22

3+
## v2.0.1 (2015-01-10) ##
4+
5+
* Improvements on code quality, documentation and tests
6+
37
## v2.0.0 (2014-12-29) ##
48

59
* Encoding is now separated into external encoding classes

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ at: http://kit.riimu.net/api/phpencoder/
2727
In order to use this library, the following requirements must be met:
2828

2929
* PHP version 5.4
30-
30+
3131
## Installation ##
3232

3333
This library can be installed via [Composer](http://getcomposer.org/). To do
34-
this, download `composer.phar` and require this library as dependency. For
34+
this, download the `composer.phar` and require this library as a dependency. For
3535
example:
3636

3737
```
3838
$ php -r "readfile('https://getcomposer.org/installer');" | php
3939
$ php composer.phar require riimu/kit-phpencoder:2.*
4040
```
4141

42-
Alternatively, you ca add the dependency to your `composer.json` and run
42+
Alternatively, you can add the dependency to your `composer.json` and run
4343
`composer install`. For example:
4444

4545
```json
@@ -50,9 +50,13 @@ Alternatively, you ca add the dependency to your `composer.json` and run
5050
}
5151
```
5252

53-
If you installed the library via Composer. You can load the library by including
54-
the `vendor/autoload.php` file. If you do not want to use Composer, you can
55-
download the latest release and include the `src/autoload.php` file instead.
53+
Any library that has been installed via Composer can be loaded by including the
54+
`vendor/autoload.php` file that was generated by Composer.
55+
56+
It is also possible to install this library manually. To do this, download the
57+
[latest release](https://github.com/Riimu/Kit-PHPEncoder/releases/latest) and
58+
extract the `src` folder to your project folder. To load the library, include
59+
the provided `src/autoload.php` file.
5660

5761
## Usage ##
5862

src/Encoder/Encoder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Riimu\Kit\PHPEncoder\Encoder;
44

55
/**
6-
* Interface for value encoders.
6+
* Interface for different types of value encoders.
77
* @author Riikka Kalliomäki <[email protected]>
88
* @copyright Copyright (c) 2014, Riikka Kalliomäki
99
* @license http://opensource.org/licenses/mit-license.php MIT License

src/PHPEncoder.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
class PHPEncoder
1818
{
19-
/** @var Encoder\Encoder[] List of used encoders */
19+
/** @var Encoder\Encoder[] List of value encoders */
2020
private $encoders;
2121

2222
/** @var array List of defined encoder option values. */
@@ -33,13 +33,13 @@ class PHPEncoder
3333
/**
3434
* Creates a new PHPEncoder instance.
3535
*
36-
* It's possible to define the list of default options for the encoder in
37-
* the constructor. You may also customize the list of used encoders by
38-
* providing an array of encoders. If null is provided, a list of default of
39-
* encoders will be used instead.
36+
* Optionally, you can provide a list of default options to the constructor
37+
* as an associative array. If you do not want to use the default list of
38+
* encoders supplied with the library, you may also provide a list of
39+
* value encoders to the constructor.
4040
*
4141
* @param array $options List of encoder options
42-
* @param null|Encoder\Encoder[] $encoders List of encoders to use
42+
* @param null|Encoder[] $encoders List of encoders to use or null for default
4343
*/
4444
public function __construct(array $options = [], array $encoders = null)
4545
{
@@ -67,10 +67,10 @@ public function __construct(array $options = [], array $encoders = null)
6767
/**
6868
* Adds a new encoder.
6969
*
70-
* Note that values are always encoded by the first encoder that supports
71-
* it. Thus, all objects will be caught by the ObjectEncoder, for example.
72-
* If you want the encoder to be tried first, set the $prepend parameter
73-
* true which adds it to beginning of the list.
70+
* Values are always encoded by the first encoder that supports encoding
71+
* that type of value. By setting the second optional parameter to true,
72+
* you can prepend the encoder to the list to ensure that it will be tested
73+
* first.
7474
*
7575
* @param Encoder\Encoder $encoder Encoder for encoding values
7676
* @param boolean $prepend True to prepend the encoder to the list, false to add it as last

0 commit comments

Comments
 (0)