YAML2Object   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getObject() 0 8 2
1
<?php
2
/**
3
 * Actions
4
 *
5
 * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
6
 * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
7
 *
8
 * Permission is hereby granted to use or copy this program
9
 * for any purpose, provided the above notices are retained on all copies.
10
 * Permission to modify the code and to distribute modified code is granted,
11
 * provided the above notices are retained, and a notice that the code was
12
 * modified is included with the above copyright notice.
13
 *
14
 * @category  Wp
15
 * @package   Punction
16
 * @author    Andrzej Marcinkowski <[email protected]>
17
 * @copyright 2014 Wojewódzki Szpital Zespolony, Kalisz
18
 * @license   MIT http://opensource.org/licenses/MIT
19
 * @version   1.0 $Id$ $Format:%H$
20
 * @link      http://
21
 * @since     File available since Release 1.0.0
22
 * PHP Version 5
23
 */
24
namespace Hospitalplugin\utils;
25
26
use Symfony\Component\Yaml\Yaml;
27
28
/**
29
 * Z
30
 *
31
 * @category  Wp
32
 * @package   Punction
33
 * @author    Andrzej Marcinkowski <[email protected]>
34
 * @copyright 2014 Wojewódzki Szpital Zespolony, Kalisz
35
 * @license   MIT http://opensource.org/licenses/MIT
36
 * @version   1.0 $Id$ $Format:%H$
37
 * @link      http://
38
 * @since     File available since Release 1.0.0
39
 *
40
 */
41
class YAML2Object
42
{
43
44
    private static $object;
0 ignored issues
show
Unused Code introduced by
The property $object is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
45
46
    public static function getObject($yamlFile)
47
    {
48
        if (YAML2Object::$object == null) {
49
            $wardsFileContents = file_get_contents($yamlFile);
50
            YAML2Object::$object = Yaml::parse($wardsFileContents);
51
        }
52
        return YAML2Object::$object;
53
    }
54
}