This repository has been archived by the owner on Nov 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
php5_typehints.patch
145 lines (133 loc) · 4.46 KB
/
php5_typehints.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
diff --git b/src/Model/Command/Interaction.php a/src/Model/Command/Interaction.php
index 7a606b3..1578502 100644
@@ -147,8 +151,12 @@ class Interaction extends AbstractCommand implements UserAwareInterface
$this->context = $context;
}
+ /**
+ * @param int $timestamp
+ */
protected function setTimestamp($timestamp)
{
+ Assertion::integer($timestamp);
Assertion::greaterThan($timestamp, 0);
$this->timestamp = $timestamp;
}
diff --git b/src/Model/Command/UserRecommendation.php a/src/Model/Command/UserRecommendation.php
--- b/src/Model/Command/UserRecommendation.php
+++ a/src/Model/Command/UserRecommendation.php
@@ -166,10 +166,11 @@
* By default user won't see any items, that it has visited (and we have recorded DetailView interaction.)
* If you want to circumvent this, and get recommendations including the ones, that the user has already visited,
* you can set the "seen" allowance here.
- * @param mixed $seen
+ * @param bool $seen
*/
public function setAllowSeen($seen)
{
+ Assertion::boolean($seen);
$this->allowSeen = $seen;
return $this;
@@ -210,11 +211,12 @@
* Set number of requested recommendations. The real number of recommended items could be lower or even zero when
* there are no items relevant for the user.
*
- * @param mixed $count
+ * @param int $count
* @return $this
*/
public function setCount($count)
{
+ Assertion::integer($count);
Assertion::greaterThan($count, 0);
$this->count = $count;
@@ -229,6 +231,7 @@
*/
public function setRotationRate($rotationRate)
{
+ Assertion::float($rotationRate);
Assertion::between($rotationRate, 0, 1);
$this->rotationRate = $rotationRate;
@@ -244,6 +247,7 @@
*/
public function setRotationTime($rotationTime)
{
+ Assertion::integer($rotationTime);
Assertion::greaterOrEqualThan($rotationTime, 0);
$this->rotationTime = $rotationTime;
diff --git b/src/RequestBuilder/RequestBuilderFactory.php a/src/RequestBuilder/RequestBuilderFactory.php
index f410a97..2f6ccf2 100644
--- a/src/RequestBuilder/RequestBuilderFactory.php
+++ b/src/RequestBuilder/RequestBuilderFactory.php
@@ -29,6 +29,8 @@ class RequestBuilderFactory
/**
* Define new properties into the database. Those properties will be created and subsequently accepted by Matej.
+ *
+ * @return ItemPropertiesSetupRequestBuilder
*/
public function setupItemProperties()
{
@@ -41,6 +43,8 @@ class RequestBuilderFactory
/**
* Added item properties will be IRREVERSIBLY removed from all items in the database and the item property will
* from now be rejected by Matej.
+ *
+ * @return ItemPropertiesSetupRequestBuilder
*/
public function deleteItemProperties()
{
@@ -50,6 +54,9 @@ class RequestBuilderFactory
return $requestBuilder;
}
+ /**
+ * @return EventsRequestBuilder
+ */
public function events()
{
$requestBuilder = new EventsRequestBuilder();
@@ -58,6 +65,9 @@ class RequestBuilderFactory
return $requestBuilder;
}
+ /**
+ * @return CampaignRequestBuilder
+ */
public function campaign()
{
$requestBuilder = new CampaignRequestBuilder();
@@ -66,6 +76,10 @@ class RequestBuilderFactory
return $requestBuilder;
}
+ /**
+ * @param Sorting $sorting
+ * @return SortingRequestBuilder
+ */
public function sorting(Sorting $sorting)
{
$requestBuilder = new SortingRequestBuilder($sorting);
@@ -74,6 +88,10 @@ class RequestBuilderFactory
return $requestBuilder;
}
+ /**
+ * @param UserRecommendation $recommendation
+ * @return RecommendationRequestBuilder
+ */
public function recommendation(UserRecommendation $recommendation)
{
$requestBuilder = new RecommendationRequestBuilder($recommendation);
@@ -82,6 +100,9 @@ class RequestBuilderFactory
return $requestBuilder;
}
+ /**
+ * @return ForgetRequestBuilder
+ */
public function forget()
{
$requestBuilder = new ForgetRequestBuilder();
@@ -90,6 +111,9 @@ class RequestBuilderFactory
return $requestBuilder;
}
+ /**
+ * @return ResetDatabaseRequestBuilder
+ */
public function resetDatabase()
{
$requestBuilder = new ResetDatabaseRequestBuilder();