[ticket/12960] Add missing docblocks to incomplete captcha

PHPBB3-12960
This commit is contained in:
Marc Alexander 2024-04-17 20:08:16 +02:00
parent 3e23839c04
commit 1baf5c295e
No known key found for this signature in database
GPG key ID: 50E0D2423696F995

View file

@ -1,48 +1,108 @@
<?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;
use phpbb\config\config;
use phpbb\template\template;
class incomplete extends \phpbb\captcha\plugins\captcha_abstract
class incomplete extends captcha_abstract
{
/**
* Constructor for incomplete captcha
*
* @param config $config
* @param template $template
* @param string $phpbb_root_path
* @param string $phpEx
*/
public function __construct(protected config $config, protected template $template,
protected string $phpbb_root_path, protected string $phpEx)
{}
public function is_available()
/**
* @return bool True if captcha is available, false if not
*/
public function is_available(): bool
{
return true;
}
/**
* Dummy implementation
*
* @return void
*/
public function get_generator_class()
{
}
public static function get_name()
/**
* Get CAPTCHA name language variable
*
* @return string Language variable
*/
public static function get_name(): string
{
return 'CAPTCHA_INCOMPLETE';
}
/**
* Init CAPTCHA
*
* @param int $type CAPTCHA type
* @return void
*/
public function init($type)
{
}
/**
* Execute demo
*
* @return void
*/
public function execute_demo()
{
}
/**
* Execute CAPTCHA
*
* @return void
*/
public function execute()
{
}
public function get_demo_template($id)
/**
* Get template data for demo
*
* @param int|string $id ACP module ID
*
* @return string Demo template file name
*/
public function get_demo_template($id): string
{
return '';
}
public function get_template()
/**
* Get template data for CAPTCHA
*
* @return string CAPTCHA template file name
*/
public function get_template(): string
{
$contact_link = phpbb_get_board_contact_link($this->config, $this->phpbb_root_path, $this->phpEx);
@ -54,12 +114,22 @@ class incomplete extends \phpbb\captcha\plugins\captcha_abstract
return 'captcha_incomplete.html';
}
public function validate()
/**
* Validate CAPTCHA
*
* @return false Incomplete CAPTCHA will never validate
*/
public function validate(): bool
{
return false;
}
public function is_solved()
/**
* Check whether CAPTCHA is solved
*
* @return false Incomplete CAPTCHA will never be solved
*/
public function is_solved(): bool
{
return false;
}