ComplexAttribute::getPrefixedTagName()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 2
crap 2
1
<?php
2
3
namespace Bpost\BpostApiClient\Common;
4
5
abstract class ComplexAttribute
6
{
7
    /**
8
     * Prefix $tagName with the $prefix, if needed
9
     * @param string $prefix
0 ignored issues
show
Documentation introduced by
Should the type for parameter $prefix not be string|null?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
10
     * @param string $tagName
11
     * @return string
12
     */
13 10
    public function getPrefixedTagName($tagName, $prefix = null)
14
    {
15 10
        if (empty($prefix)) {
16 9
            return $tagName;
17
        }
18 6
        return $prefix . ':' . $tagName;
19
    }
20
}
21