Parameter::getKey()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php declare(strict_types=1);
2
3
namespace PeeHaa\AsyncTwitter\Request;
4
5
abstract class Parameter
6
{
7
    private $key;
8
9
    private $type;
10
11 221
    public function __construct(string $key, string $type = 'text/plain')
12
    {
13 221
        $this->key   = $key;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 3 spaces

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
14 221
        $this->type = $type;
15
    }
16
17 194
    public function getKey(): string
18
    {
19 194
        return $this->key;
20
    }
21
22 2
    public function getType(): string
23
    {
24 2
        return $this->type;
25
    }
26
}
27