Fixture::getObjectName()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 6
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Shapin\Datagen\Stripe;
6
7
use Shapin\Datagen\Fixture as BaseFixture;
8
use Shapin\Datagen\Stripe\Exception\NoObjectNameDefinedException;
9
10
abstract class Fixture extends BaseFixture implements FixtureInterface
11
{
12
    protected static $objectName;
13
14
    public function getObjectName(): string
15
    {
16
        if (null === static::$objectName) {
17
            throw new NoObjectNameDefinedException(static::class);
18
        }
19
20
        return static::$objectName;
21
    }
22
23
    public function getProcessor(): string
24
    {
25
        return 'stripe';
26
    }
27
28
    public function getName(): string
29
    {
30
        return $this->getObjectName();
31
    }
32
}
33