Completed
Push — master ( 35d03c...3ad0ba )
by WEBEWEB
11:45
created

PhoneNumbersTrait::setMobileNumber()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
/**
4
 * This file is part of the core-library package.
5
 *
6
 * (c) 2017 NdC/WBW
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Library\Core\Model\Traits;
13
14
/**
15
 * Phone numbers trait.
16
 *
17
 * @author NdC/WBW <https://github.com/webeweb/>
18
 * @package WBW\Library\Core\Model\Traits
19
 */
20
trait PhoneNumbersTrait {
21
22
	/**
23
	 * Mobile number.
24
	 *
25
	 * @var string
26
	 */
27
	private $mobileNumber;
28
29
	/**
30
	 * Phone number.
31
	 *
32
	 * @var string
33
	 */
34
	private $phoneNumber;
35
36
	/**
37
	 * Get the mobile number.
38
	 *
39
	 * @return string Returns the mobile number.
40
	 */
41
	public function getMobileNumber() {
42
		return $this->mobileNumber;
43
	}
44
45
	/**
46
	 * Get the phone number.
47
	 *
48
	 * @return string Returns the phone number.
49
	 */
50
	public function getPhoneNumber() {
51
		return $this->phoneNumber;
52
	}
53
54
	/**
55
	 * Set the mobile number.
56
	 *
57
	 * @param type $mobileNumber
58
	 * @return PhoneNumbersTrait Returns the phone.
0 ignored issues
show
Comprehensibility Bug introduced by
The return type PhoneNumbersTrait is a trait, and thus cannot be used for type-hinting in PHP. Maybe consider adding an interface and use that for type-hinting?

In PHP traits cannot be used for type-hinting as they do not define a well-defined structure. This is because any class that uses a trait can rename that trait’s methods.

If you would like to return an object that has a guaranteed set of methods, you could create a companion interface that lists these methods explicitly.

Loading history...
59
	 */
60
	public function setMobileNumber($mobileNumber) {
61
		$this->mobileNumber = $mobileNumber;
0 ignored issues
show
Documentation Bug introduced by
It seems like $mobileNumber of type object<WBW\Library\Core\Model\Traits\type> is incompatible with the declared type string of property $mobileNumber.

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...
62
		return $this;
63
	}
64
65
	/**
66
	 * Set the phone number.
67
	 *
68
	 * @param string $phoneNumber The phone number.
69
	 * @return PhoneNumbersTrait Returns the phone.
0 ignored issues
show
Comprehensibility Bug introduced by
The return type PhoneNumbersTrait is a trait, and thus cannot be used for type-hinting in PHP. Maybe consider adding an interface and use that for type-hinting?

In PHP traits cannot be used for type-hinting as they do not define a well-defined structure. This is because any class that uses a trait can rename that trait’s methods.

If you would like to return an object that has a guaranteed set of methods, you could create a companion interface that lists these methods explicitly.

Loading history...
70
	 */
71
	public function setPhoneNumber($phoneNumber) {
72
		$this->phoneNumber = $phoneNumber;
73
		return $this;
74
	}
75
76
}
77