Completed
Push — master ( baa886...783c35 )
by Fylhan
07:15
created
src/Posibrain/ITchatBot.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 	 *        	Message of the user
17 17
 	 * @param string $userName
18 18
 	 *        	Name of the user who speak to the bot
19
-	 * @param long|\DateTime|string $dateTime
19
+	 * @param integer $dateTime
20 20
 	 *        	Date when the message had been posted. Unix timestamp or \DateTime or string representing \DateTime are accepted. Current date by default.
21 21
 	 * @return boolean
22 22
 	 */
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 *        	Message of the user
30 30
 	 * @param string $userName
31 31
 	 *        	Name of the user who speak to the bot
32
-	 * @param long|\DateTime|string $dateTime
32
+	 * @param integer $dateTime
33 33
 	 *        	Date when the message had been posted. Unix timestamp or \DateTime or string representing \DateTime are accepted. Current date by default.
34 34
 	 * @return array($botName, $botMessage)
35 35
 	 */
Please login to merge, or discard this patch.
src/Posibrain/Positron/Haddock/HaddockPositron.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 
4 4
 use Monolog\Logger;
5 5
 use Posibrain\Positron\Positron;
6
-use Posibrain\TchatBotConfig;
7 6
 use Posibrain\AnalysedRequest;
8 7
 use Posibrain\TchatMessage;
9 8
 
Please login to merge, or discard this patch.
src/Posibrain/Positron/Instinct/BrainManager.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -128,6 +128,9 @@
 block discarded – undo
128 128
 		file_put_contents($filepath, $jsonData);
129 129
 	}
130 130
 
131
+	/**
132
+	 * @param string $synonymKey
133
+	 */
131 134
 	private function getSynonyms($synonymKey, $synonymList)
132 135
 	{
133 136
 		foreach ($synonymList as $synonym) {
Please login to merge, or discard this patch.
src/Posibrain/Positron/Instinct/InstinctPositron.php 2 patches
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -141,6 +141,9 @@  discard block
 block discarded – undo
141 141
 		return $currentAnswer;
142 142
 	}
143 143
 
144
+	/**
145
+	 * @param string $userName
146
+	 */
144 147
 	private function findBestPriorityKeyword($userName, $message)
145 148
 	{
146 149
 		$bestPriority = - 1;
@@ -160,6 +163,9 @@  discard block
 block discarded – undo
160 163
 		return $matchingKeywordItem;
161 164
 	}
162 165
 
166
+	/**
167
+	 * @param string $userName
168
+	 */
163 169
 	private function findBestVariance($userName, $message, $keyword)
164 170
 	{
165 171
 		// Verify
@@ -192,6 +198,9 @@  discard block
 block discarded – undo
192 198
 		return $matchingVarianceItem;
193 199
 	}
194 200
 
201
+	/**
202
+	 * @param string $userName
203
+	 */
195 204
 	private function pickResponse($userName, $userMessage, $varianceItem)
196 205
 	{
197 206
 		// Verify
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 
4 4
 use Monolog\Logger;
5 5
 use Posibrain\Positron\Positron;
6
-use Posibrain\TchatBotConfig;
7 6
 use Posibrain\AnalysedRequest;
8 7
 use Posibrain\TchatMessage;
9 8
 
Please login to merge, or discard this patch.
src/Posibrain/Positroner.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 namespace Posibrain;
3 3
 
4
-use Seld\JsonLint\JsonParser;
5
-use Seld\JsonLint\ParsingException;
6 4
 use Monolog\Logger;
7 5
 include_once (__DIR__ . '/../tools.php');
8 6
 
Please login to merge, or discard this patch.
src/Posibrain/RestApi/RestApiController.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,6 @@
 block discarded – undo
6 6
 use Monolog\Handler\RotatingFileHandler;
7 7
 use Monolog\Logger;
8 8
 use Symfony\Component\HttpFoundation\Request;
9
-use Symfony\Component\HttpFoundation\Response;
10 9
 use Symfony\Component\HttpFoundation\JsonResponse;
11 10
 
12 11
 /**
Please login to merge, or discard this patch.
src/Posibrain/TchatBotIdentity.php 2 patches
Doc Comments   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -136,6 +136,9 @@  discard block
 block discarded – undo
136 136
         return $this->instinctPath . $this->id . '/identity.json';
137 137
     }
138 138
 
139
+    /**
140
+     * @param string $identityPath
141
+     */
139 142
     private function loadIdentity($identityPath)
140 143
     {
141 144
         if (! is_file($identityPath)) {
@@ -289,7 +292,7 @@  discard block
 block discarded – undo
289 292
 
290 293
     /**
291 294
      *
292
-     * @return DateTime
295
+     * @return \DateTime
293 296
      */
294 297
     public function getBirthday()
295 298
     {
@@ -307,7 +310,7 @@  discard block
 block discarded – undo
307 310
 
308 311
     /**
309 312
      * 
310
-     * @return DateTimeZone
313
+     * @return \DateTimeZone
311 314
      */
312 315
     public function getTimezone()
313 316
     {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 namespace Posibrain;
3 3
 
4 4
 use Monolog\Logger;
5
-use Monolog\Handler\StreamHandler;
6 5
 use Posibrain\OutputDecorationEnum;
7 6
 
8 7
 /**
Please login to merge, or discard this patch.
src/tools.php 1 patch
Doc Comments   +17 added lines, -6 removed lines patch added patch discarded remove patch
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
  * 
35 35
  * @param $email Email
36 36
  *        	à tester
37
- * @return true si c'est un email
38
- * @return false sinon
37
+ * @return integer si c'est un email
38
+ * @return integer sinon
39 39
  */
40 40
 function isEmailValide($email)
41 41
 {
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
  * 
48 48
  * @param $tel tel
49 49
  *        	à tester
50
- * @return true si c'est un tel
51
- * @return false sinon
50
+ * @return integer si c'est un tel
51
+ * @return integer sinon
52 52
  */
53 53
 function isTelValide($tel)
54 54
 {
@@ -56,6 +56,9 @@  discard block
 block discarded – undo
56 56
 }
57 57
 
58 58
 // Transforme le numéro du mois en son nom en français
59
+/**
60
+ * @param string $numMois
61
+ */
59 62
 function nomMois($numMois)
60 63
 {
61 64
 	switch ($numMois) {
@@ -160,6 +163,7 @@  discard block
 block discarded – undo
160 163
 
161 164
 /**
162 165
  * Formate une date en fonction de la date actuelle
166
+ * @param integer $timestamp
163 167
  */
164 168
 function dateFr($timestamp, $heure = false, $le = true)
165 169
 {
@@ -197,7 +201,7 @@  discard block
 block discarded – undo
197 201
  * Formate la date d'un événement
198 202
  * 
199 203
  * @param $timestamp Timestamp        	
200
- * @return La date formatée
204
+ * @return string date formatée
201 205
  */
202 206
 function afficherDateEvenement($timestamp)
203 207
 {
@@ -334,7 +338,7 @@  discard block
 block discarded – undo
334 338
  * @param string $dossierOuChercher)        	
335 339
  * @param string $nomImage
336 340
  *        	(sans extension)
337
- * @return Url de l'image si elle existe, vide sinon
341
+ * @return string de l'image si elle existe, vide sinon
338 342
  */
339 343
 function isImage($dossierOuChercher, $nomImage)
340 344
 {
@@ -449,11 +453,18 @@  discard block
 block discarded – undo
449 453
 	echo '</pre><br />';
450 454
 }
451 455
 
456
+/**
457
+ * @param string $needle
458
+ * @param string $haystack
459
+ */
452 460
 function startsWith($needle, $haystack)
453 461
 {
454 462
 	return ! strncmp($haystack, $needle, strlen($needle));
455 463
 }
456 464
 
465
+/**
466
+ * @param string $needle
467
+ */
457 468
 function endsWith($needle, $haystack)
458 469
 {
459 470
 	$length = strlen($needle);
Please login to merge, or discard this patch.