CommentId::__toInt()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare ( strict_types = 1 );
4
5
namespace Ch0c01dxyz\InstaToken\Objects;
6
7
/**
8
 * @author Egar Rizki <[email protected]>
9
 */
10
class CommentId
11
{
12
	/**
13
	 * @var commentId
14
	 */
15
	protected $commentId;
16
17
	/**
18
	 * Comment ID constructor
19
	 *
20
	 * @param int $cid
21
	 */
22 2
	public function __construct ( int $cid )
23
	{
24 2
		$this->commentId = $cid;
0 ignored issues
show
Documentation Bug introduced by
It seems like $cid of type integer is incompatible with the declared type Ch0c01dxyz\InstaToken\Objects\commentId of property $commentId.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
25 2
	}
26
27
	/**
28
	 * @return int
29
	 */
30 2
	public function __toInt () : int
31
	{
32 2
		return $this->commentId;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->commentId returns the type Ch0c01dxyz\InstaToken\Objects\commentId which is incompatible with the type-hinted return integer.
Loading history...
33
	}
34
}