Table   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 31
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A beforeMarshal() 0 4 1
A _prepareParamsData() 0 7 2
1
<?php
2
/**
3
 * CakeCMS Core
4
 *
5
 * This file is part of the of the simple cms based on CakePHP 3.
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 *
9
 * @package     Core
10
 * @license     MIT
11
 * @copyright   MIT License http://www.opensource.org/licenses/mit-license.php
12
 * @link        https://github.com/CakeCMS/Core".
13
 * @author      Sergey Kalistratov <[email protected]>
14
 */
15
16
namespace Core\ORM;
17
18
use JBZoo\Data\JSON;
19
use Cake\Event\Event;
20
use Cake\Database\Type;
21
use Cake\ORM\Table as CakeTable;
22
23
/**
24
 * Class Table
25
 *
26
 * @package Core\ORM
27
 */
28
class Table extends CakeTable
29
{
30
31
    /**
32
     * Callback before request data is converted into entities.
33
     *
34
     * @param Event $event
35
     * @param \ArrayObject $data
36
     * @param \ArrayObject $options
37
     * @return void
38
     * @SuppressWarnings("unused")
39
     */
40
    public function beforeMarshal(Event $event, \ArrayObject $data, \ArrayObject $options)
0 ignored issues
show
Unused Code introduced by
The parameter $event is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $options is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
41
    {
42
        $this->_prepareParamsData($data);
43
    }
44
45
    /**
46
     * Prepare params data.
47
     *
48
     * @param \ArrayObject $data
49
     * @return void
50
     */
51
    protected function _prepareParamsData(\ArrayObject $data)
52
    {
53
        if (isset($data['params'])) {
54
            $params = new JSON((array) $data['params']);
55
            $data->offsetSet('params', $params);
56
        }
57
    }
58
}
59