GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

ClassName::isClassOf()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Isolate\UnitOfWork\Entity;
4
5
use Isolate\UnitOfWork\Exception\InvalidArgumentException;
6
7
/**
8
 * @api
9
 */
10
final class ClassName
11
{
12
    /**
13
     * @var string
14
     */
15
    private $className;
16
17
    /**
18
     * @param string $className
19
     * @throws InvalidArgumentException
20
     */
21
    public function __construct($className)
22
    {
23
        if (!is_string($className)) {
24
            throw new InvalidArgumentException("Class name must be a valid string.");
25
        }
26
27
        if (!class_exists($className)) {
28
            throw new InvalidArgumentException(sprintf("Class \"%s\" does not exists.", $className));
29
        }
30
31
        $this->className = $className;
32
    }
33
34
    public function __toString()
35
    {
36
        return $this->className;
37
    }
38
39
    /**
40
     * @param $entity
41
     * @return bool
42
     * 
43
     * @api
44
     */
45
    public function isClassOf($entity)
46
    {
47
        return $entity instanceof $this->className;
48
    }
49
}
50