Skip to content

Commit 03278d8

Browse files
committed
Updated README
- added notes about zend-component-installer - used stable package version - short array notation
1 parent a221d47 commit 03278d8

File tree

1 file changed

+23
-17
lines changed

1 file changed

+23
-17
lines changed

README.md

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ Installation
2222
Run the following `composer` command:
2323

2424
```console
25-
$ composer require "zfcampus/zf-api-problem:~1.0-dev"
25+
$ composer require zfcampus/zf-api-problem
2626
```
2727

2828
Alternately, manually add the following to your `composer.json`, in the `require` section:
2929

3030
```javascript
3131
"require": {
32-
"zfcampus/zf-api-problem": "~1.0-dev"
32+
"zfcampus/zf-api-problem": "^1.2"
3333
}
3434
```
3535

@@ -39,18 +39,23 @@ Finally, add the module name to your project's `config/application.config.php` u
3939
key:
4040

4141
```php
42-
return array(
42+
return [
4343
/* ... */
44-
'modules' => array(
44+
'modules' => [
4545
/* ... */
4646
'ZF\ApiProblem',
47-
),
47+
],
4848
/* ... */
49-
);
49+
];
5050
```
5151

52+
> ### zf-component-installer
53+
>
54+
> If you use [zf-component-installer](https://github.com/zendframework/zf-component-installer),
55+
> that plugin will install zf-api-problem as a module for you.
56+
5257
Configuration
53-
-------------
58+
=============
5459

5560
### User Configuration
5661

@@ -74,26 +79,26 @@ The following configuration is provided in `config/module.config.php` to enable
7479
function:
7580

7681
```php
77-
'service_manager' => array(
78-
'aliases' => array(
82+
'service_manager' => [
83+
'aliases' => [
7984
'ZF\ApiProblem\ApiProblemListener' => 'ZF\ApiProblem\Listener\ApiProblemListener',
8085
'ZF\ApiProblem\RenderErrorListener' => 'ZF\ApiProblem\Listener\RenderErrorListener',
8186
'ZF\ApiProblem\ApiProblemRenderer' => 'ZF\ApiProblem\View\ApiProblemRenderer',
8287
'ZF\ApiProblem\ApiProblemStrategy' => 'ZF\ApiProblem\View\ApiProblemStrategy',
83-
),
84-
'factories' => array(
88+
],
89+
'factories' => [
8590
'ZF\ApiProblem\Listener\ApiProblemListener' => 'ZF\ApiProblem\Factory\ApiProblemListenerFactory',
8691
'ZF\ApiProblem\Listener\RenderErrorListener' => 'ZF\ApiProblem\Factory\RenderErrorListenerFactory',
8792
'ZF\ApiProblem\Listener\SendApiProblemResponseListener' => 'ZF\ApiProblem\Factory\SendApiProblemResponseListenerFactory',
8893
'ZF\ApiProblem\View\ApiProblemRenderer' => 'ZF\ApiProblem\Factory\ApiProblemRendererFactory',
8994
'ZF\ApiProblem\View\ApiProblemStrategy' => 'ZF\ApiProblem\Factory\ApiProblemStrategyFactory',
90-
),
91-
),
92-
'view_manager' => array(
95+
],
96+
],
97+
'view_manager' => [
9398
// Enable this in your application configuration in order to get full
9499
// exception stack traces in your API-Problem responses.
95100
'display_exceptions' => false,
96-
),
101+
],
97102
```
98103

99104
ZF2 Events
@@ -175,13 +180,14 @@ encountered. An instance of `ApiProblem` is typically wrapped in an
175180
constructor:
176181

177182
```php
178-
class ApiProblem {
183+
class ApiProblem
184+
{
179185
public function __construct(
180186
$status,
181187
$detail,
182188
$type = null,
183189
$title = null,
184-
array $additional = array()
190+
array $additional = []
185191
) {
186192
/* ... */
187193
}

0 commit comments

Comments
 (0)