[UTIL][NICKNAME][FIX] Add self to constant

This commit is contained in:
Hugo Sales 2020-07-25 22:22:16 +00:00 committed by Hugo Sales
parent 8b7dd48344
commit 576d6eb11c
No known key found for this signature in database
GPG Key ID: 7D0C7EAFC9D835A0

View File

@ -1,6 +1,7 @@
<?php <?php
// {{{ License // {{{ License
// This file is part of GNU social - https://www.gnu.org/software/social // This file is part of GNU social - https://www.gnu.org/software/social
// //
// GNU social is free software: you can redistribute it and/or modify // GNU social is free software: you can redistribute it and/or modify
@ -15,6 +16,7 @@
// //
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with GNU social. If not, see <http://www.gnu.org/licenses/>. // along with GNU social. If not, see <http://www.gnu.org/licenses/>.
// }}} // }}}
namespace App\Util; namespace App\Util;
@ -125,7 +127,7 @@ class Nickname
* @throws NicknameTakenException * @throws NicknameTakenException
* @throws NicknameTooLongException * @throws NicknameTooLongException
*/ */
public static function normalize(string $nickname, bool $check_already_used = NO_CHECK_USED): string public static function normalize(string $nickname, bool $check_already_used = self::NO_CHECK_USED): string
{ {
if (mb_strlen($nickname) > self::MAX_LEN) { if (mb_strlen($nickname) > self::MAX_LEN) {
// Display forms must also fit! // Display forms must also fit!
@ -161,7 +163,7 @@ class Nickname
* *
* @return bool True if nickname is valid. False if invalid (or taken if $check_already_used == true). * @return bool True if nickname is valid. False if invalid (or taken if $check_already_used == true).
*/ */
public static function isValid(string $nickname, bool $check_already_used = CHECK_USED): bool public static function isValid(string $nickname, bool $check_already_used = self::CHECK_USED): bool
{ {
try { try {
self::normalize($nickname, $check_already_used); self::normalize($nickname, $check_already_used);