AppRestApi   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 19
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 16 1
1
<?php
2
3
namespace Eole\Sandstone\Tests\Integration\App;
4
5
use Symfony\Component\HttpFoundation\JsonResponse;
6
7
class AppRestApi extends App
8
{
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