Conditions | 1 |
Paths | 1 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
9 | public function __construct(array $values = array()) |
||
10 | { |
||
11 | parent::__construct($values); |
||
12 | |||
13 | $this->post('api/articles', function () { |
||
14 | $id = 42; |
||
15 | $title = 'Unicorns spotted in Alaska'; |
||
16 | $url = 'http://unicorn.com/articles/unicorns-spotted-alaska'; |
||
17 | |||
18 | $this['dispatcher']->dispatch('article.created', new ArticleCreatedEvent($id, $title, $url)); |
||
19 | |||
20 | return new JsonResponse($id, 201); |
||
21 | }); |
||
22 | |||
23 | $this->forwardEventToPushServer('article.created'); |
||
24 | } |
||
25 | } |
||
26 |