Completed
Push — master ( b82429...99ed55 )
by Xavier
01:40
created

Helpers   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 21
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A flatten() 0 3 2
A get_class_name() 0 6 1
1
<?php
2
3
namespace PubPeerFoundation\PublicationDataExtractor\Helpers;
4
5
class Helpers
6
{
7
    /**
8
     * @param $object
9
     * @return string
10
     */
11
    public static function get_class_name($object)
12
    {
13
        $className = get_class($object);
14
        $pos = strrpos($className, '\\');
15
16
        return substr($className, $pos + 1);
17
    }
18
19
    /**
20
     * @param mixed  $entry
21
     * @return string
22
     */
23
    public static function flatten($entry)
24
    {
25
        return is_array($entry) ? $entry[0] : $entry;
26
    }
27
}
28