Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/b8/b8/b8.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function __construct(array $config = [],
* @param string The text to classify
* @return mixed float The rating between 0 (ham) and 1 (spam) or an error code
*/
public function classify(string $text = null)
public function classify(?string $text = null)
{
// Let's first see if the user called the function correctly
if ($text === null) {
Expand Down Expand Up @@ -325,7 +325,7 @@ private function check_category(string $category)
* @param string Either b8::SPAM or b8::HAM
* @return mixed void or an error code
*/
public function learn(string $text = null, string $category = null)
public function learn(?string $text = null, ?string $category = null)
{
// Let's first see if the user called the function correctly
if ($text === null) {
Expand All @@ -346,7 +346,7 @@ public function learn(string $text = null, string $category = null)
* @param string Either b8::SPAM or b8::HAM
* @return mixed void or an error code
*/
public function unlearn(string $text = null, string $category = null)
public function unlearn(?string $text = null, ?string $category = null)
{
// Let's first see if the user called the function correctly
if ($text === null) {
Expand Down
2 changes: 1 addition & 1 deletion core/b8/b8/lexer/standard.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private function is_valid(string $token)
* @param string $word_to_remove Word to remove from the processed string
* @return void
*/
private function add_token(string $token, string $word_to_remove = null)
private function add_token(string $token, ?string $word_to_remove = null)
{
// Check the validity of the token
if (! $this->is_valid($token)) {
Expand Down
Loading