Mapper::buildMapping()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4286
cc 3
eloc 4
nc 4
nop 1
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