Positron::provideMeaning()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 2
eloc 4
nc 2
nop 4
1
<?php
2
namespace Posibrain\Positron;
3
4
use Posibrain\TchatMessage;
5
use Posibrain\AnalysedRequest;
6
7
/**
8
 *
9
 * @author Fylhan (http://fylhan.la-bnbox.fr)
10
 * @license LGPL-2.1+
11
 */
12
abstract class Positron
13
{
14
15
	public function isPositronTriggered(TchatMessage $request)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
16
	{
17
		return true;
18
	}
19
20
	public function isBotTriggered(TchatMessage $request, $currentValue = true)
21
	{
22
		return $currentValue;
23
	}
24
25
	public function analyseRequest(TchatMessage $request, AnalysedRequest $currentAnalysedRequest = null)
26
	{
27
		if (null == $currentAnalysedRequest) {
28
			return new AnalysedRequest($request);
29
		}
30
		return $currentAnalysedRequest;
31
	}
32
33
	public function isPositronStillTriggered(AnalysedRequest $request)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
34
	{
35
		return true;
36
	}
37
38
	public function isBotStillTriggered(AnalysedRequest $request, $currentValue = true)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
39
	{
40
		return $currentValue;
41
	}
42
43
	public function loadMemory(AnalysedRequest $request, $currentMemory = null)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
44
	{
45
		return $currentMemory;
46
	}
47
48
	public function transformLoadedMemory(AnalysedRequest $request, $memory, $currentMemory = null)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
49
	{
50
		if (null == $currentMemory) {
51
			return $memory;
52
		}
53
		return $currentMemory;
54
	}
55
56
	public function generateSymbolicAnswer(AnalysedRequest $request, $memory, TchatMessage $currentAnswer = null)
0 ignored issues
show
Unused Code introduced by
The parameter $memory is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
57
	{
58
		return $currentAnswer;
59
	}
60
61
	public function provideMeaning(AnalysedRequest $request, $memory, TchatMessage $answer, TchatMessage $currentAnswer = null)
0 ignored issues
show
Unused Code introduced by
The parameter $memory is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
62
	{
63
		if (null == $currentAnswer) {
64
			return $answer;
65
		}
66
		return $currentAnswer;
67
	}
68
69
	public function beautifyAnswer(AnalysedRequest $request, $memory, TchatMessage $answer, TchatMessage $currentAnswer = null)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $memory is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
70
	{
71
		if (null == $currentAnswer) {
72
			return $answer;
73
		}
74
		return $currentAnswer;
75
	}
76
77
	public function updateMemory(AnalysedRequest $request, $memory, TchatMessage $answer)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $memory is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $answer is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
78
	{}
79
}
80
81
82
83