Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
17 / 17
100.00% covered (success)
100.00%
12 / 12
CRAP
100.00% covered (success)
100.00%
1 / 1
incomplete
100.00% covered (success)
100.00%
17 / 17
100.00% covered (success)
100.00%
12 / 12
12
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 is_available
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 has_config
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 get_name
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 set_name
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 init
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 get_demo_template
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 get_template
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
1 / 1
1
 validate
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 get_error
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 is_solved
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 get_attempt_count
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2/**
3 *
4 * This file is part of the phpBB Forum Software package.
5 *
6 * @copyright (c) phpBB Limited <https://www.phpbb.com>
7 * @license GNU General Public License, version 2 (GPL-2.0)
8 *
9 * For full copyright and license information, please see
10 * the docs/CREDITS.txt file.
11 *
12 */
13
14namespace phpbb\captcha\plugins;
15
16use phpbb\config\config;
17use phpbb\db\driver\driver_interface;
18use phpbb\language\language;
19use phpbb\request\request_interface;
20use phpbb\template\template;
21use phpbb\user;
22
23class incomplete extends base
24{
25    /**
26     * Constructor for incomplete captcha
27     *
28     * @param config $config
29     * @param driver_interface $db
30     * @param language $language
31     * @param request_interface $request
32     * @param template $template
33     * @param user $user
34     * @param string $phpbb_root_path
35     * @param string $phpEx
36     */
37    public function __construct(config $config, driver_interface $db, language $language, request_interface $request,
38                                protected template $template, user $user, protected string $phpbb_root_path, protected string $phpEx)
39    {
40        parent::__construct($config, $db, $language, $request, $user);
41    }
42
43    /**
44     * {@inheritDoc}
45     */
46    public function is_available(): bool
47    {
48        return true;
49    }
50
51    /**
52     * {@inheritDoc}
53     */
54    public function has_config(): bool
55    {
56        return false;
57    }
58
59    /**
60     * {@inheritDoc}
61     */
62    public function get_name(): string
63    {
64        return 'CAPTCHA_INCOMPLETE';
65    }
66
67    /**
68     * {@inheritDoc}
69     */
70    public function set_name(string $name): void
71    {
72    }
73
74    /**
75     * {@inheritDoc}
76     */
77    public function init(confirm_type $type): void
78    {
79    }
80
81    /**
82     * {@inheritDoc}
83     */
84    public function get_demo_template(): string
85    {
86        return '';
87    }
88
89    /**
90     * {@inheritDoc}
91     */
92    public function get_template(): string
93    {
94        $contact_link = phpbb_get_board_contact_link($this->config, $this->phpbb_root_path, $this->phpEx);
95
96        $this->template->assign_vars([
97            'CONFIRM_LANG'    => 'CONFIRM_INCOMPLETE',
98            'CONTACT_LINK'    => $contact_link,
99        ]);
100
101        return 'captcha_incomplete.html';
102    }
103
104    /**
105     * {@inheritDoc}
106     */
107    public function validate(): bool
108    {
109        return false;
110    }
111
112    /**
113     * {@inheritDoc}
114     */
115    public function get_error(): string
116    {
117        return '';
118    }
119
120    /**
121     * {@inheritDoc}
122     */
123    public function is_solved(): bool
124    {
125        return false;
126    }
127
128    /**
129     * {@inheritDoc}
130     */
131    public function get_attempt_count(): int
132    {
133        return 0;
134    }
135}