diff --git a/langs/en.json b/langs/en.json index 5839483ab..90a7bd84b 100644 --- a/langs/en.json +++ b/langs/en.json @@ -143,7 +143,7 @@ "do_not_use_blocking_class": "for performance reasons, handlers may not use the non-async blocking class %s, please use %s, instead", "do_not_use_deprecated_function": "the %s function is deprecated, please use %s, instead", "do_not_use_non_root_require_in_event_handler": "for performance reasons, you must not use require or include inside of an event handler class, only root-level requires are allowed.", - "do_not_use_yield": "MadelineProto 8 does not require or support the use of yield in async functions, you can remove all yield keywords now", + "do_not_use_yield": "MadelineProto 8 does not require or support the use of yield in async functions, you must remove all yield keywords previously used for async function calls", "recommend_not_use_filesystem_function": "usage of the %s function is not recommended, because accessing the filesystem during update handling will slow down your bot, please see https://docs.madelineproto.xyz/docs/UPDATES.html#avoiding-the-use-of-filesystem-functions for a list of alternative ways to store data that will not slow down your bot!", "plugins_do_not_use_require": "for performance reasons, plugins can only automatically include or require other files present in the plugins folder by triggering the PSR-4 autoloader (not by manually require()'ing them).", diff --git a/src/Lang.php b/src/Lang.php index 4c75e0e3a..08adf5f7f 100644 --- a/src/Lang.php +++ b/src/Lang.php @@ -84,6 +84,7 @@ If you intentionally deleted this account, ignore this message.', 'do_not_use_blocking_function' => 'for performance reasons, event handlers may not use the non-async blocking function %s, please use %s, instead', 'do_not_use_deprecated_function' => 'the %s function is deprecated, please use %s, instead', 'do_not_use_non_root_require_in_event_handler' => 'for performance reasons, you must not use require or include inside of an event handler class, only root-level requires are allowed.', + 'do_not_use_yield' => 'MadelineProto 8 does not require or support the use of yield in async functions, you must remove all yield keywords previously used for async function calls', 'done' => 'تەواو!', 'encode_double_error' => 'نەتوانرا بە باشی دووانە کۆد بکات', 'extensionRecommended' => 'Warning: the %s extension is not installed, please install it to speed up MadelineProto!', @@ -247,6 +248,7 @@ If you intentionally deleted this account, ignore this message.', 'do_not_use_blocking_function' => 'for performance reasons, event handlers may not use the non-async blocking function %s, please use %s, instead', 'do_not_use_deprecated_function' => 'the %s function is deprecated, please use %s, instead', 'do_not_use_non_root_require_in_event_handler' => 'for performance reasons, you must not use require or include inside of an event handler class, only root-level requires are allowed.', + 'do_not_use_yield' => 'MadelineProto 8 does not require or support the use of yield in async functions, you must remove all yield keywords previously used for async function calls', 'done' => 'Done!', 'encode_double_error' => 'Could not properly encode double', 'extensionRecommended' => 'Warning: the %s extension is not installed, please install it to speed up MadelineProto!', @@ -410,6 +412,7 @@ If you intentionally deleted this account, ignore this message.', 'do_not_use_blocking_function' => 'به دلایل عملکردی و اجرایی، ایونت‌هندلرها نباید از فانکشن %s که async نیست استفاده کنند، لطفا به جای آن از %s استفاده کنید', 'do_not_use_deprecated_function' => 'تابع %s منسوخ شده، لطفا به جای آن از %s استفاده کنید', 'do_not_use_non_root_require_in_event_handler' => 'به دلایل عملکردی و اجرایی، شما نباید از require یا include داخل کلس ایونت‌هندلر استفاده کنید، فقط require های سطح root مجاز هستند.', + 'do_not_use_yield' => 'MadelineProto 8 does not require or support the use of yield in async functions, you must remove all yield keywords previously used for async function calls', 'done' => 'انجام شد!', 'encode_double_error' => 'نمی‌توان به درستی double را رمزنگاری (انکد) کرد', 'extensionRecommended' => 'هشدار: افزونه %s نصب نشده است. لطفا برای افزایش سرعت مدلین‌پروتو آن را نصب کنید!', @@ -573,6 +576,7 @@ If you intentionally deleted this account, ignore this message.', 'do_not_use_blocking_function' => 'for performance reasons, event handlers may not use the non-async blocking function %s, please use %s, instead', 'do_not_use_deprecated_function' => 'the %s function is deprecated, please use %s, instead', 'do_not_use_non_root_require_in_event_handler' => 'for performance reasons, you must not use require or include inside of an event handler class, only root-level requires are allowed.', + 'do_not_use_yield' => 'MadelineProto 8 does not require or support the use of yield in async functions, you must remove all yield keywords previously used for async function calls', 'done' => 'Done!', 'encode_double_error' => 'Could not properly encode double', 'extensionRecommended' => 'Warning: the %s extension is not installed, please install it to speed up MadelineProto!', @@ -736,6 +740,7 @@ If you intentionally deleted this account, ignore this message.', 'do_not_use_blocking_function' => 'for performance reasons, event handlers may not use the non-async blocking function %s, please use %s, instead', 'do_not_use_deprecated_function' => 'the %s function is deprecated, please use %s, instead', 'do_not_use_non_root_require_in_event_handler' => 'for performance reasons, you must not use require or include inside of an event handler class, only root-level requires are allowed.', + 'do_not_use_yield' => 'MadelineProto 8 does not require or support the use of yield in async functions, you must remove all yield keywords previously used for async function calls', 'done' => 'בוצע!', 'encode_double_error' => 'לא ניתן היה לקודד כפול כראוי', 'extensionRecommended' => 'Warning: the %s extension is not installed, please install it to speed up MadelineProto!', @@ -899,6 +904,7 @@ Ignorare questo messaggio se la sessione è stata resettata intenzionalmente.', 'do_not_use_blocking_function' => 'per motivi di performance, gli event handler non possono usare la funzione bloccante non asincrona %s, per favore usa %s', 'do_not_use_deprecated_function' => 'la funzione %s è deprecata, per favore usa %s', 'do_not_use_non_root_require_in_event_handler' => 'per motivi di performance, non è possibile usare require o include dentro l\'event handler, è possibile includere file solo all\'esterno della classe.', + 'do_not_use_yield' => 'MadelineProto 8 does not require or support the use of yield in async functions, you must remove all yield keywords previously used for async function calls', 'done' => 'Fatto!', 'encode_double_error' => 'Non sono riuscito a codificare il numero a virgola mobile fornito', 'extensionRecommended' => 'Attenzione: l\'estensione %s non è installata, si prega di installarla per velocizzare MadelineProto!', @@ -1062,6 +1068,7 @@ If you intentionally deleted this account, ignore this message.', 'do_not_use_blocking_function' => 'for performance reasons, event handlers may not use the non-async blocking function %s, please use %s, instead', 'do_not_use_deprecated_function' => 'the %s function is deprecated, please use %s, instead', 'do_not_use_non_root_require_in_event_handler' => 'for performance reasons, you must not use require or include inside of an event handler class, only root-level requires are allowed.', + 'do_not_use_yield' => 'MadelineProto 8 does not require or support the use of yield in async functions, you must remove all yield keywords previously used for async function calls', 'done' => 'Готово!', 'encode_double_error' => 'Could not properly encode double', 'extensionRecommended' => 'Warning: the %s extension is not installed, please install it to speed up MadelineProto!', @@ -1225,6 +1232,7 @@ If you intentionally deleted this account, ignore this message.', 'do_not_use_blocking_function' => 'for performance reasons, event handlers may not use the non-async blocking function %s, please use %s, instead', 'do_not_use_deprecated_function' => 'the %s function is deprecated, please use %s, instead', 'do_not_use_non_root_require_in_event_handler' => 'for performance reasons, you must not use require or include inside of an event handler class, only root-level requires are allowed.', + 'do_not_use_yield' => 'MadelineProto 8 does not require or support the use of yield in async functions, you must remove all yield keywords previously used for async function calls', 'done' => 'Bajarildi!', 'encode_double_error' => 'Doubleni toʻgʻri kodlab boʻlmadi', 'extensionRecommended' => 'Warning: the %s extension is not installed, please install it to speed up MadelineProto!', @@ -1390,6 +1398,7 @@ If you intentionally deleted this account, ignore this message.', 'do_not_use_blocking_function' => 'for performance reasons, event handlers may not use the non-async blocking function %s, please use %s, instead', 'do_not_use_deprecated_function' => 'the %s function is deprecated, please use %s, instead', 'do_not_use_non_root_require_in_event_handler' => 'for performance reasons, you must not use require or include inside of an event handler class, only root-level requires are allowed.', + 'do_not_use_yield' => 'MadelineProto 8 does not require or support the use of yield in async functions, you must remove all yield keywords previously used for async function calls', 'done' => 'Done!', 'encode_double_error' => 'Could not properly encode double', 'extensionRecommended' => 'Warning: the %s extension is not installed, please install it to speed up MadelineProto!', diff --git a/src/Tools.php b/src/Tools.php index 961ca294f..a9278dc64 100644 --- a/src/Tools.php +++ b/src/Tools.php @@ -801,7 +801,7 @@ abstract class Tools extends AsyncTools while ($parent = $parent->getAttribute('parent')) { if ($parent instanceof ClassMethod && $parent->isPublic() - && in_array($parent->name->toLowerString(), self::NO_YIELD_FUNCTIONS, true) + && \in_array($parent->name->toLowerString(), self::NO_YIELD_FUNCTIONS, true) ) { $issues []= new EventHandlerIssue( message: Lang::$current_lang['do_not_use_yield'],