Yoast\WP\SEO\AI_Authorization\Infrastructure

Code_Generator{} │ Yoast 1.0└─ Code_Generator_Interface

Устарела с версии 28.4. Больше не поддерживается и может быть удалена. Рекомендуется заменить эту функцию на аналог.

Class Code_Generator.

Хуков нет.

Использование

$Code_Generator = new Code_Generator();
// use class methods

Методы

  1. public generate( string $user_email, int $length = 10 )
  2. ERROR: no method name found on line `* @param int $length The length of the returned value.`

Список изменений

Устарела с 28.4

Код Code_Generator{} Yoast 28.7

class Code_Generator implements Code_Generator_Interface {

	/**
	 * Generates a unique code using the user's email and random data.
	 *
	 * @deprecated 28.4
	 * @codeCoverageIgnore
	 *
	 * @param string $user_email The user's email.
	 * @param int    $length     The length of the returned value.
	 *
	 * @return string The generated unique code.
	 */
	public function generate( string $user_email, int $length = 10 ): string {
		\_deprecated_function( __METHOD__, 'Yoast SEO 28.4' );
		$data = $user_email . \wp_generate_password( $length, false );
		return \hash( 'sha256', $data );
	}
}