ArticlesCollectionService   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A initialize() 0 22 1
1
<?php
2
/**
3
 * Copyright 2016 - 2018, Cake Development Corporation (http://cakedc.com)
4
 *
5
 * Licensed under The MIT License
6
 * Redistributions of files must retain the above copyright notice.
7
 *
8
 * @copyright Copyright 2016 - 2018, Cake Development Corporation (http://cakedc.com)
9
 * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
10
 */
11
12
namespace CakeDC\Api\Test\App\Service;
13
14
use CakeDC\Api\Service\Action\Collection\AddEditAction;
15
use CakeDC\Api\Service\Action\Collection\DeleteAction;
16
use CakeDC\Api\Service\CollectionService;
17
use CakeDC\Api\Service\FallbackService;
18
19
class ArticlesCollectionService extends FallbackService
20
{
21
    public function initialize()
22
    {
23
        parent::initialize();
24
25
        $this->mapAction('collectionAdd', AddEditAction::class, [
26
            'method' => ['POST'],
27
            'mapCors' => true,
28
            'path' => 'collection/add'
29
        ]);
30
        $this->mapAction('collectionEdit', AddEditAction::class, [
31
            'method' => ['POST'],
32
            'mapCors' => true,
33
            'path' => 'collection/edit'
34
        ]);
35
        $this->mapAction('collectionDelete', DeleteAction::class, [
36
            'method' => ['POST'],
37
            'mapCors' => true,
38
            'path' => 'collection/delete'
39
        ]);
40
41
        $this->setTable('Articles');
42
    }
43
}
44