1 | <?php |
||
12 | class UrbanWordsManager |
||
13 | { |
||
14 | private $words; |
||
15 | private $slang; |
||
16 | private $desc; |
||
17 | private $sentence; |
||
18 | |||
19 | /** |
||
20 | * UrbanWordsCRUD constructor. |
||
21 | */ |
||
22 | public function __construct() |
||
26 | |||
27 | /** |
||
28 | * return Urban array of words from John\Cp\UrbanWords. |
||
29 | * |
||
30 | * @return array |
||
31 | */ |
||
32 | public function getWords() |
||
36 | |||
37 | /** |
||
38 | * Add new word into the Urban Word dictionary |
||
39 | * |
||
40 | * @param string $slang |
||
41 | * @param string $desc |
||
42 | * @param string $sentence |
||
43 | * |
||
44 | * @return bool |
||
45 | * |
||
46 | * @throws \John\Exceptions\WordManagerException |
||
47 | */ |
||
48 | public function addWord($slang = '', $desc = '', $sentence = '') |
||
77 | |||
78 | /** |
||
79 | * Read words from the Urban Words Dictionary |
||
80 | * |
||
81 | * @param string $slang |
||
82 | * |
||
83 | * @return bool |
||
84 | * |
||
85 | * @throws \John\Exceptions\WordManagerException |
||
86 | */ |
||
87 | public function readWord($slang = '') |
||
123 | |||
124 | /** |
||
125 | * Update slang Words in the Urban Dictionary |
||
126 | * |
||
127 | * @param string $slang |
||
128 | * @param string $slangUpdate |
||
129 | * @param string $descUpdate |
||
130 | * @param string $sentenceUpdate |
||
131 | * |
||
132 | * @return mixed |
||
133 | * |
||
134 | * @throws \John\Exceptions\UrbanWordException |
||
135 | */ |
||
136 | public function updateWord($slang = '', $slangUpdate = '', $descUpdate = '', $sentenceUpdate = '') |
||
158 | |||
159 | /** |
||
160 | * Delete word from Urban dictionary |
||
161 | * |
||
162 | * @param string $slang |
||
163 | * |
||
164 | * @return bool |
||
165 | * |
||
166 | * @throws \John\Exceptions\UrbanWordException |
||
167 | */ |
||
168 | public function deleteWord($slang = '') |
||
204 | } |
||
205 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.