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

Helpers::get_class_name()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

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