RestfulServerList   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 14
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A handleItem() 0 3 1
1
<?php
2
3
namespace SilverStripe\RestfulServer;
4
5
/**
6
 * Restful server handler for a SS_List
7
 */
8
class RestfulServerList
9
{
10
    private static $url_handlers = array(
0 ignored issues
show
introduced by
The private property $url_handlers is not used, and could be removed.
Loading history...
11
        '#ID' => 'handleItem',
12
    );
13
14
    public function __construct($list)
15
    {
16
        $this->list = $list;
0 ignored issues
show
Bug Best Practice introduced by
The property list does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
17
    }
18
19
    public function handleItem($request)
20
    {
21
        return new RestfulServerItem($this->list->getById($request->param('ID')));
22
    }
23
}
24