File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ function __construct(array $config = [],
122122 * @param string The text to classify
123123 * @return mixed float The rating between 0 (ham) and 1 (spam) or an error code
124124 */
125- public function classify (string $ text = null )
125+ public function classify (? string $ text = null )
126126 {
127127 // Let's first see if the user called the function correctly
128128 if ($ text === null ) {
@@ -325,7 +325,7 @@ private function check_category(string $category)
325325 * @param string Either b8::SPAM or b8::HAM
326326 * @return mixed void or an error code
327327 */
328- public function learn (string $ text = null , string $ category = null )
328+ public function learn (? string $ text = null , ? string $ category = null )
329329 {
330330 // Let's first see if the user called the function correctly
331331 if ($ text === null ) {
@@ -346,7 +346,7 @@ public function learn(string $text = null, string $category = null)
346346 * @param string Either b8::SPAM or b8::HAM
347347 * @return mixed void or an error code
348348 */
349- public function unlearn (string $ text = null , string $ category = null )
349+ public function unlearn (? string $ text = null , ? string $ category = null )
350350 {
351351 // Let's first see if the user called the function correctly
352352 if ($ text === null ) {
Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ private function is_valid(string $token)
165165 * @param string $word_to_remove Word to remove from the processed string
166166 * @return void
167167 */
168- private function add_token (string $ token , string $ word_to_remove = null )
168+ private function add_token (string $ token , ? string $ word_to_remove = null )
169169 {
170170 // Check the validity of the token
171171 if (! $ this ->is_valid ($ token )) {
You can’t perform that action at this time.
0 commit comments