1 | <?php |
||
22 | class Call |
||
23 | { |
||
24 | private $methodName; |
||
25 | private $arguments; |
||
26 | private $returnValue; |
||
27 | private $exception; |
||
28 | private $file; |
||
29 | private $line; |
||
30 | private $scores; |
||
31 | |||
32 | /** |
||
33 | * Initializes call. |
||
34 | * |
||
35 | * @param string $methodName |
||
36 | * @param array $arguments |
||
37 | * @param mixed $returnValue |
||
38 | * @param Exception $exception |
||
39 | * @param null|string $file |
||
40 | * @param null|int $line |
||
41 | */ |
||
42 | public function __construct($methodName, array $arguments, $returnValue, |
||
56 | |||
57 | /** |
||
58 | * Returns called method name. |
||
59 | * |
||
60 | * @return string |
||
61 | */ |
||
62 | public function getMethodName() |
||
66 | |||
67 | /** |
||
68 | * Returns called method arguments. |
||
69 | * |
||
70 | * @return array |
||
71 | */ |
||
72 | public function getArguments() |
||
76 | |||
77 | /** |
||
78 | * Returns called method return value. |
||
79 | * |
||
80 | * @return null|mixed |
||
81 | */ |
||
82 | public function getReturnValue() |
||
86 | |||
87 | /** |
||
88 | * Returns exception that call thrown. |
||
89 | * |
||
90 | * @return null|Exception |
||
91 | */ |
||
92 | public function getException() |
||
96 | |||
97 | /** |
||
98 | * Returns callee filename. |
||
99 | * |
||
100 | * @return string |
||
101 | */ |
||
102 | public function getFile() |
||
106 | |||
107 | /** |
||
108 | * Returns callee line number. |
||
109 | * |
||
110 | * @return int |
||
111 | */ |
||
112 | public function getLine() |
||
116 | |||
117 | /** |
||
118 | * Returns short notation for callee place. |
||
119 | * |
||
120 | * @return string |
||
121 | */ |
||
122 | public function getCallPlace() |
||
130 | |||
131 | /** |
||
132 | * Adds the wildcard match score for the provided wildcard. |
||
133 | * |
||
134 | * @param ArgumentsWildcard $wildcard |
||
135 | * @param false|int $score |
||
136 | * |
||
137 | * @return $this |
||
138 | */ |
||
139 | public function addScore(ArgumentsWildcard $wildcard, $score) |
||
145 | |||
146 | /** |
||
147 | * Returns wildcard match score for the provided wildcard. The score is |
||
148 | * calculated if not already done. |
||
149 | * |
||
150 | * @param ArgumentsWildcard $wildcard |
||
151 | * |
||
152 | * @return false|int False OR integer score (higher - better) |
||
153 | */ |
||
154 | public function getScore(ArgumentsWildcard $wildcard) |
||
162 | } |
||
163 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: