1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/17414] Replace confirm types with enum

PHPBB-17414
This commit is contained in:
Marc Alexander
2024-10-13 17:13:01 +02:00
parent 589fe70be6
commit 48454308ae
8 changed files with 36 additions and 19 deletions

View File

@@ -0,0 +1,24 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\captcha\plugins;
/**
* Confirmation types for CAPTCHA plugins
*/
enum confirm_type: int {
case REGISTRATION = 1;
case LOGIN = 2;
case POST = 3;
case REPORT = 4;
}

View File

@@ -15,14 +15,6 @@ namespace phpbb\captcha\plugins;
interface plugin_interface
{
const CONFIRM_REGISTRATION = 1;
const CONFIRM_LOGIN = 2;
const CONFIRM_POST = 3;
const CONFIRM_REPORT = 4;
/**
* Check if the plugin is available
*
@@ -54,10 +46,10 @@ interface plugin_interface
/**
* Display the captcha for the specified type
*
* @param int $type Type of captcha, should be one of the CONFIRMATION_* constants
* @param confirm_type $type Type of captcha, should be one of the CONFIRMATION_* constants
* @return void
*/
public function init(int $type): void;
public function init(confirm_type $type): void;
/**
* Get hidden form fields for this captcha plugin

View File

@@ -121,7 +121,7 @@ class turnstile extends base
/**
* {@inheritDoc}
*/
public function init(int $type): void
public function init(confirm_type $type): void
{
$this->language->add_lang('captcha_turnstile');
}