ComplexAttribute   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 16
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getPrefixedTagName() 0 7 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