Mapper   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A buildMapping() 0 6 3
1
<?php
2
/**
3
 * Author: Nil Portugués Calderó <[email protected]>
4
 * Date: 10/16/15
5
 * Time: 8:59 PM.
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace NilPortugues\Laravel5\HalJsonSerializer\Mapper;
12
13
class Mapper extends \NilPortugues\Api\Mapping\Mapper
14
{
15
    /**
16
     * @param string|array $mappedClass
17
     *
18
     * @return array
19
     */
20
    protected function buildMapping($mappedClass)
21
    {
22
        return (\is_string($mappedClass) && \class_exists($mappedClass, true)) ?
23
            MappingFactory::fromClass($mappedClass) :
24
            MappingFactory::fromArray($mappedClass);
25
    }
26
}
27