MappedProperty   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 9 2
1
<?php
2
/**
3
 * Author: Nil Portugués Calderó <[email protected]>
4
 * Date: 12/17/15
5
 * Time: 11:41 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\SchemaOrg;
12
13
/**
14
 * Class MappedProperty.
15
 */
16
class MappedProperty
17
{
18
    /**
19
     * @var array
20
     */
21
    private static $instances = [];
22
23
    /**
24
     * @param string $schemaClass
25
     * @param string $propertyName
26
     * @param string $propertyUrl
27
     *
28
     * @return Mapping
29
     */
30
    public static function create($schemaClass, $propertyName, $propertyUrl)
31
    {
32
        $key = md5(implode('.', func_get_args()));
33
        if (empty(self::$instances[$key])) {
34
            self::$instances[$key] = new Mapping($schemaClass, $propertyName, $propertyUrl);
35
        }
36
37
        return self::$instances[$key];
38
    }
39
}
40