1 | <?php |
||
26 | trait ValueCheckTrait |
||
27 | { |
||
28 | /** |
||
29 | * Returns if value starts with a value |
||
30 | * |
||
31 | * @param string $string The value to search for |
||
32 | * @param string $line The line to test |
||
33 | * |
||
34 | * @return bool Returns if the line starts with value |
||
35 | */ |
||
36 | 54 | protected function startsWith($string, $line) |
|
40 | |||
41 | /** |
||
42 | * Returns if value is a string |
||
43 | * |
||
44 | * @param string $value The value to test |
||
45 | * |
||
46 | * @return bool Is a value a string |
||
47 | */ |
||
48 | 42 | private function isString($value) |
|
52 | |||
53 | /** |
||
54 | * Returns if value is a bool |
||
55 | * |
||
56 | * @param string $value The value to test |
||
57 | * |
||
58 | * @return bool Is a value a bool |
||
59 | */ |
||
60 | 39 | private function isBool($value) |
|
64 | |||
65 | /** |
||
66 | * Returns if the bool is in a string |
||
67 | * |
||
68 | * @param string $value The value to test |
||
69 | * @param bool $quoted_string Is the context a quoted string |
||
70 | * @param int $word_count The amount of words in the sentence |
||
71 | * |
||
72 | * @return bool Is a value a bool in a string |
||
73 | */ |
||
74 | 12 | private function isBoolInString($value, $quoted_string, $word_count) |
|
78 | |||
79 | /** |
||
80 | * Returns if value is number |
||
81 | * |
||
82 | * @param string $value The value to test |
||
83 | * |
||
84 | * @return bool Is a value a number |
||
85 | */ |
||
86 | 36 | private function isNumber($value) |
|
90 | |||
91 | /** |
||
92 | * Returns if value is null |
||
93 | * |
||
94 | * @param string $value The value to test |
||
95 | * |
||
96 | * @return bool Is a value null |
||
97 | */ |
||
98 | 36 | private function isNull($value) |
|
102 | |||
103 | /** |
||
104 | * Returns if variable value is a clone, e.g. BOOL = $(BOOL_1) |
||
105 | * |
||
106 | * @param string $value The value to test |
||
107 | * @param array $matches The matches of the variables |
||
108 | * @param bool $quoted_string If the value is in a quoted string |
||
109 | * |
||
110 | * @return bool Is a value null |
||
111 | */ |
||
112 | 18 | private function isVariableClone($value, $matches, $quoted_string) |
|
116 | } |
||
117 |