JsonEncoder   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
c 2
b 0
f 0
lcom 0
cbo 1
dl 0
loc 12
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A stringEncode() 0 4 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: claudio
5
 * Date: 17/09/15
6
 * Time: 14.43
7
 * This program is free software; you can redistribute it and/or
8
 * modify it under the terms of the GNU General Public License
9
 * as published by the Free Software Foundation; either version 2
10
 * of the License, or (at your option) any later version.
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18
 */
19
20
namespace it\thecsea\api_reflection;
21
22
/**
23
 * Class JsonEncoder
24
 * @package it\thecsea\api_reflection
25
 * @author Claudio Cardinale <[email protected]>
26
 * @copyright 2015 Claudio Cardinale
27
 * @version 1.0.0
28
 */
29
class JsonEncoder extends GeneralEncoder
30
{
31
    /**
32
     * Encode the return of each method into a string
33
     * @param mixed $methodReturn return of method called by reflection
34
     * @return string
35
     */
36
    public function stringEncode($methodReturn)
37
    {
38
        return json_encode(self::matrixEncode($methodReturn));
39
    }
40
}