socially_isSocialMediaProfile()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
nc 2
nop 1
dl 0
loc 9
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace {
4
    use HumanDirect\Socially\Factory;
5
6
    /**
7
     * @param string $url
8
     *
9
     * @return bool
10
     */
11
    function socially_isSocialMediaProfile(string $url): bool
12
    {
13
        static $parser = null;
14
15
        if (null === $parser) {
16
            $parser = Factory::createParser();
17
        }
18
19
        return $parser->isSocialMediaProfile($url);
20
    }
21
22
    /**
23
     * @param string $url
24
     *
25
     * @return string
26
     */
27
    function socially_normalize(string $url): string
28
    {
29
        static $parser = null;
30
31
        if (null === $parser) {
32
            $parser = Factory::createParser();
33
        }
34
35
        return $parser->normalize($url);
36
    }
37
}
38